cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
supins
Visitor
Visitor
6,351 Views
Registered: ‎05-15-2014

How to display variables in Spartan 3E LCD Screen?

I am new to FPGA and VHDL.

 

I just learned how to display characters in my spartan 3E fpga kit. I specified the characters to be displayed in .psm file

 

Is it possible  to display variables from my programs similarly ? I am using an ultrasonic sensor, and I want to display the speed in the LCD screen. I am using VHDL language.

 

Please help

0 Kudos
5 Replies
supins
Visitor
Visitor
6,344 Views
Registered: ‎05-15-2014

i am diaplaying a character 'H' using the below mentioned codein the psm file

 

LOAD s5, 55 ;H

      CALL LCD_write_data

 

 

Suppose I want to display a variable 'x' in the LCD screen, what should I do?

 

can I directly give my variable in place of '55' in the above code? If yes where should I declare my variable.?

 

regards,

Supin

0 Kudos
nikoiv
Visitor
Visitor
6,319 Views
Registered: ‎09-04-2009

Hi Supin,

After speed is calculated convert it to ASCII string.

Then use your CALL LCD_write_data!

Good luck

73!

 

0 Kudos
supins
Visitor
Visitor
6,315 Views
Registered: ‎05-15-2014

HI,

 

 Thankyou for the reply.!

 

I still can't figure out how to pass the variable value from my program to the psm file. Whenever I give a variable name in the psm file, its showing error. It seems only constant values can be given in the psm file.

 

Regards,

Supin

0 Kudos
nikoiv
Visitor
Visitor
6,301 Views
Registered: ‎09-04-2009

Hi Supin,

It is not necessary to pass data to your *.psm program. You must to teach your program to read variable data. Then after every read operation (input sX, (source address)). Your variable data will be in the program. Convert it to ASCII and send it to the LCD...

73!

0 Kudos
chapman
Xilinx Employee
Xilinx Employee
6,284 Views
Registered: ‎09-05-2007

Take a look at the following reference design on the Spartan-3E Starter Kit...

 

http://www.xilinx.com/products/boards/s3estarter/reference_designs.htm

 

PicoBlaze Processor Frequency Counter
Converts the Spartan-3E FPGA Starter Kit into a reasonably accurate frequency counter measuring frequencies up to 200MHz as well as providing two different types of on-chip oscillator for test and evaluation.

 

 

In this design, PicoBlaze reads the value of a counter (i.e. a variable) and converts it to a set of ASCII characters which it displays on the LCD so that us poor humans can understand the value. This should provide you all the reference pieces of PSM code that you need to get started.

 

 

 

 

Ken Chapman
Principal Engineer, Xilinx UK
0 Kudos