Hi all,
A few weeks ago I scored a Planar low power 320x256 electroluminescent display (
datasheet) from work. (This is what it looks like :
http://gkdlcd.en.ecplaza.net/sitebuilder/images/md320.256-71e.jpg)
From the datasheet you'll see it has a CLOCK, HSYNC, VSYNC, VID (even pixel column) and TVID (odd pixel column) input.
The HSYNC being a low pulse of 4*Tclock and a high pulse of 320*Tclock.
The VSYNC being a low pulse of at least 70µs and a high pulse of 256*Thsync.
I first started with the idea of having 50fps, but after making a few calculations I just can't do it. I need a clock higher than 4MHz.
So I went for a 10Hz refresh rate, which should give me a Tclock of 1.205µs or 830kHz.
Tvs = 1/10 = 100ms
Tvs = Tvs_low + Tvs_high = 70µs + 256 * Tvs
Ths = (Tvs - 70µs) / 256 = 390.35µs
Tclk = Ths / 324 = 1.205µsI thought using the PIC18F2455 with PLL, which would give me 48MHz, would be enough to generate an 830kHz clock, but I can't get my timer interrupt past
76.92kHz 153.84kHz.
If I set my timer0 register TMR0 to 241, the timer0 interrupt should be called every (256-241)/(48MHz/4) = 1.25µs.
Now that I write this post, I toggle my output every interrupt so my output clock would be 2*((256-241)/(48MHz/4)) = 2.5µs or 400kHz, anyways that's not the point.
The output frequency doesn't go up past TMR0 being higher than 225 and I don't know why. TMR0 set to 220 gives an output frequency of 75kHz, higher than that it's just 76.9kHz.
I read the errata of the PIC18F2455 but there wasn't anything about timer0, and google couldn't help me.
Any ideas why ?
Attached is my source code. I have checked the config words and the PLL should be set correctly. I also checked the timer0 config bits but I'm pretty sure they're set correctly as well.