Good afternoon Gentlemen
I have been asked to create another project which I originally built 4 years ago using an 18x device. I have many PCBs in the cupboard that I wish to use.
My problem
In the LCD routine, I used a peek $30 to read the current state of the output port of the 18x
When I tried an 18M2 in its place it failed to work properly. I am presuming the peek of $30 has changed in the 18M2
Can anybody help me. I have spent thee last two days pulling my hair out. I couldn't find any thing relevant in my forum search's
I have been asked to create another project which I originally built 4 years ago using an 18x device. I have many PCBs in the cupboard that I wish to use.
My problem
In the LCD routine, I used a peek $30 to read the current state of the output port of the 18x
When I tried an 18M2 in its place it failed to work properly. I am presuming the peek of $30 has changed in the 18M2
Can anybody help me. I have spent thee last two days pulling my hair out. I couldn't find any thing relevant in my forum search's
Code:
symbol RS = 2 '0 = Command 1 = Data Register
symbol E = 3 '0 = Idle 1 = Enable
symbol RSCMDmask = %00000000 'Select Command register
symbol RSDATmask = %00000100 'Select Data register
'*************************************************************************
' Write Data to LCD Command or Data registers
'*************************************************************************
SendInitCmdByte:
pause 15 'Delay 15mS at 4MHz
SendCmdByte:
peek $30,rsbit 'Recover Out0 and Out1
RSbit = RSbit & %11 'Send to Command register
goto SendCmdOrDataByte
SendDataByte:
peek $30,RSbit 'Recover Out0 and Out1
RSbit = RSbit & %11 | RSDATmask 'Send to Data register
SendCmdOrDataByte:
pins = DByte & %11110000 | RSbit 'Put MSB out first
pulsout E,1 'Give a 10uS pulse on E
pins = DByte * %00010000 | RSbit 'Put LSB out second
pulsout E,1 'Give a 10uS pulse on E
return