Define LCD_COMMANDUS = 100 'Command Delay (uS)
Define LCD_DATAUS = 50 'Data Delay (uS)
Define LCD_INITMS = 2
Define LCD_READ_BUSY_FLAG = 1 'NOTE: the above 3 defines are now ignored
JJW,You have set oscillator pins ra6 and ra7 as digital outputs.
Is it on purpose or is the simulator setting them?
Probably it won't matter.JJW,
Should they be input or one out and one in?
I can change them.
C.
Hi E,hi C,
Located the source of the 20MHz LCD problem, when the READ_BUSY FLG is used the LCD_INIT should have been ignored by the compiler, instead it appears to have been using the default value of 100.
This basic sim demo works fast at 20MHz, I have also formatted the N and E values.
Give it a try.
E
Rich (BB code):Define LCD_COMMANDUS = 100 'Command Delay (uS) Define LCD_DATAUS = 50 'Data Delay (uS) Define LCD_INITMS = 2 Define LCD_READ_BUSY_FLAG = 1 'NOTE: the above 3 defines are now ignored
hi,I have attached the latest program that you just sent me, with those changes. Also screen shot, showing the 'incorrect input' and the LCD data pins moving, but nothing on the screen.
Define LCD_DREG = PORTD 'Port for LCD Data
Define LCD_DBIT = 4 'Use upper 4 bits of Port
Define LCD_RSREG = PORTC 'Port for RegisterSelect (RS)
Define LCD_RSBIT = 3 '''6 'Port Pin for RS bit (pin25)
Define LCD_RWREG = PORTC
Define LCD_RWBIT = 5
Define LCD_EREG = PORTC 'Port for Enable (E)
Define LCD_EBIT = 4 'Port Pin for E bit (pin23)
Define LCD_BITS = 4 'Using 4-bit bus
Define LCD_LINES = 4 'Using 4 line Display
Define LCD_CHARS = 20
''Define LCD_COMMANDUS = 2000 'Command Delay (uS)
''Define LCD_DATAUS = 50 'Data Delay (uS)
Define LCD_INITMS = 2
Define LCD_READ_BUSY_FLAG = 1
Hi E,hi,
I have already explained the problem with LCD_INITMS in a previous post
Also you cannot use PORTC.6 for the UART and LCD, also explained.
Read my post #143.
If I correct your 30May0900.bas program as show in RED it works OK.
Rich (BB code):Define LCD_DREG = PORTD 'Port for LCD Data Define LCD_DBIT = 4 'Use upper 4 bits of Port Define LCD_RSREG = PORTC 'Port for RegisterSelect (RS) Define LCD_RSBIT = 3 '''6 'Port Pin for RS bit (pin25) Define LCD_RWREG = PORTC Define LCD_RWBIT = 5 Define LCD_EREG = PORTC 'Port for Enable (E) Define LCD_EBIT = 4 'Port Pin for E bit (pin23) Define LCD_BITS = 4 'Using 4-bit bus Define LCD_LINES = 4 'Using 4 line Display Define LCD_CHARS = 20 ''Define LCD_COMMANDUS = 2000 'Command Delay (uS) ''Define LCD_DATAUS = 50 'Data Delay (uS) Define LCD_INITMS = 2 Define LCD_READ_BUSY_FLAG = 1
How are you inputting the test message to the Oshonsoft Hardware UART tool.?Sorry missed the point! I changed RSBIT to 3 and now it shows 'TEST', but still doesn't accept $sentence. I even tried copying and pasting the $sentence from your last TXT. I'll check it all again.
![]()
Phew at last.!Regarding the New circuit, we now have a 1 second flashing LED
My UART tool looks the same as yours to the letter. I tried HEX ticked and unticked. I can enter the $sentence, into the 'ENTER' box, but it doesn't appear in the 'Send string' box, only the error.How are you inputting the test message to the Oshonsoft Hardware UART tool.?
Is it possible you are selecting the wrong Tool option.?? ie Software or PC terminal.??
Phew at last.!
Is this using a 20Mhz xtal with low pF caps and resistor ???
Eric
Hi,hi,
Can you copy and paste into a post the message string that is giving a problem
and a screen shot of the Enter box with the message pasted in.?
E
Hi,hi,
I have written and tested a very basic UART test, try it.
You can use any of the SEND keys with the Hardware Uart tool.
Lets know what you see.
E
hiSee attachment for the keypad pins, where you can see which pins are connected when each key is pressed. I'm a bit confused how to program the key inputs.
Hi E,hi
Post a circuit diagram showing how the switches are inter-connected and how they are assigned to the Rows and Columns, with say a key top notation
E