Hi, I've started to learn programming mircocontrollers due to work school project. I started to learn basic from Nigel's page, yes it was a great introduction but only if I have more time......
However due to work loads and co-operation with partners I need to fall back to C programming using mikroC (more structural and easy for others to understand) . We've got simple mathematic functions done high low add minus blah. Now we Have arrive to the state to program the LCD controller. If just follow the mikroC C example and set it would probably be straight forward, but we don't want to make our project is copying people so we decide to to go for internal oscillation.
Now the problem strike us is which device flag(configuration fuses) should be turned on. According to nigel code it was _config0x3D18 which is 0011 1101 0001 1000(binary) so is this relfecting
bit 13 flash mem protection off
how ever bit 12 is undefined why 19 is 0 ?
bit 8 CPD 1 code protection off
bit 7 0 for VPP
bit 6 0 reset disable
bit5 0 digital input
bit 4 1 (I don;t knwo here) ( i think this is where we set the clock for our lcd is external or internal
bit 3 1 power up timer disable)
Bit 2 wdt 0 (if we are making a real time clock this will be 1, right ? another function is need to prevent it loops without sopping right)
oh besides this is example code from mikroC
not sure how to paste mikroC schmetic
However due to work loads and co-operation with partners I need to fall back to C programming using mikroC (more structural and easy for others to understand) . We've got simple mathematic functions done high low add minus blah. Now we Have arrive to the state to program the LCD controller. If just follow the mikroC C example and set it would probably be straight forward, but we don't want to make our project is copying people so we decide to to go for internal oscillation.
Now the problem strike us is which device flag(configuration fuses) should be turned on. According to nigel code it was _config0x3D18 which is 0011 1101 0001 1000(binary) so is this relfecting
bit 13 flash mem protection off
how ever bit 12 is undefined why 19 is 0 ?
bit 8 CPD 1 code protection off
bit 7 0 for VPP
bit 6 0 reset disable
bit5 0 digital input
bit 4 1 (I don;t knwo here) ( i think this is where we set the clock for our lcd is external or internal
bit 3 1 power up timer disable)
Bit 2 wdt 0 (if we are making a real time clock this will be 1, right ? another function is need to prevent it loops without sopping right)
oh besides this is example code from mikroC
Code:
char *text = "mikroElektronika";
void main() {
TRISB = 0;
LCD_Init(&PORTB); // Initialize LCD connected to PORTB
LCD_Cmd(LCD_CLEAR); // Clear display
LCD_Cmd(LCD_CURSOR_OFF); // Turn cursor off
LCD_Out(1,1, text); // Print text to LCD, 2nd row, 1st column
Delay_ms(1000);
LCD_Out(2,6,"mikroE");
}//~!j
not sure how to paste mikroC schmetic
Last edited: