#include <p18f4620.h>
#pragma config OSC = INTIO67
#pragma config PWRT = OFF, BOREN = OFF, BORV = 1
#pragma config WDT = OFF, WDTPS = 32768
#pragma config MCLRE = ON
union {
unsigned char byte;
struct {
unsigned di:1; // Data/Instruction
unsigned rw:1; // Read/Write
unsigned cs1:1; // Chip Select 1
unsigned cs2:1; // Chip Select 2
unsigned reset:1; // Reset
unsigned dumba:1; // 3 Dummy fillers: dumb(a,b,c)
unsigned dumbb:1;
unsigned dumbc:1;
};
} glcd;
void main (void)
{
OSCCON = 0x72; // 8 MHz internal clock
OSCTUNEbits.PLLEN=1; // Enable PLL 8 x 4(PLL) = 32 MHz
while(!OSCCONbits.IOFS); // Wait for osc to be stable
while(1){
glcd.di = 1;
glcd.rw = 1;
glcd.cs1 = 0;
glcd.cs2 = 1;
glcd.reset = 1;
}
}