As an example, lets suppose that we should do a SVGA output @ 60Hz frame rate (LCD likes 60 Hz).
SVGA Signal 800 x 600 @ 60 Hz timing
General timing
Screen refresh rate 60 Hz
Vertical refresh 37.878787878788 kHz
Pixel freq. 40.0 MHz
Horizontal timing (line)
Polarity of horizontal sync pulse is positive.
Scanline part | Pixels | Time [µs]
Visible area 800 20
Front porch 40 1
Sync pulse 128 3.2
Back porch 88 2.2
Whole line 1056 26.4
Vertical timing (frame)
Polarity of vertical sync pulse is positive.
Frame part | Lines | Time [ms]
Visible area 600 15.84
Front porch 1 0.0264
Sync pulse 4 0.1056
Back porch 23 0.6072
Whole frame 628 16.5792
So in this example I would like to output a new port value every 25ns during the line, and this whithout the use of extra clocks.
40 Mhz is not one of the available multiples of the RefClock.
Is the only way to change the PLL setting in the XCORE so it runs at 80 MHz?
I guess I have 2 alt:
I) Use buffered ports with 8 or 16 bit, so I have time for the for loop.
Code: Select all
unsigned LineBuffer["2 or 4 or 6 or 8"][800]
#pragma unsafe arrays
for (int x=0 ;x<800 ; x++){
#pragma loop unroll
for (int k=0 ;k<4 ; k++){
p<: LineBuffer[yPage][x];
x++;
}
}
II) Use several 32bit buffered 1-bit ports and use asm("setpt .... ") to sync all the timing of all ports.
That would mean that I have 800 ns between all the needed updates.
Anyone with some tips for me !?
(Made a http://en.wikipedia.org/wiki/Mesh_analysis to study the error in a non-ideal R-2R ladder in MATLAB yesterday)