COSC 422

Programming Assignment #2

 

 

Change programming teams. Grades will be shared by both members of the team.

 

You must hand in a well documented source code listing.

 

Bit Banging and 7 segment LEDs!!

 

You will transmit a 3 bit binary number from one PIC chip to another. The receiver chip will then display the number on a 7-segment LED.



Read Tutorial 7 from Nigel's page (link onclass page). We assume 9600 baud, 8 data bits, no parity, 1 stop bit). A quiet line goes high.

 

On the receiver side

 

-Wire up the 7 segment LED to your B port. DonÕt forget to use resistors on input (anode) lines. Resistors in the 500-2000 ohm range should be fine.

- RA2 is the receiver line

 

On the transmitter side

 

- RA1 , RA0, RA7 will be the numeric input with RA1 the most significant bit and RA7 the least significant bit. So RA1 assigned 1, RA0 assigned 1 and RA7 assigned 0 is interpreted as a binary 110 or decimal 6.

- RA6 is the  Òtoggle switchÓ . That is, when it is set to low, there is nothing to do. When it is set to high, then the binary three bits (RA1,RA0,RA7) should be read and transmitted. You will

need a push-down resistor.

- RA2 is the transmit line

 

You will need your chip as well as your partners. It will probably help if you can distinguish the 2 chips. One is the transmitter, one is the receiver. 75% of your grade is based upon your

transmitter and receiver successfully communicating. For the remaining 25% I will randomly pick a transmitter and a receiver and look for successful transmission. That is, any one of your chips should be able to communicate with any other chip.