This project is to write the PIC code for a PIC to receive one of 12 separate variables from a PC via the COM port, and send it to a 7-segment LED display driver. The PC will send, for example "1", "12345", and the PIC will then send the data pulses for "12345" to daughterboard 1.
I have the hardware designed, except for assigning the pins on the motherboard section. A sample daughterboard has been built and works fine when driven by a PICAXE.
I also have a truth table for the data output format for each digit (Eight is shown as an example in the pseudocode below.)
The hardware schematic, pseudocode and truth table are in the attached ZIP file.
Richard
## Deliverables
Here is a pseudo-code listing of what the PIC needs to do.
Label data pin on PIC as "DATA"
Label each clock pin on PIC as "Clock 1" through Clock 12"
FOR a = 1 to 12 )
Clock a high )
Clock a low )
DATA high )
Clock a high ) Routine to reset all 12 banks to blank displays
Clock a low )
DATA low )
FOR b = 1 to 35 )
Clock a high )
Clock a low )
next b )
next a )
LABEL WAIT_FOR_DATA:
Clock a high )
Clock a low )
DATA high ) Routine to ready M5451 for data bits
Clock a high )
Clock a low )
DATA low )
Serial In Variable BANK 'Receive the bank number to be updated
Serial In variables a1, a2, a3, a4, a5 'Receive the five digits to be displayed
LET a0 = a1
IF a0=0 THEN GOSUB Zero )
IF a0=1 THEN GOSUB One )
IF a0=2 THEN GOSUB Two )
IF a0=3 THEN GOSUB Three )
IF a0=4 THEN GOSUB Four ) subroutine to send 7 clock pulses with
IF a0=5 THEN GOSUB Five ) or without data pulses to display the
IF a0=6 THEN GOSUB Six ) relevant digit.
IF a0=7 THEN GOSUB Seven )
IF a0=8 THEN GOSUB Eight )
IF a0=9 THEN GOSUB Nine )
LET a0 = a2
IF a0=0 THEN GOSUB Zero
IF a0=1 THEN GOSUB One
IF a0=2 THEN GOSUB Two
IF a0=3 THEN GOSUB Three
IF a0=4 THEN GOSUB Four
IF a0=5 THEN GOSUB Five
IF a0=6 THEN GOSUB Six
IF a0=7 THEN GOSUB Seven
IF a0=8 THEN GOSUB Eight
IF a0=9 THEN GOSUB Nine
LET a0 = a3
IF a0=0 THEN GOSUB Zero
IF a0=1 THEN GOSUB One
IF a0=2 THEN GOSUB Two
IF a0=3 THEN GOSUB Three
IF a0=4 THEN GOSUB Four
IF a0=5 THEN GOSUB Five
IF a0=6 THEN GOSUB Six
IF a0=7 THEN GOSUB Seven
IF a0=8 THEN GOSUB Eight
IF a0=9 THEN GOSUB Nine
LET a0 = a4
IF a0=0 THEN GOSUB Zero
IF a0=1 THEN GOSUB One
IF a0=2 THEN GOSUB Two
IF a0=3 THEN GOSUB Three
IF a0=4 THEN GOSUB Four
IF a0=5 THEN GOSUB Five
IF a0=6 THEN GOSUB Six
IF a0=7 THEN GOSUB Seven
IF a0=8 THEN GOSUB Eight
IF a0=9 THEN GOSUB Nine
LET a0 = a5
IF a0=0 THEN GOSUB Zero
IF a0=1 THEN GOSUB One
IF a0=2 THEN GOSUB Two
IF a0=3 THEN GOSUB Three
IF a0=4 THEN GOSUB Four
IF a0=5 THEN GOSUB Five
IF a0=6 THEN GOSUB Six
IF a0=7 THEN GOSUB Seven
IF a0=8 THEN GOSUB Eight
IF a0=9 THEN GOSUB Nine
WAIT_FOR_DATA Go back to the beginning to wait for the next data received.
SUBROUTINE Eight: An exampe of a one digit display. This lights
all segments - to not light a segment, the
DATA high clock pulse is sent with no simultaneous
Clock BANK high data pulse.
Clock BANK low
Data low
DATA high
Clock BANK high
Clock BANK low
Data low
DATA high
Clock BANK high
Clock BANK low
Data low
DATA high
Clock BANK high
Clock BANK low
Data low
DATA high
Clock BANK high
Clock BANK low
Data low
DATA high
Clock BANK high
Clock BANK low
Data low
DATA high
Clock BANK high
Clock BANK low
Data low
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
I would prefer the PIC 16F84A simply because I have a box of them.