PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3....

12
Page 1 of 12 PIC Trainer Board Initial Test Procedures The PIC Trainer Board is delivered with two PIC16F84A microcontroller units where either one is to be programmed with: (1) LED_TEST.HEX that must programed with provided code (Marked as PIC 1 in Photo 2) for testing the interface between the PIC and the LEDs (LED3 – LED10), and (2) LCD_TEST.HEX that must programed with code (marked as PIC2 in Photo 3 or Photo 4) for testing between the PIC and the Liquid Crystal Display (LCD) module. Note: the test codes are on BB under Orientation folder or can be downloaded from www.ucdistancetraining.org, select Download These tests are described below. The oscillator/resonator must be wired in BLUE or BLACK on the trainer board. There are two sets of ribbon cables (two 20leads mixed colors in 3” and 6.5” length shown below) with male heading for you do the testing and lab exercises of the trainer board. Please refer to the following photo 1: Photo1. Testing Wires: The 3” and 6.5” ribbon cables

Transcript of PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3....

Page 1: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 1 of 12 

PIC Trainer Board Initial Test Procedures  The PIC Trainer Board is delivered with two PIC16F84A microcontroller units where either one is to be programmed with:  (1) LED_TEST.HEX that must programed with provided code (Marked as PIC 1 in Photo 2) for    testing the interface between the PIC and the LEDs (LED3 – LED10), and   (2) LCD_TEST.HEX that must programed with code (marked as PIC2 in Photo 3 or Photo 4) for    testing between the PIC and the Liquid Crystal Display (LCD) module.  

Note: the test codes are on BB under Orientation folder or can be downloaded from www.ucdistancetraining.org, select Download  These tests are described below. The oscillator/resonator must be wired in BLUE or BLACK on the trainer board. There are two sets of ribbon cables (two 20‐leads mixed colors in 3” and 6.5” length shown below) with male heading for you do the testing and lab exercises of the trainer board. Please refer to the following photo 1:  

  

Photo1. Testing Wires: The 3” and 6.5” ribbon cables    

Page 2: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 2 of 12 

Test #1 – PIC16F84A‐to‐LED Interface  NOTE: Refer to Figure 1, 2, or 3 and Photo 2, 3, or 4 for guidance while making connections,      setting switches, and placing the PIC MCU.  1. Connect the eight‐pin jumper between PORTB_18P_INTER connector X10 and LED_INTER 

connector X6. The orientation of the jumper is not critical for this test. Interconnections presented in 8 Brown wires. 

Summary of the Interface Connections between X10 and X6: PORTB_18P_INTER, X10, Pin 1 (RB0) <====> X6, Pin 1 PORTB_18P_INTER, X10, Pin 2 (RB1) <====> X6, Pin 2 PORTB_18P_INTER, X10, Pin 3 (RB2) <====> X6, Pin 3 PORTB_18P_INTER, X10, Pin 4 (RB3) <====> X6, Pin 4 PORTB_18P_INTER, X10, Pin 5 (RB4) <====> X6, Pin 5 PORTB_18P_INTER, X10, Pin 6 (RB5) <====> X6, Pin 6 PORTB_18P_INTER, X10, Pin 7 (RB6) <====> X6, Pin 7 PORTB_18P_INTER, X10, Pin 8 (RB7) <====> X6, Pin 8 

 2. Connect two short jumpers between RESONATOR_INTER connector SV4, Pins 1 and 3, and 

PORTA_18P_INTER connector X8, Pins 7 and 8. Interconnections presented in Blue or Black.  

  Summary of the Interface Connections between X8 and SV4: PORTA_18P_INTER, X8, Pin 7 (OSC2) <====> SV4, Pin 1 PORTA_18P_INTER, X8, Pin 8 (OSC1) <====> SV4, Pin 3 

 3. Set switches S1: 1 through 5 to OFF and S1: 6 through 10 ON. 4. Set switches S4: 1 to OFF and S4: 2 to ON. 5. Set switches S5: 1 through 4 to ON and S5: 5 through 8 to OFF. 6. Set switches S6: 1 through 8 to OFF. 7. Lift the handle of the Zero Insertion Force (ZIF) socket, IC4. 8. Place the #1 PIC16F84A into the ZIF socket. Make certain that the notch end of the PIC is 

facing the handle end of the socket and that the PIC is mounted closest to the handle end of the socket.  

9. Do NOT hold or press on the MCU, when lower the handle of the ZIF socket (just lower the handler). 

10. Plug the wall‐mounted power supply connector plug into the trainer board Power Jack, J1.  11. Plug the power supply into an outlet. 12. Follow the procedures in “Programming_the_PIC16F84_Using_PICkit2” (available on 

www.ucdistancetraining.org) to program this PIC16F84A MCU.  NOTE: The program will run automatically when the program is completed. The LEDs      (LED3 through LED10) will turn on for about 0.5s and turn off for 0.5s. Then, LED3 –      LED6 will light for 0.5s and turn off for 0.5s, followed by LED7 – LED10 turning on      and off. This sequence will repeat until power is removed from the board. 

Page 3: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 3 of 12 

PORTB

Resonato

r Connectio

ns

PORTA

Outputs: RB0, RB1, RB2, RB3, RB4, RB5, 

RB6, RB7

12

S4

ON

S6

12

34

56

78

ON

23

45

67

81S5

ON

23

45

67

81

910

S1

PIC16F84A

 Figure 1. LED Test Interconnections, Switch Settings, and PIC Placement 

 

Note: This Figure 1 is based on the Rev2 board layout. All the connectors on    Rev3 board are the same as Rev2, but their physical locations may not be    exact the same as Rev2.    Please check against the label marks on the Rev3 board.    

S1: 1-5 OFF & 6-10 ON

S4: 1 OFF & 2 ON

S5: 1-4 ON & 5-8 OFF S6: 1-8

OFF

LEDs Interface

Resonator Interface

Page 4: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 4 of 12 

 

   

  

Photo 2. LED Test Settings and PIC Placement  

Note: This Photo 2 is based on the Rev2 board. All the connectors on Rev3 board    are the same as Rev2, but their physical locations may not be exact the    same as Rev2.    Please check against the label marks on the Rev3 board. 

  

   

S1: 1-5 OFF & 6-10 ON

S4: 1 OFF & 2 ON

S5: 1-4 ON & 5-8 OFF

S6: 1-8 OFF

Resonator Interface

LEDs Interface

Power to Breadboard

(Options)

PIC 1

Page 5: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 5 of 12 

Test #2 – LCD Module Parallel Communications  

NOTE: If you have a LCD module that requires Negative Reference Voltage on its Vo, then skip Pages 5‐8 and go straight to Pages 9‐12.  NOTE: Refer to Figure 2and photo 3 for guidance while making connections, setting switches, and inserting the PIC MCU. 1. Connect the eight‐pin jumper between PORTB_18P_INTER connector X10 and Pins 1 – 8 of 

LCD_INTER connector X29. Make certain that Pin 1 of X10 is connected to Pin 1 of X29. Interconnections presented in Brown. 

Summary of the Interface Connections between X10 and X29: PORTB_18P_INTER, X10, Pin 1 (RB0) <====> X29, Pin 1 PORTB_18P_INTER, X10, Pin 2 (RB1) <====> X29, Pin 2 PORTB_18P_INTER, X10, Pin 3 (RB2) <====> X29, Pin 3 PORTB_18P_INTER, X10, Pin 4 (RB3) <====> X29, Pin 4 PORTB_18P_INTER, X10, Pin 5 (RB4) <====> X29, Pin 5 PORTB_18P_INTER, X10, Pin 6 (RB5) <====> X29, Pin 6 PORTB_18P_INTER, X10, Pin 7 (RB6) <====> X29, Pin 7 PORTB_18P_INTER, X10, Pin 8 (RB7) <====> X29, Pin 8 

 2. Connect a two‐pin jumper between PORTA_18P_INTER connector X8, Pins 1 (RA0) and 2 

(RA1) and LCD_INTER connector X29 Pins 10 (E) and 9 (RS), respectively. Again, please note: Interconnections presented in Blue. 

Summary of the Interface Connections between X8 and X29:   PORTA_18P_INTER, X8: Pin1 (RA0) <=========> X29: Pin 10 (LCD, E)   PORTA_18P_INTER, X8: Pin2 (RA1) <=========> X29: Pin 9 (LCD, RS) 

 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and 4 

GND. These are the ground connections to the trainer board.  Interconnections presented in Red  that are Gnd connections. 

Summary of the Interface Connections between X27 and X29:   POWER_CONN, X27: Pin3 (GND) <=========> X29: Pin 11 (LCD, R/W)   POWER_CONN, X27: Pin4 (GND) <=========> X29: Pin 12 (LCD, Vo)  

4. Connect two short jumpers between RESONATOR_INTER connector SV4, pins 1 and 3, and PORTA_18P_INTER, X8 connector Pins 7 and 8. Interconnections presented in Blue or Black.  

  Summary of the Interface Connections between X8 and SV4: PORTA_18P_INTER, X8, Pin 7 (OSC2) <====> SV4, Pin 1 PORTA_18P_INTER, X8, Pin 8 (OSC1) <====> SV4, Pin 3 

 

Page 6: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 6 of 12 

5. Connect the LCD 14 Pin plug to the SV1 (LCD_CONN) socket that is located by right lower corner of the breadboard.  

6. Set switches S1: 1 through 5 to OFF and S1: 6 through 10 ON. 7. Set switches S4: 1 to OFF and S4: 2 to ON. 8. Set switches S5: 1 through 4 to ON and S5: 5 through 8 to OFF. 9. Set switches S6: 1 through 8 to OFF. 10. Lift the handle of the Zero Insertion Force (ZIF) socket IC4. 11. Place the #2 PIC16F84A into the ZIF socket. Make certain that the notch end of the PIC is 

facing the handle end of the socket and that the PIC is mounted closest to the handle end of the socket. 

12. Do NOT hold or press on the MCU, when lower the handle of the ZIF socket (just lower the handler). 

13. Follow the procedures in “Programming_the_PIC16F84_Using_PICkit2” (available on www.ucdistancetraining.org) to program this PIC16F84A MCU.  NOTE: Upon completion of programming, the program will run automatically and the LCD    will display the message **Congratulations** on the first line and ***Test    Complete*** on the second line.  If the LED test or programming is unsuccessful, or if the programming is successful, but the LCD does not display the message, please contact Dr. Steve Hsiung ([email protected])(757‐683‐4606) or Richard Seriani ([email protected])(757‐410‐7889) for assistance.  

Page 7: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 7 of 12 

PORTB

Resonato

r Connectio

ns PORTAOutputs: 

RA0=>E, RA1=>RS

Outputs: RB0, RB1, RB2, RB3, RB4, RB5, RB6, RB7=> 

D0 to D7

Gnd

R/W & Vo => Gnd

ON

23

45

67

81

910

S1

12

S4ON

S6

12

34

56

78

ON

23

45

67

81S5

Figure 2. LCD Test Interconnections, Switch Settings, and PIC Placement 

This Figure 2 only demonstrates the regular LCD module interface that does on include the LCD module requires negative reference voltage on its Vo line. Please see Pages 9-12 for details. Note: This Figure 2 is based on the Rev2 board layout. All the connectors on    Rev3 board are the same as Rev2, but their physical locations may not be    exact the same as Rev2.    Please check against the label marks on the Rev3 board. 

S1: 1-5 OFF & 6-10 ON

S4: 1 OFF & 2 ON

S5: 1-4 ON & 5-8 OFF

S6: 1-8 OFF

Resonator Interface

LCD Interface

LCD Connector

Page 8: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 8 of 12 

Photo 3. LCD Test Settings and PIC Placement 

This Photo 3 only demonstrates the regular LCD module interface that does on include the LCD module requires negative reference voltage on its Vo line. Please see Pages 9-12 for details. Note: This Photo 3 is based on the Rev2 board. All the connectors on Rev3 board    are the same as Rev2, but their physical locations may not be exact the    same as Rev2.    Please check against the label marks on the Rev3 board. 

S1: 1-5 OFF & 6-10 ON

S4: 1 OFF & 2 ON

S5: 1-4 ON & 5-8 OFF

S6: 1-8 OFF

Power to Breadboard (Required)

Resonator Interface

LCD Interface

LCD Connection

PORTA Interfac

PORTB Interface

Vo & R/W to GND

PIC 2

Page 9: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 9 of 12 

Test #2 Alternative– LCD Module with Negative Ref. Voltage Parallel Communications 

  

1. Connect the eight‐pin jumper between PORTB_18P_INTER connector X10 and Pins 1 – 8 of LCD_INTER connector X29. Make certain that Pin 1 of X10 is connected to Pin 1 of X29. Interconnections presented in Brown.  

Summary of the Interface Connections between X10 and X29: PORTB_18P_INTER, X10, Pin 1 (RB0) <====> X29, Pin 1 PORTB_18P_INTER, X10, Pin 2 (RB1) <====> X29, Pin 2 PORTB_18P_INTER, X10, Pin 3 (RB2) <====> X29, Pin 3 PORTB_18P_INTER, X10, Pin 4 (RB3) <====> X29, Pin 4 PORTB_18P_INTER, X10, Pin 5 (RB4) <====> X29, Pin 5 PORTB_18P_INTER, X10, Pin 6 (RB5) <====> X29, Pin 6 PORTB_18P_INTER, X10, Pin 7 (RB6) <====> X29, Pin 7 PORTB_18P_INTER, X10, Pin 8 (RB7) <====> X29, Pin 8 

 2. Connect a two‐pin jumper between PORTA_18P_INTER connector X8, Pins 1 (RA0) and 2 

(RA1) and LCD_INTER connector X29 Pins 10 (E) and 9 (RS), respectively. Again, please note: Interconnections presented in Blue.  

Summary of the Interface Connections between X8 and X29:   PORTA_18P_INTER, X8: Pin1 (RA0) <=========> X29: Pin 10 (LCD, E)   PORTA_18P_INTER, X8: Pin2 (RA1) <=========> X29: Pin 9 (LCD, RS) 

 3. Connect a two‐pin jumper between X29, Pin 11 (R/W) to GND on connector X27 Pin 3 and 

X29, Pin 12 (Vo) to ‐5V on connector X44, Pin 2. These are the ground and Negative Reference Voltage connections to the trainer board.  Interconnections presented in Red  that are ‐5V Ref and Gnd connections.  

Summary of the Interface Connections between X27 and X29 and X44 with Neg Ref on LCD Vo: 

  POWER_CONN, X27: Pin3 (GND)    <=========> X29: Pin 11 (LCD, R/W)   ‐POWER_CONN, X44: Pin2 (‐5v/‐12v) <=========> X29: Pin 12 (LCD, Vo)  

4. Connect two short jumpers between RESONATOR_INTER connector SV4, pins 1 and 3, and PORTA_18P_INTER, X8 connector Pins 7 and 8. Interconnections presented in Blue or Black.   

  Summary of the Interface Connections between X8 and SV4: PORTA_18P_INTER, X8, Pin 7 (OSC2) <====> SV4, Pin 1 PORTA_18P_INTER, X8, Pin 8 (OSC1) <====> SV4, Pin 3 

Page 10: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 10 of 12 

 5. Connect the LCD 14 Pin plug to the SV1 (LCD_CONN) socket that is located by right lower 

corner of the breadboard.  6. Set switches S1: 1 through 5 to OFF and S1: 6 through 10 ON. 7. Set switches S4: 1 to OFF and S4: 2 to ON. 8. Set switches S5: 1 through 4 to ON and S5: 5 through 8 to OFF. 9. Set switches S6: 1 through 8 to OFF. 10. Lift the handle of the Zero Insertion Force (ZIF) socket IC4. 11. Place the #2 PIC16F84A into the ZIF socket. Make certain that the notch end of the PIC is 

facing the handle end of the socket and that the PIC is mounted closest to the handle end of the socket. 

12. Do NOT hold or press on the MCU, when lower the handle of the ZIF socket (just lower the handler). 

13. Follow the procedures in “Programming_the_PIC16F84_Using_PICkit2” (available on www.ucdistancetraining.org) to program this PIC16F84A MCU.  NOTE: Upon completion of programming, the program will run automatically and the LCD    will display the message **Congratulations** on the first line and ***Test    Complete*** on the second line.  If the LED test or programming is unsuccessful, or if the programming is successful, but the LCD does not display the message, please contact Dr. Steve Hsiung ([email protected])(757‐683‐4606) or Richard Seriani ([email protected])(757‐410‐7889) for assistance.  

Page 11: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 11 of 12 

PORTB

Resonato

r Connectio

ns PORTAOutputs: 

RA0=>E, RA1=>RS

Outputs: RB0, RB1, RB2, RB3, RB4, RB5, RB6, RB7=> 

D0 to D7

Gnd

Vo => ‐5V & R/W => Gnd

ON

23

45

67

81

910

S1

12

S4ON

S6

12

34

56

78

ON

23

45

67

81S5

Figure 3. LCD with ‐5V Ref Test Interconnections, Switch Settings, and PIC Placement 

This Figure 3 demonstrates the alternative LCD module that requires Negative Ref Voltage on its Vo line. Note: This Figure 3 is based on the Rev2 board layout. All the connectors on    Rev3 board are the same as Rev2, but their physical locations may not be    exact the same as Rev2.    Please check against the label marks on the Rev3 board. 

S1: 1-5 OFF & 6-10 ON

S4: 1 OFF & 2 ON

S5: 1-4 ON & 5-8 OFF

S6: 1-8 OFF

Resonator Interface

LCD Interface

LCD Connector

LCD Neg Ref Vo

Interface

R/W to GND

Page 12: PIC Trainer Board - uC Distance Trainingucdistancetraining.org/preworkshpfiles/Initial... · 3. Connect a two‐pin jumper between X29, Pins 11 (R/W) and 12 (Vo), to X27 Pins 3 and

Page 12 of 12 

Photo 4. LCD Test Settings and PIC Placement 

This Photo 4 demonstrates the alternative LCD module that requires Negative Ref voltage on its Vo line. Note: This Photo 4 is based on the Rev2 board. All the connectors on Rev3 board    are the same as Rev2, but their physical locations may not be exact the    same as Rev2.    Please check against the label marks on the Rev3 board. 

S1: 1-5 OFF & 6-10 ON

S4: 1 OFF & 2 ON

S5: 1-4 ON & 5-8 OFF

S6: 1-8 OFF

Power to Breadboard (Required)

Resonator Interface

LCD Interface

LCD Connection

PORTA Interfac PORTB

Interface

Vo to -5V & R/W to

GND

PIC 2

LCD Vo to -5V