Page 1 of 1

Changing VRAM size and location

Posted: Tue Mar 16, 2010 6:01 am
by ianscriven

I'm trying to get my custom at91sam9263 board to run an 800x600 display. I've changed the registry settings to what I think should be the correct values, however when WinCE starts up I get a lot of errors of the form:

Code: Select all

Exception 'Data Abort' (4) Thread-Id=01f...
I'm guessing it's got something to do with the way I've set up the video RAM. Is there something else I need to do as well as changing the address in the registry? I've attached my lcdc.reg file:

Code: Select all


; Video driver settings
	"Width"=dword:320              ; Screen width in pixel
	"Height"=dword:258             ; Screen heigth in pixel
	"Bpp"=dword:10                 ; Bit per pixel
	"VRAMWidthInPixel"=dword:1000   ; Frame buffer width in pixel (must be at least screen width value and also must match the 2DGE settings. keeping it aligned on 4 bytes allows not to care about the later)
	"VRAMHeightInPixel"=dword:400 ; Frame buffer heigth in pixel (must be at least screen height and more than twice for directdraw)
	"VRAMaddress"=dword:23800000 	; Frame buffer location. Here allocate the video memory in SDRAM
	"VRAMBusWidth"=dword:20			; SDRAM has a 32-bits bus width
;	"VRAMaddress"=dword:300000		; allocate the video memory in SRAM
;	"VRAMBusWidth"=dword:20			; SRAM has a 32-bits bus width
;	"VRAMaddress"=dword:70000000	; allocate the video memory in external PSRAM
;	"VRAMBusWidth"=dword:10			; external PSRAM has a 16-bits bus width
;	"forceRGB"=dword:1           ; uncomment this line if you want to use DirectDraw, 
                                ; be careful, the color will be shifted
	"UpperMargin"=dword:19          ; Value for Vertical Back Porch
	"LowerMargin"=dword:1          ; Value for Vertical Front Porch
	"LeftMargin"=dword:58           ; Value for Horizontal Back Porch
	"RightMargin"=dword:28         ; Value for Horizontal Front Porch
	"Vsync"=dword:3                ; Value for Vertical Synchronization pulse width
	"Hsync"=dword:80                ; Value for Horizontal synchronization pulse width
	"PixelClock"=dword:2625A00      ; The pixel clock wanted



Re: Changing VRAM size and location

Posted: Tue Mar 16, 2010 9:38 am
by ianscriven
I've got past this - changed both VRAM width and height to 0x400 to keep the address the same as before (based on the AT91SAM9263-EK).

I'm having problems with the pixel clock - it should be 40MHz, but I'm measuring it as 30MHz, and it's not going rail to rail, it seems to have a very slow slew rate. Is there slew rate control on this pin?

Re: Changing VRAM size and location

Posted: Wed Mar 17, 2010 5:03 am
by ianscriven
Ok, I've solved some of my problems, and I'll list them here in case it helps others:

- The pixel clock slew rate problem wasn't a problem, it was the my CRO probes, i guess they had too much capacitance at 1x. The clock looks fine with a 10x probe.
- The pixel clock frequency wasn't correct because my master clock wasn't an even multiple of it. I'm now running a 50MHz pixel clock from a 100MHz master clock.
- My display is working at 800x600x16bpp after I figured out how to enable VSYNC - the pin needs to be configured properly in the LCDC driver.

I'd still like to know how to increase the size of the frame buffer so I can try 24bit colour.

Re: Changing VRAM size and location

Posted: Mon Apr 12, 2010 8:56 am
You can increase the size of VRAM by increasing values of "VRAMWidthInPixel" and "VRAMHieightInPixel", also modify the value of "VRAMaddress" accordingly.

Besides, you also need to edit Config.bib file and make sure the setting of segement "VIDEOMEM" is the same as what you set in registry.

Re: Changing VRAM size and location

Posted: Tue Apr 13, 2010 8:03 am
by ianscriven
Yeah, I wasn't changing Config.bib, so the memory organisation didn't match the numbers in lcdc.reg