LK404-55 PIC CPU and Proton+ compiler by Crownhill
Posted: Mon Nov 22, 2004 9:59 pm
Has anyone had any experience using the LK404-55 with a PIC microcontroller (18F458) and the Proton+ PIC Basic compiler from Crownhill? I'm ripping my hair out so any suggestions would be greatfully appreciated!
I'm using the LK404-55 in the I2C bus mode. The PIC uController has built in MSSP circuitry and application specific pins for I2C communication. Pin RC3 is the SCL line and the pin RC4 is the SDA line. No problem so far.... I'm also using the Proton+ PIC Basic compiler from Crownhill. A great product( I hope ). The compiler has an HBUSOUT and an HBUSIN command to comminicate with I2C devices.
The HBUSOUT command structure is:
HBUSOUT Control, Address, [variable, variable...]
Where: Control=0 to write, 1 to read, Address is the 7-bit address of the I2C device, in the case of the LK404-55 display it is 0x45. The HBUSOUT command adds the 0 or 1 LSB to the 7-bit address for R/W, and the "clear display" command string is 0xFE, 0x58
So the command to the LK404-55 to write a "clear display" command should be:
HBUSOUT 0,$45,[$FE, $58] right??
Wrong!!!! What happens is that an upper case 'X' is written to the col1, row1 position of the dispaly as $58 is an uppercase ASCII 'X'. I then discovered that any command string writes whatever ASCII character follows the $FE address provided that it is implimented in the display. I then tried rewriting the command using the 8-bit address of the LK404-55 which is 0x8A.
The new command string is:
HBUSOUT $8A, $FE, [$58]
The same thing happens as before... Can I not see the forest for the trees?
I'm using the LK404-55 in the I2C bus mode. The PIC uController has built in MSSP circuitry and application specific pins for I2C communication. Pin RC3 is the SCL line and the pin RC4 is the SDA line. No problem so far.... I'm also using the Proton+ PIC Basic compiler from Crownhill. A great product( I hope ). The compiler has an HBUSOUT and an HBUSIN command to comminicate with I2C devices.
The HBUSOUT command structure is:
HBUSOUT Control, Address, [variable, variable...]
Where: Control=0 to write, 1 to read, Address is the 7-bit address of the I2C device, in the case of the LK404-55 display it is 0x45. The HBUSOUT command adds the 0 or 1 LSB to the 7-bit address for R/W, and the "clear display" command string is 0xFE, 0x58
So the command to the LK404-55 to write a "clear display" command should be:
HBUSOUT 0,$45,[$FE, $58] right??
Wrong!!!! What happens is that an upper case 'X' is written to the col1, row1 position of the dispaly as $58 is an uppercase ASCII 'X'. I then discovered that any command string writes whatever ASCII character follows the $FE address provided that it is implimented in the display. I then tried rewriting the command using the 8-bit address of the LK404-55 which is 0x8A.
The new command string is:
HBUSOUT $8A, $FE, [$58]
The same thing happens as before... Can I not see the forest for the trees?