Page 1 of 1
code for lcd at 32Mhz?
Posted: Sun Mar 25, 2012 6:06 am
by brandonb
Code: Select all
#ifdef _BOOSTC
#define %a_DELAY delay_10us(10)
#endif
#ifdef _C2C_
#define %a_DELAY delay_us(100)
#endif
#ifdef HI_TECH_C
#define %a_DELAY __delay_us(120)
#endif
#ifndef %a_DELAY
#define %a_DELAY delay_us(100)
#endif
what do i change the above numbers to for 32Mhz lcd operation, i played with it but failed
Re: code for lcd at 32Mhz?
Posted: Mon Mar 26, 2012 10:47 am
by Benj
Hello,
If the project clock setting and the chip configuration is correct then the display should work with the code as is.
Have you done a 1 second LED flasher test on the hardware to check you have everything setup correctly in Flowcode?
To do this create an endless loop which outputs 1 to a LED, waits a second, outputs 0 to the LED and waits another second. If the delays on the hardware are equal to 1 second then you have everything setup correctly.
Re: code for lcd at 32Mhz?
Posted: Mon Mar 26, 2012 5:39 pm
by brandonb
i tried this two different ways, 8Mhz (osccon=70 with ppl enabled, and 32Mhz (osccon=fo) with ppl disabled, all i get is a blank lcd....didnt have time to do 1m/s test as im on lunch break but i think it will be fine, my attachement is below, could you take a peek
Re: code for lcd at 32Mhz?
Posted: Wed Apr 18, 2012 5:24 am
by brandonb
ben, i finally got around to checking this and something is broke, c command and all is fine but the lcd doesnt work at 32Mhz, shows blank, i do have the 1m/s on/off pulse as veiwed with pico scope, what do you think?
Re: code for lcd at 32Mhz?
Posted: Wed Apr 18, 2012 7:33 am
by medelec35
Hi brandon,
Sorry in a rush, but try this.
There may not be any difference.
If it does work, will explain a bit later.
Martin.
Re: code for lcd at 32Mhz?
Posted: Thu Apr 19, 2012 12:05 am
by brandonb
hey martin, same thing "no el worko"
Re: code for lcd at 32Mhz?
Posted: Thu Apr 19, 2012 7:31 am
by medelec35
Hi Brandon.
I remember posting something after Ben suggested a solution about LCD not working at higher frequencies here:
http://www.matrixmultimedia.com/mmforum ... 29&t=10258
there is also this:
http://www.matrixmultimedia.com/mmforum ... 82&#p28382
I was unable to help further as the chip I was using at internal osc of 32MHz ran LCD ok
Just as a temp thing does this work:
http://www.matrixmultimedia.com/mmforum ... =26&t=7973
Later I will try a 16F1827 with internal osc at 32MHz& see if LCD works with it or not.
Re: code for lcd at 32Mhz?
Posted: Thu Apr 19, 2012 6:29 pm
by medelec35
Have you tried at lower speed, e. internal osc 8MHz?
I'm only asking since your RS and enable pins have been swapped.
Are you using your own LCD? If you was using Eblock EB005 with jumper on default settings, then it won't work until you swap RS and enable connections on your flowchart.
Re: code for lcd at 32Mhz?
Posted: Thu Apr 19, 2012 9:17 pm
by medelec35
I have set up 16F1827 and running int osc at 32MHz.
I can see the issue now.
when running int at 8 MHz: there is a pulse that's on for 319us then off for 7us back on for 319us. LCD is working.
When running at 32MHz the pulse os on for about 319us but this time instead of being off for 7us, it goes off for 0.136us on for 0.136us back off for 0.136us then on for the 319us. LCD is not working.
I will have a play with the delays as see if I can get anywhere. If not you may need to wait for matrix to work out what the issue is.
Martin
Re: code for lcd at 32Mhz?
Posted: Fri Apr 20, 2012 2:47 am
by brandonb
thanks martin for checking that out and working on it for me, was starting to think i was crazy, i've tried it with multiple displays but never payed attention to scope details as i didnt know what to expect, the reason why i switched the r/s and enable pins is because i designed a new pcb proto board for some friends on an automotive network i frequent (autonerdz)
http://dl.dropbox.com/u/10367218/ordere ... 0layer.jpg by switching those pins it makes the traces look pretty
Re: code for lcd at 32Mhz?
Posted: Wed Jul 18, 2012 7:54 pm
by Jan Lichtenbelt
I tried to use a LCD at 32 MHz. Also without succes.
I made a trail and error program in which the delay time in RAWSEND and in START, CLEAR procedures is varied. The oscillator frequencies used are 8,16 and 32 MHz.
In RAWSEND the delay time is varied from 10 to 200 usec. In START and CLEAR from 1 to 4 msec.
The result is that at 8 and 16 MHz, nearly always the LCD is working correctly. With 32 MHZ the LCD is not working correctly.
I hope someone can help to find a solution!
Kind regards
Jan Lichtenbelt