Hi all,
Having migrated a project to 18F45K22 so that I can run INTOSC with CLKOUT at 8MHz & PLL enabled (32MHz fosc), I'm having issues.
With the PLL enabled & project target set to 32MHz, the LCD commands do not translate correctly. If I disable PLL, set the project to 8MHz then all is well.
Previously, project was ok running on 18F452 with HS@32MHz & no changes to hardware since.
My suspicion lies with the lib timings for driving LCD. I've not had the opportunity to 'scope the drive yet.
Anyone had a similar issue?
Project files attached below as zip. Using latest mP Pro & EasyPic v.7.
Thanks!
[SOLVED] Issue with PIC18F45K22 INTOSC/PLL with LCD
[SOLVED] Issue with PIC18F45K22 INTOSC/PLL with LCD
Last edited by FRM on 09 Jan 2015 10:37, edited 1 time in total.
Re: Issue with PIC18F45K22 INTOSC/PLL with LCD
Try to use LATD rather than PORTD.
To avoid the RMW effects one should always use LATx registers when manipulating single output pins (in processors that have LATx registers, naturally). That you haven't had problems earlier only means that load capacitances of LCD connections are small in your circuit, but RMW effects are more pronounced in newer PICs so you've finally stumbled on them at high enough clock frequency.
Code: Select all
LCD_RS : sbit at LATD0_bit;
LCD_EN : sbit at LATD1_bit;
LCD_D4 : sbit at LATD2_bit;
LCD_D5 : sbit at LATD3_bit;
LCD_D6 : sbit at LATD4_bit;
LCD_D7 : sbit at LATD5_bit;
Re: Issue with PIC18F45K22 INTOSC/PLL with LCD
Hi Janni,
Many thanks for the clear explanation, I completely overlooked the LCD init variables being port referenced! I normally use LAT registers to manipulate the 18F+ series in my own code
for the reason you gave, but I have to admit I completely glossed over this one!
All the best,
Frankie
Many thanks for the clear explanation, I completely overlooked the LCD init variables being port referenced! I normally use LAT registers to manipulate the 18F+ series in my own code
for the reason you gave, but I have to admit I completely glossed over this one!
All the best,
Frankie