Rayl113, I assume the display is going to be multiplexed as all you are using is port c? Is it going to have latches for the digit data or is it going to be some kind of serial display?
Rayl113, I assume the display is going to be multiplexed as all you are using is port c? Is it going to have latches for the digit data or is it going to be some kind of serial display?
Dave Purola,
N8NTA
EN82fn
The display is laid out like this;
RB0=A
RB1=B
RB2=C
RB3=D
RB4=E
RC0=F
RC1=G
RC2=dp
RC3=Digit-1
RC4=Digit-2
RC5=Digit-3
RC6=Digit-4(future)
RC7=Digit-5(future)
I'm using NPN transistors to switch the digit commons to ground.
It would probably be a good idea to latch in the display data but I'm not sure how to proceed.
It's mostly learn by trial and error at this point.
Rayl113, I have attached an old program that you can use parts of or simply as a template to understand the workings of a multiplexed display using a pic. I hope this helps. I found an old hallway clock from a school and backward engineered the circuit. I just had to as the clock has 5 inch 7 segment digits. It used a pic processor so, I redesigned the software to accomodate the already designed circuit. Works Great....
Dave Purola,
N8NTA
EN82fn
Thanks. I think I got that part figured out;
Display:
'Segment A = PORTB.0
'Segment B = PORTB.1
'Segment C = PORTB.2
'Segment D = PORTB.3
'Segment E = PORTB.4
'Segment F = PORTC.0
'Segment G = PORTC.1
'Segment dp = PORTC.2
'Digit1 = PORTC.3
'Digit2 = PORTC.4
'Digit3 = PORTC.5
Where I'm stuck is building the tables and selecting the information to send to each digit. I have a spreadsheet with the values already calculated.
I want to sample PORTD and use that as the address of the info I want to send to the digits.
e.g., If PORTB = $3F, I want to use Address $3F as a pointer within the table and pull the info from that location and send it to the digits. Let's say "C19".
I need "C" in digit 1, "1" in digit 2, and "9" in digit 3.
This is where I'm stuck. The manual is really lacking when it comes to creating Lookup tables. I've looked at some of the example files, but gotten more confused.
So any help on this would be appreciated.
Rayl113, It is possible, as you can have a table that is upto 255 entries in size maximum. An easy way is to have 3 tables, one for each digit and then use the "3f" entry as the index. The output of each table would be the digit value to display. The other way is to use a table that outputs "word" values. That way you only have one table for the lookup, indexed by a byte value from "00" to "ff" and outputs the word. That way the word can have a value equal to between "0000" and "ffff" . The entries into the table for the output could be the 3 digit hex representation of the display such as "C19".
Dave Purola,
N8NTA
EN82fn
I got it working by using 3 tables. Thanks. I never could get the word version to work. It only gave me 16 bits and I needed 24. Haven't tried the long word version yet. That's next.
Now I need to set the FOSC bits in the CONFIG1H register to 0010. I'm sure it's a CON command. But don't know which one. Any help appreciated.
Rayl113, I'm glad you got it working, I just got back from a vacation with the wife and kids. We did some serious shooting and the wife likes gun's now... Yipeeeee
Dave Purola,
N8NTA
EN82fn
Bookmarks