0

I tried to display ASCII on the LCD, I am using a DE2-70 board and Handel-C using the Altera DE2 function library. This is the code I am compiling:

set clock = external "N2"; 
#include "DE2.hch"

void main(void) {

DE2_LCD_LINE line;

line = hex2ascii(0x1<-4) @ sp @ H @ e @ l @ l @ o @ sp @ w @ o @ r @ l @ d @ blank_line<-152;

DE2LCDDriver(line);
 }

I followed all the steps on the documentation and always get this error:

undefined width for all used variables sp@ H@e .....etc
vermaete
  • 1,330
  • 1
  • 17
  • 28
  • Why the VHDL and Verilog tags? –  Nov 30 '14 at 00:50
  • @David Koontz because I am using DE2-70 that can also programmed using vhdl or verilog. Hopefully someone would help –  Nov 30 '14 at 01:26
  • unspecified width appears to mean a missing width attribute. Looking in de2.hch it says `extern macro expr sp;`, etc. Looking in de2.hcc shows `extern macro expr sp = 0x20<-8;` etc. with the width. DE2 Library Manual, Using the support library, Installing the Library, Setting up DK - 4. Add the DE2 library (Select Project>Settings, under the Linker tab add de2.hcl to the Object/library modules, path: de2lib\de2.hcl) –  Nov 30 '14 at 03:11
  • @David Koontz I followed all these steps, and still getting the same error. It is very annoying error. Do you have any clues? –  Nov 30 '14 at 08:53

1 Answers1

1

I found the answer, this library is no more supported in the new DK5 the best way to use it is to convert to hex then display it as following:

/* Convert to HEX*/
y =5;
Unsigned 8 decode_to_hex(unsigned 4 x) 
{
}

/*Then display using */

Line = (decode_to_hex(y)<-8) @0;
DE2LCDDriver(Line);
Greg
  • 18,111
  • 5
  • 46
  • 68