Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
"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. ... |
#2
![]() |
|||
|
|||
![]()
"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 |
#3
![]() |
|||
|
|||
![]()
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 |
#4
![]() |
|||
|
|||
![]()
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 |
#5
![]() |
|||
|
|||
![]()
"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. ... |
#6
![]() |
|||
|
|||
![]()
"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 |
#7
![]() |
|||
|
|||
![]()
Only problem now is the first line displays the frequency twice,all 8
digits repeat. 2nd line just shows " Mhz". 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 |