by NovaOne » Wed Jan 02, 2008 9:42 pm
by NovaOne
Wed Jan 02, 2008 9:42 pm
I see...
Is there any particular reason why the I2C LCD is not the better solution?
I use an I2C Bus to add extra peripherals, sensors etc because the c3024 has a limited number of Inputs and Outputs (I/O). My bit-banged code is slow (although probably fast enough for your application). The Hitec LCD port is fit for purpose and print command simple to use.
The spark fun SerLCD looks like the simplest solution for you.
However if you do decide to run with the I2C option:
So how do I code the LCD if i am using ports 15 and 16 ( for example). Meanwhile my PWM0 and PWM1 is being used up by SP03. Is it really complicated??
No its not complicated just use PWM0 and PWM1 ie ports 46 and 47 for SDA and SCL.;
i2c compatible LCD....... you can connect it to the same pins as the sp03 and any other I2C Bus compatible slave devices, as long as you have one set of pull up resistors on the lines somewhere.
The Adress for the Devantech module is I2cAddr = &Hc6
The command and text (byte) input register are 0, that is I2cReg =0
Numbers (bytes) placed in the command register from 0-27 are decoded as commands in the table shown in the link, and numbers (bytes) 32-255 and decoded as ASCII and displayed as characters on the screen. eg
- Code: Select all
'send the character "A"
I2cAddr = &Hc6
I2cReg =0
I2cData = 65
Gosub I2cByteWrite
This compares to: Print "A" for an LCD connected to the LCD port. (assuming your port is set up to 4800 first)
All the information you should need is here:
http://www.robot-electronics.co.uk/htm/Lcd03tech.htm
Good luck with your studies
Edited for spelling and formatting
I see...
Is there any particular reason why the I2C LCD is not the better solution?
I use an I2C Bus to add extra peripherals, sensors etc because the c3024 has a limited number of Inputs and Outputs (I/O). My bit-banged code is slow (although probably fast enough for your application). The Hitec LCD port is fit for purpose and print command simple to use.
The spark fun SerLCD looks like the simplest solution for you.
However if you do decide to run with the I2C option:
So how do I code the LCD if i am using ports 15 and 16 ( for example). Meanwhile my PWM0 and PWM1 is being used up by SP03. Is it really complicated??
No its not complicated just use PWM0 and PWM1 ie ports 46 and 47 for SDA and SCL.;
i2c compatible LCD....... you can connect it to the same pins as the sp03 and any other I2C Bus compatible slave devices, as long as you have one set of pull up resistors on the lines somewhere.
The Adress for the Devantech module is I2cAddr = &Hc6
The command and text (byte) input register are 0, that is I2cReg =0
Numbers (bytes) placed in the command register from 0-27 are decoded as commands in the table shown in the link, and numbers (bytes) 32-255 and decoded as ASCII and displayed as characters on the screen. eg
- Code: Select all
'send the character "A"
I2cAddr = &Hc6
I2cReg =0
I2cData = 65
Gosub I2cByteWrite
This compares to: Print "A" for an LCD connected to the LCD port. (assuming your port is set up to 4800 first)
All the information you should need is here:
http://www.robot-electronics.co.uk/htm/Lcd03tech.htm
Good luck with your studies
Edited for spelling and formatting
Last edited by NovaOne on Thu Jan 03, 2008 7:04 am, edited 2 times in total.