LCD

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times

LCD

Post by wayne millard »

Hi Team,

Is there a way to stop writing to a lcd display. i have a 18f4560 running at 40Mhz clock i need a interrupt to run at 1us would be good. im using the interrupt to generate a start and stop pulse. i only write to display when time has finished.

Thanks
wayne

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: LCD

Post by Benj »

Hi Wayne,
Is there a way to stop writing to a lcd display.
Do you mean stop writing while inside a write macro? If so then the interrupt will automatically break out of what is currently happening, preform the interrupt and then continue with the LCD operations.

This is why it is not a good idea to control anything from inside an interrupt. Instead you should set flags in the interrupt and then test the flags in your main program.

A timer 2 interrupt on a PIC is normally the most configurable interrupt to give you a fixed frequency interrupt. 1us is probably too fast.

eg at 40 MHz there would only be 10 instructions between interrupts. This means that if your interrupt is 8 instructions then you have 2 spare instructions every microsecond for your main program. Go over 10 instructions in your interrupt routine and your main program code will never be executed.

Post Reply