Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I built the 4 line LCD version and the program LCD4CNTR.hex doesn't display
anything on my LCD. http://www.qsl.net/om3cph/counter/summary.html Funny thing is my circuit works with the program from this site: http://www.hamradioindia.org/circuits/fcountlcd.php Anybody know whats wrong with LCD4CNTR.hex? JJ |
#2
![]() |
|||
|
|||
![]()
While I haven't built that particular one, I have built a similar design of
Peter's with good success. There are some possibilities ... Peter relies on timing for the LCD. If your crystal frequency is higher than the frequency of the hex file you downloaded, or if your LCD is a little off (common if you got the LCD from a hobbyist source) then a blank display or a display of all black squares would be a common result. Check to be sure that the version of the hex file you downloaded matches your crystal frequency. Mag's site is incredibly slow and I haven't located the source, but he at least has the wiring to avoid being dependent on the timing. Whether he did or not I can't tell without seeing the source. Reading the LCD to tell whether it is ready, instead of waiting "long enough" is fairly uncommon because different brands of LCD seem to respond a little differently, but maybe you just got lucky. I would try slowing down your clock a bit as a test. This will give you an incorrect frequency readout, but it would let you know whether timing is the problem. One thing about LCDs -- there is no such thing as too slow, so if the only other crystal you have lying around is a lot slower, it will be fine for the experiment. If it turns out this is the problem, simply increase the LCD delay in Peter's source. ... "JJ" wrote in message ... I built the 4 line LCD version and the program LCD4CNTR.hex doesn't display anything on my LCD. http://www.qsl.net/om3cph/counter/summary.html Funny thing is my circuit works with the program from this site: http://www.hamradioindia.org/circuits/fcountlcd.php Anybody know whats wrong with LCD4CNTR.hex? JJ |
#3
![]() |
|||
|
|||
![]()
Oh duh!
I just looked again ... Peter and Mag wire the LCD differently. RS and LCDEN are swapped on the two circuits, so if your circuit works with Mag's code, of course it won't work with Peter's. ... "xpyttl" wrote in message ... While I haven't built that particular one, I have built a similar design of Peter's with good success. There are some possibilities ... Peter relies on timing for the LCD. If your crystal frequency is higher than the frequency of the hex file you downloaded, or if your LCD is a little off (common if you got the LCD from a hobbyist source) then a blank display or a display of all black squares would be a common result. Check to be sure that the version of the hex file you downloaded matches your crystal frequency. Mag's site is incredibly slow and I haven't located the source, but he at least has the wiring to avoid being dependent on the timing. Whether he did or not I can't tell without seeing the source. Reading the LCD to tell whether it is ready, instead of waiting "long enough" is fairly uncommon because different brands of LCD seem to respond a little differently, but maybe you just got lucky. I would try slowing down your clock a bit as a test. This will give you an incorrect frequency readout, but it would let you know whether timing is the problem. One thing about LCDs -- there is no such thing as too slow, so if the only other crystal you have lying around is a lot slower, it will be fine for the experiment. If it turns out this is the problem, simply increase the LCD delay in Peter's source. .. "JJ" wrote in message ... I built the 4 line LCD version and the program LCD4CNTR.hex doesn't display anything on my LCD. http://www.qsl.net/om3cph/counter/summary.html Funny thing is my circuit works with the program from this site: http://www.hamradioindia.org/circuits/fcountlcd.php Anybody know whats wrong with LCD4CNTR.hex? JJ |
#4
![]() |
|||
|
|||
![]()
Thanks for your input.
I see them wired identically and I checked a few times! And I am using a 4MHz crystal. Which version are you using? My LCD is a standard 2x16 one and the Mag display is broken on 2x8 lines. Did you compile Peter's source code yourself? JJ "xpyttl" wrote in : Oh duh! I just looked again ... Peter and Mag wire the LCD differently. RS and LCDEN are swapped on the two circuits, so if your circuit works with Mag's code, of course it won't work with Peter's. |
#5
![]() |
|||
|
|||
![]()
"JJ" wrote in message
... Thanks for your input. I see them wired identically and I checked a few times! Not quite. The LCD enable and Register Select lines are swapped between the two circuits. Look carefully -- it is confusing since the R/W line is the same (and it is between the two). Now, all I had to go by was Mag's schematic and Peter's source code. I didn't find either Mag's source or Peter's schematic. But Peter's source does expect LCDEN and RS to be on the opposite pins to Mag's schematic. And I am using a 4MHz crystal. I am using a 10 MHz crystal, but I modified Peter's code to accomodate that My LCD is a standard 2x16 one and the Mag display is broken on 2x8 lines. It's a pretty simple fix to deal with the 2x8. Most 1x16 displays are 2x8 with the two lines side by side. Mag has to add 0x40 when he gets to the ninth character. Just drop that add and you're good to go. Did you compile Peter's source code yourself? Yes. Back whenever it was I first started playing I may have used his hex file, that was a long time ago. But I can't resist the urge to play mself. ... |
#6
![]() |
|||
|
|||
![]()
"xpyttl" wrote in
: It Works! Not quite. The LCD enable and Register Select lines are swapped between the two circuits. Look carefully -- it is confusing since the R/W line is the same (and it is between the two). Now, all I had to go by was Mag's schematic and Peter's source code. I didn't find either Mag's source or Peter's schematic. But Peter's source does expect LCDEN and RS to be on the opposite pins to Mag's schematic. We must be looking at different diagrams. I have f84 pin 1 connected to LCD 6 and f84 pin 17 connected to LCD 4 on both designs. What I did was ground LCD 5. It worked for the Mag but not Peter's program. My LCD is a standard 2x16 one and the Mag display is broken on 2x8 lines. It's a pretty simple fix to deal with the 2x8. Most 1x16 displays are 2x8 with the two lines side by side. Mag has to add 0x40 when he gets to the ninth character. Just drop that add and you're good to go. Which line or area in LCD4CNTR.ASM can I find this extra 0x40 to remove? Did you compile Peter's source code yourself? Yes. Back whenever it was I first started playing I may have used his hex file, that was a long time ago. But I can't resist the urge to play mself. Well I recompiled it for me and it works. I will try Peter's hex file again to see if thats faulty. Thanks again for the tremendous help. JJ |
#7
![]() |
|||
|
|||
![]()
I made a error in my post.
The program that is working is the LCD4DIEC.asm and not LCD4CNTR.asm. Now that's a real puzzle. JJ |
#8
![]() |
|||
|
|||
![]()
"JJ" wrote in message
... Which line or area in LCD4CNTR.ASM can I find this extra 0x40 to remove? If you look at the code: movlw LINE1 ; continue at right half of display iorlw 080h ; Function set call PutCMD ; Position cursor leftmost on first line under the label NoDot, this code moves the cursor to the second line. It looks as if all you will see on the second line is the string " MHz" (leading space). Anyway, comment out these three and the " " should get written after the last digit instead of on the second line. Looking more closely at this code, Peter does use the busy flag -- I had looked at his initialization code where he only uses timing, but when he goes to write, he checks the busy. Up at the top of his code, the lines: E equ 2 ; LCD Enable control line RA2 R_W equ 0 ; LCD Read/Write control line RA0 RS equ 1 ; LCD Register-Select control line RA1 set the pins for LCD enable, R/W and Register Select. If you look at Mag's schematic, he places RS on RA0, RW on RA1, and E also on RA2. Peter's comment above those lines would lead you to suspect that they were on PORTB, but he actually uses them on PORTA. If you swap the connections to LCD pins 4 and 5 Peter's code might work. ... |
#9
![]() |
|||
|
|||
![]()
OK, I finally got the Mag code (that website was amazingly slow a little
earlier), and see that it is practically the same code, with the addition of the IF offset. *BUT* here is the kicker 125,126c132,133 R_W equ 0 ; LCD Read/Write control line RA0 RS equ 1 ; LCD Register-Select control line RA1 --- R_W equ 1 ; LCD Read/Write control line RA1 RS equ 0 ; LCD Register-Select control line RA0 ... "JJ" wrote in message ... I made a error in my post. The program that is working is the LCD4DIEC.asm and not LCD4CNTR.asm. Now that's a real puzzle. JJ |
#10
![]() |
|||
|
|||
![]()
"xpyttl" wrote in
: "JJ" wrote in message ... Which line or area in LCD4CNTR.ASM can I find this extra 0x40 to remove? If you look at the code: movlw LINE1 ; continue at right half of display iorlw 080h ; Function set call PutCMD ; Position cursor leftmost on first line under the label NoDot, this code moves the cursor to the second line. It looks as if all you will see on the second line is the string " MHz" (leading space). Anyway, comment out these three and the " " should get written after the last digit instead of on the second line. Looking more closely at this code, Peter does use the busy flag -- I had looked at his initialization code where he only uses timing, but when he goes to write, he checks the busy. I did that, now when there is a dot the display shows the frequency twice on the first line. There is a bit more to it. Up at the top of his code, the lines: E equ 2 ; LCD Enable control line RA2 R_W equ 0 ; LCD Read/Write control line RA0 RS equ 1 ; LCD Register-Select control line RA1 You are correct. These modded programs really need to be commented. I just set R-W equ 1 RS equ 0 and Peter's code works. BTW, why use a 10Mhz cystal. Does the counter have better actual resolution? Well, you are certainly a better program debugger than me! Thanks again, JJ |
Reply |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help I need a frequency Counter | Shortwave | |||
FCC: Broadband Power Line Systems | Policy | |||
North-Central Florida Mil Logs 9/10/2003 & 9/11/2003 | Scanner | |||
FS: Galaxy Melaka and Frequency Counter | CB | |||
FS: Galaxy Melaka and Frequency Counter | CB |