Hi. I'm new to gcb,can anyone help me please.
I have tried to use the gcb glcd commands with 18f25k22 with #define GLCD_TYPE_SSD1306 but get these compile errors
glcd_KS0108.h (70): Error: GLCD_RS is not a valid I/O pin or port
glcd_KS0108.h (71): Error: GLCD_RW is not a valid I/O pin or port
glcd_KS0108.h (72): Error: GLCD_ENABLE is not a valid I/O pin or port
glcd_KS0108.h (73): Error: GLCD_CS1 is not a valid I/O pin or port
glcd_KS0108.h (74): Error: GLCD_CS2 is not a valid I/O pin or port
glcd_KS0108.h (75): Error: GLCD_RESET is not a valid I/O pin or port
glcd_KS0108.h (78): Error: Incorrect parameters in Set, expected: Set variable.bit status
glcd_KS0108.h (80): Error: Incorrect parameters in Set, expected: Set variable.bit status
glcd_KS0108.h (84): Error: Incorrect parameters in Set, expected: Set variable.bit status
the list goes on. Why does it say KS0108?
Is it my config? Here's the start,the rest is pasted from examples. Any help welcome.
Have you reviewed all the glcd demos?
What version are you using?
And, does and LED flash with this configuration? Can you test a simple flashing LED to ensure you have the basic configuration working.
If an LED works have you been able to run the I2C discovery working?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You have an error in your GLCD Hardware settings: #define GLCD_TYPE_SSD1306 should be #define GLCD_TYPE GLCD_TYPE_SSD1306
There may be other errors in the code, but I got a cut down version of yours to work by fixing that line.
You also have the line define HI2C_DATA which sets a particular pin as the HI2C data pin, but you haven't told it which pin to use. It should be #define HI2C_DATA PORTC.1 or similar and you also need to set that pin as an input. This example is from the help:
' Define I2C settings
#define HI2C_BAUD_RATE 400
#define HI2C_DATA PORTC.5
#define HI2C_CLOCK PORTC.4
'I2C pins need to be input for SSP module when used on Microchip PIC device
Dir HI2C_DATA in
Dir HI2C_CLOCK in
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Consider studying the Help file and Demos before writing your code. A lot of effort has been put into the Help and demos for new users to draw from.
You have used "define" when you should have used "config" and many are redundant or unnecessary. There is generally no need write a config register./bit unless you are specifically wanting to change the setting to something other than the default.
Thanks William, I have had more success using mega328p than pics as there seems less to set up in GCB.
I'm finding GCB very interesting, moving on from picaxe and using them took a few months before I could write anything worth while. Nice if there were more examples. How do I set a bit in a variable from another variable, like set with var1,var2 is for a port, not a variable? Instead of rotating var1.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi. I'm new to gcb,can anyone help me please.
I have tried to use the gcb glcd commands with 18f25k22 with #define GLCD_TYPE_SSD1306 but get these compile errors
glcd_KS0108.h (70): Error: GLCD_RS is not a valid I/O pin or port
glcd_KS0108.h (71): Error: GLCD_RW is not a valid I/O pin or port
glcd_KS0108.h (72): Error: GLCD_ENABLE is not a valid I/O pin or port
glcd_KS0108.h (73): Error: GLCD_CS1 is not a valid I/O pin or port
glcd_KS0108.h (74): Error: GLCD_CS2 is not a valid I/O pin or port
glcd_KS0108.h (75): Error: GLCD_RESET is not a valid I/O pin or port
glcd_KS0108.h (78): Error: Incorrect parameters in Set, expected: Set variable.bit status
glcd_KS0108.h (80): Error: Incorrect parameters in Set, expected: Set variable.bit status
glcd_KS0108.h (84): Error: Incorrect parameters in Set, expected: Set variable.bit status
the list goes on. Why does it say KS0108?
Is it my config? Here's the start,the rest is pasted from examples. Any help welcome.
Edit: Wrapped code with ~~~ for proper formatting
Last edit: William Roth 2017-02-17
Have you reviewed all the glcd demos?
What version are you using?
And, does and LED flash with this configuration? Can you test a simple flashing LED to ensure you have the basic configuration working.
If an LED works have you been able to run the I2C discovery working?
You have an error in your GLCD Hardware settings:
#define GLCD_TYPE_SSD1306
should be#define GLCD_TYPE GLCD_TYPE_SSD1306
There may be other errors in the code, but I got a cut down version of yours to work by fixing that line.
You also have the line
define HI2C_DATA
which sets a particular pin as the HI2C data pin, but you haven't told it which pin to use. It should be#define HI2C_DATA PORTC.1
or similar and you also need to set that pin as an input. This example is from the help:Hi Stan,
Consider studying the Help file and Demos before writing your code. A lot of effort has been put into the Help and demos for new users to draw from.
You have used "define" when you should have used "config" and many are redundant or unnecessary. There is generally no need write a config register./bit unless you are specifically wanting to change the setting to something other than the default.
Thanks William, I have had more success using mega328p than pics as there seems less to set up in GCB.
I'm finding GCB very interesting, moving on from picaxe and using them took a few months before I could write anything worth while. Nice if there were more examples. How do I set a bit in a variable from another variable, like set with var1,var2 is for a port, not a variable? Instead of rotating var1.
See the Help. SETWITH is a good method.