Hi,
There are only 7 bits in your example, you want to set it to use the instruction clock as the source, I think this shoukd do it.When you run the PIC at 20MHz but tell the compiler it's being run at 48MHz all the timings will be off by a factor of 2.4.Code:T0CON = %11000111 'TMR0 ON, 8bit mode, instruction clock as source, prescaler assigned to TMR0, 256:1 ratio
A PAUSE 10 will actually be 24ms instead of 10ms. The same thing happens with ALL other commands that relies on software timing, including LCD-out. The fact that the display does NOT work when the compiler uses the correct OSC value to calculate the timings suggests that the LCD is slower than "normal". Try increasing theAnd add a bit of delay at the start of the code to allow the LCD to start up properly.Code:DEFINE LCD_COMMANDUS 2000 ' Command delay time in us DEFINE LCD_DATAUS 50 ' Data delay time in us
/Henrik.




Bookmarks