code for lcd at 32Mhz?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times

code for lcd at 32Mhz?

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: code for lcd at 32Mhz?

Post 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.

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times

Re: code for lcd at 32Mhz?

Post 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
Attachments
1829 32Mhz.fcf
(122.33 KiB) Downloaded 251 times

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times

Re: code for lcd at 32Mhz?

Post 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?
Attachments
32Mhz clock 1938.fcf
(8 KiB) Downloaded 221 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: code for lcd at 32Mhz?

Post 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.
Attachments
32Mhz clock 1938.fcf
(8 KiB) Downloaded 244 times
Martin

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times

Re: code for lcd at 32Mhz?

Post by brandonb »

hey martin, same thing "no el worko"

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: code for lcd at 32Mhz?

Post 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.
Martin

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: code for lcd at 32Mhz?

Post 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.
Martin

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: code for lcd at 32Mhz?

Post 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
Martin

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times

Re: code for lcd at 32Mhz?

Post 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

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: code for lcd at 32Mhz?

Post 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
Attachments
LCD_32MHz.fcf
(23.04 KiB) Downloaded 239 times

Post Reply