The HDSP2111 is a very nice LED display, the can show 8 alphanumeric characters in a 5 x 7 dot matrix, and are all packaged in a standard 15.24 mm (0.6 inch) 28 pin DIP. The onboard CMOS IC has 128 ASCII characters which are permanently stored in ROM.

 The HDSP2111 devices are 8-digit, 5 x 7 dot matrix, alphanumeric displays and are all packaged in a standard 15.24 mm (0.6 inch) 28 pin DIP.The onboard CMOS IC has the ability to decode 128 ASCII characters which are permanently stored in ROM.

In addition, 16 programmable symbols may be stored in on-board ROM, allowing displaying user made symbols and icons. Seven brightness levels can adjust the display intensity and power consumption.The HDSP2111 is designed for standard microcontroller interface techniques, we use the ATMEGA328. The display and special features are accessed through a bidirectional 8-bit data bus. The display has a data bus of 8 bits and a address bus of 5 bits.The address inputs A0 - A2 select a specific location in the character RAM, the flash RAM or the UDC RAM. A3 and Aare used to select which section of the memory is accessed. 


When the display is used in the write only mode, the WRITE (WR) and CHIP ENANBLE (CE) lines can be tight together.

The circuit is build on a breadboard and connected to the ATMEGA328 board. You can purchase the ATMEGA328 board at www.bizztronix.eu


Design Code

This code shows a text on the display and then all the buld-in characters. The display is easy to control. The address is put on the address bus and the characters on the databus. Then a write signal clocks the data into the display.

The program code is build with the WINAVR C-compiler.

// project : atm328 - led display HDSP2111
// Version : 1.0
// Website : www,avrprojects.net
// Date Created : 26.04.2014
// Target : ATmega328P microcontroller
// Language : C WINAVR
// Hardware requirements: LED display HDSP2111, ATMEGA328 board
// Description : interfacing ATmega328 to an HDSP2111 LED display

// INCLUDES
#include <avr/io.h>
#include <stdlib.h>
#include <util/delay.h>

// used pins on port B
#define LCD_DB4 0 // PORTD.0 pin 2 -> LCD DATA4 pin 11
#define LCD_DB5 1 // PORTD.1 pin 3 -> LCD DATA5 pin 12
#define LCD_DB6 2 // PORTD.2 pin 4 -> LCD DATA6 pin 13
#define LCD_DB7 3 // PORTD.3 pin 5 -> LCD DATA7 pin 14
#define CE 3 // PB3 pin 12 -> Chip Enable


// pulse to clock the data in the display
void pulse (void)
{
_delay_us(100);
PORTB |= 1<<CE;
_delay_us(100);
PORTB |= 0<<CE;
_delay_us(100);
}

// init LCD
void LED_init(void)
{
DDRD = 0xFF; // PORTD as output
PORTD = 0x00;
DDRB = 0xFF; // PORTB as output
PORTB = 0xFF;
}

//wriet a charecter to the display
void writechar(char address, char input)
{
PORTB = address;
PORTD = input;
pulse();
}

// write text to the display
void writetxt(char *word)
{
for (char i=0;i<8;i++)
{
writechar(i, *word++);
}
}

int main(void)
{
char i = 0;
char j = 0;
LED_init();

writetxt("HDSP2111");
_delay_ms(2000);
writetxt("AMega328");
_delay_ms(2000);

while(1)
{
for (i=0;i<128;i++)
{
writechar(j,i);
_delay_ms(250);
j++;
if (j > 7)
j=0;
}
}

}

 VIDEO

an HDSP2111 led display text from avrprojects.net on Vimeo.


Display Scrolling text

In this project we make a scrolling text with the HDSP2111 display.

You can enter text of any length which will be shown on the display.

The program code is build with the WINAVR C-compiler.

 

// project : atm328 - led display HDSP2111 scrolling text
// Version : 1.0
// Website : www,avrprojects.net
// Date Created : 28.04.2014
// Target : ATmega328P microcontroller
// Language : C WINAVR
// Hardware requirements: LED display HDSP2111, ATMEGA328 board
// Description : iscrolling text on an HDSP2111 LED display

// INCLUDES
#include <avr/io.h>
#include <stdlib.h>
#include <util/delay.h>

// used pins on port B
#define LCD_DB4 0 // PORTD.0 pin 2 -> LCD DATA4 pin 11
#define LCD_DB5 1 // PORTD.1 pin 3 -> LCD DATA5 pin 12
#define LCD_DB6 2 // PORTD.2 pin 4 -> LCD DATA6 pin 13
#define LCD_DB7 3 // PORTD.3 pin 5 -> LCD DATA7 pin 14
#define CE 3 // PB3 pin 12 -> Chip Enable


// pulse to clock the data in the display
void pulse (void)
{
_delay_us(100);
PORTB |= 1<<CE;
_delay_us(100);
PORTB |= 0<<CE;
_delay_us(100);
}

// init LCD
void LED_init(void)
{
DDRD = 0xFF; // PORTD as output
PORTD = 0x00;
DDRB = 0xFF; // PORTB as output
PORTB = 0xFF;
}

//write a character to the display
void writechar(char address, char input)
{
PORTB = address;
PORTD = input;
pulse();
}

// write a text to the display
void writetxt(char *word)
{
for (char i=0;i<8;i++)
{
writechar(i, *word++);
}
}

void scrollDisplay(char *words)
{
char buffer[9];
int i = 0;
while(words[i] != 0)
{ char blank = 0;
for (int j = 0; j<8; j++)
{
if (!blank && words[i+j]== 0)
blank = 1;
if (blank == 1)
buffer[j] = ' ';
else
buffer[j] = words[i+j];
}
writetxt(buffer);
_delay_ms(200);
i++;
}
}


int main(void)
{
LED_init();

while(1)
{
{
char intro[] = " HDSP2111 LED Display - www.avrprojects.net ";
scrollDisplay(intro);
_delay_ms(500);
}
}
}

 

VIDEO

HDSP2111 led display scrolling text from avrprojects.net on Vimeo.


Display Temperature

In this project we display the temperature on the display. We use the LM335 temperature sensor to read the temperature. The sensor gives the temperature in degrees Kelvin. The output of the sensor is via a resistor connected to the ADC0 input of the ATMEGA328 microcontroller. The analog signal is converted to a digital number, then this number is converted to the temperature in degrees Celcius. Below you find the schematic and the C-code.

 // project : atm328 - led display HDSP2111 - LM335

// Version : 1.0
// Website : www,avrprojects.net
// Date Created : 07.05.2014
// Target : ATmega328P microcontroller
// Language : C WINAVR
// Hardware requirements: LED display HDSP2111, ATMEGA328 board
// Description : read the temperature of the LM335

// INCLUDES
#include <avr/io.h>
#include <stdlib.h>
#include <util/delay.h>
#include <string.h>

// used pins on port B
#define LCD_DB4 0 // PORTD.0 pin 2 -> LCD DATA4 pin 11
#define LCD_DB5 1 // PORTD.1 pin 3 -> LCD DATA5 pin 12
#define LCD_DB6 2 // PORTD.2 pin 4 -> LCD DATA6 pin 13
#define LCD_DB7 3 // PORTD.3 pin 5 -> LCD DATA7 pin 14
#define CE 3 // PB3 pin 12 -> Chip Enable


// pulse to clock the data in the display
void pulse (void)
{
_delay_us(100);
PORTB |= 1<<CE;
_delay_us(100);
PORTB |= 0<<CE;
_delay_us(100);
}

// init LCD
void LED_init(void)
{
DDRD = 0xFF; // PORTD as output
PORTD = 0x00;
DDRB = 0xFF; // PORTB as output
PORTB = 0xFF;
}

//wriet a charecter to the display
void writechar(char address, char input)
{
PORTB = address;
PORTD = input;
pulse();
}

// write text to the display
void writetxt(char *word)
{
char blank = 0;
for (char i=0;i<8;i++)
{
if (!blank && *word == 0)
writechar(i, ' ');
else
writechar(i, *word++);
}
}

// this function read the value of ADC channel 0 (PORTC0)
unsigned int read_adc(void)
{
ADCSRA |= 1<<ADSC; //start conversion;
while (ADCSRA&(1<<ADSC)); //wait conversion end
{
return ADCW;
}
}

int main(void)

{
//adc init
ADMUX = 0b00000000; // set ADC0
ADCSRA = 0b10000110; //set ADEN, precale by 64
LED_init();
char stra[2];
char strb[8];
char mystr[2];

while(1)
{
writetxt(" ");
int rawdata = read_adc();
float millivolt = (rawdata/1024.0)*5000;
float celcius = (millivolt/10)-273;
itoa(celcius,mystr,10);
strcpy(strb,""); // initialize strb!
strcpy(stra, mystr);
strcat(strb, "+");
strcat(strb, stra); // add stra to strb
strcat(strb, "C"); // add stra to strb
writetxt(strb);
_delay_ms(1000);
}

}