Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Plotting in VGA : help required

Status
Not open for further replies.

aguntuk

Member level 1
Joined
May 3, 2009
Messages
32
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,505
Dear experts,
I am having problem of plotting integer signed data say temperature in VGA display. I have VGA controller where there is a RAM which stores data from the sensor of temp. Inside the controller I manipulated x and y axis and send it to VGA where it displays the axis. Now my problem is when I get the data (signed) form the RAM and tries to plot any specific data or the RAM data to VGA I need buffer. how can I create the buffer inside the controller so that it send the data to VGA and there is also another VGA entity which is for display how can it scans the negative and positive parts of the axis along y. I have no issue with creating axis which I made though pixels.

I am using Altera DE0 board.

Your help will be highly appreciated.
 

Without something that shows exactly what you currently have implemented architecturally, text descriptions are typically inadequate for this, I can only make some general suggestions.

how can I create the buffer inside the controller so that it send the data to VGA
add a dual port RAM to the design and buffer it assuming there is enough RAMs in the FPGA of the DE0, otherwise you'll have to resort to external DRAM or whatever is available on the DE0.

and there is also another VGA entity which is for display how can it scans the negative and positive parts of the axis along y. I have no issue with creating axis which I made though pixels.
You could just scale and/or offset the positive and negative values. If the range of values is such that they don't exceed half scale you could just add half scale to the values to offset the 0,0 point to the center of the VGA. If they aren't then you should probably scale first then apply the offset to center 0,0.
 
Hey ads-ee,
thanks a lot for your reply. I designed the dual-port RAM already but can't figure out how to buffer it in the FPGA of DE0. Can you be a more specific?
 

Hey ads-ee,
thanks a lot for your reply. I designed the dual-port RAM already but can't figure out how to buffer it in the FPGA of DE0. Can you be a more specific?

Oh the irony.

The RAM acts as a buffer - you store data in it until you need it.
 
Hey ads-ee,
thanks a lot for your reply. I designed the dual-port RAM already but can't figure out how to buffer it in the FPGA of DE0. Can you be a more specific?

Should have been modified to read as this...
add a dual port RAM to the design (change and ===> to) buffer it assuming there is enough RAMs in the FPGA of the DE0, otherwise you'll have to resort to external DRAM or whatever is available on the DE0.

As Tricky already mentioned the RAM is the buffer.
 
Thanks to both of you. Sorry for the silly question...

- - - Updated - - -

You could just scale and/or offset the positive and negative values. If the range of values is such that they don't exceed half scale you could just add half scale to the values to offset the 0,0 point to the center of the VGA. If they aren't then you should probably scale first then apply the offset to center 0,0.

Now about scaling/offset I have no idea how to do that actually. based on pixels i drew 2 axes - one is along y and the x axis cut in the middle of y axis. My VGA entity should send the x,y data (through scanning or whatever and I called it "dynamic" box where the plot will be done. outside of the axis in the left and down I called it "static") to the VGA controller where the RAM is. and after getting information about the x,y the controller should send the data to VGA entity with r,g,b info and the VGA will display or plot the data on the right place.

I am stuck now how can i send the x,y data to the controller? I didn't get the scaling/offset as I have no I idea how to implement that here.
 

The VGA controller will be sending RGB values to the monitor constantly - otherwise the monitor wont sync. The timing depends on the standard (you can look up the timing values)

Then you can simply track the current position of the output and if it's where you want to draw the axes, then you output the axes RGB, otherwise output whatever the video should be.
The other option is to buffer the video into ram, overwrite the appropriate pixels for the axes, then play the ram out of the VGA.

Either way requires you track the current position somewhere...
 

scaling/offset was only a suggestion as I don't really know how you have your display set up to show these + and - coordinate values.

The display data itself is just an array of memory locations laid out in row order from the top to bottom of the screen. You need to come up with an algorithm to translate an (x,y) data coordinate to a memory location based on the used display area.

In regards to what is done for the scaling/offset...
Suppose you have a 256x256 display area and you use a simple x,y data that is 1:1 with the pixels then if your x,y locations are limited to 1/2 the width and height of the screen pixels then you can just add 128 to the x and y coordinates to center the 0,0 position in the center of your 256x256 display (I'm sort of assuming that the values are stored in a 2's complement fashion so the range is -128 to +127). If those same x,y coordinates are -256 to +255 then you'll have to resort to scaling the data first (as the x,y can index into a 512x512 area) by dividing by 2 first to scale the x,y coordinate first, then shift the center. If you only have one axis that has negative values then you don't have to shift those coordinates.

Unfortunately I'm probably not explaining this well for you.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top