COSC 422

Programming Assignment #2 - Due Date Wednesday February 8, 2016

You must hand in a well documented source code listing. You should pick a partnew to work with.

Bit Banging!!

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

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

On the receiver side

-RB7, RB6 and RB5 should have LEDs connected to them. Don't forget to use a resistor in the 300-2000 ohm range in series with each LED.

- 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.

IMPORTANT!! The mapping of input to output bits is as follows:

       RA1 -> RB7

       RA0 -> RB6

       RA7 -> RB5

    You should send RA1 followed by RA0 followed by RA7

- 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.