post the schematic please (...or lcd model # ... ext osc ?)...digits to 2 displays...????
post the schematic please (...or lcd model # ... ext osc ?)...digits to 2 displays...????
Here is some code I wrote for a 4 digit display and a PIC16F914. There
is no cut and paste solution using these on chip LCD modules. Each LCD
has different number of segments, commons and duty. The best way
to get going is the worksheet located in the LCD section of the data
sheet. Using the LCD data sheet you assign each segment to an LCD register. I can probably help some if you supply the LCD data sheet.
Using the Data Sheet's pin addressing to function names, here's what I've come up with and verified "ok".
COM-0 LCD FUNCTION ADDRESS LCD SEGMENT IC Pin
SEG0 LCDDATA 0,0 Segment "C" 21
SEG1 LCDDATA 0,1 Segment "D" 22
SEG5 LCDDATA 0,5 Segment "E" 7
SEG6 LCDDATA 0,6 Segment "DP" 14
SEG8 LCDDATA 1,0 Segment "F" 18
SEG9 LCDDATA 1,1 Segment "A" 17
SEG10 LCDDATA 1,2 Segment "B" 16
SEG11 LCDDATA 1,3 Segment "G" 15
COM-1 LCD FUNCTION ADDRESS LCD SEGMENT IC Pin
SEG2 LCDDATA 3,2 Segment "G" 23
SEG3 LCDDATA 3,3 Segment "B" 24
SEG4 LCDDATA 3,4 Segment "DP" 6
SEG7 LCDDATA 3,7 Segment "D" 3
SEG12 LCDDATA 4,4 Segment "E" 2
SEG13 LCDDATA 4,5 Segment "A" 28
SEG14 LCDDATA 4,6 Segment "F" 27
SEG15 LCDDATA 4,7 Segment "C" 5
Thanks, Frank![]()
Hi Frank,
I would need to see a schematic and have the LCD dat sheet to say for
sure if its correct. It looks like you got the idea.
Try blinking a segment
Loop:
LCDDATA0.6 = 1 'Turn on DP
Pause 1000
LCDDATA0.6 = 0 'Turn off DP
Pause 1000
Goto Loop
Last edited by mark_s; - 16th April 2010 at 21:25.
Most PIC's have a "weak pull up" for the MCLR pin. On the 16F913, I don't see this is an option in any register, however, on page 220 "Configuration Bits" [CONFIG1] there is a reference to MCLR. To tie it to VDD they say to enter "0" for this binary string. Wouldn't this mean that because you'd use a "0", if not entering CONFIG1 at all, it would automatically default to "0" and apply a weak-pull up on MCLR?
Otherwise, I would have to have a resistor/cap tied to MCLR which I really don't have the room to do if it's not absolutely necessary.
Frank![]()
Not sure I understand what you are after but have you
_MCLRE_OFF
and made the pin an input?
Dave
Always wear safety glasses while programming.
I found that the PIC16F913 INC file didn't have all the configs listed and had to use the meProg, View, Configuration screen to set the configs from before flashing the device.
And thanks to Mark_S for that code sample. I had finally brought the 16F913 and LCD-S401M1TF to life using about 900 Words but rewriting using your example with the LookUp table and IF/THENs reduced it to just over 500 Words.
Last edited by LinkMTech; - 17th April 2010 at 22:31. Reason: Shout out to Mark S
Louie
Bookmarks