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.

:!: What should be the code(AVR) for decoding ASCII to row-column character bitmap?

Status
Not open for further replies.

arupbsk

Member level 1
Joined
Dec 14, 2010
Messages
33
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Gopalganj
Activity points
1,554
My design consists of a ATmega32 running at 16.00Mhz.
The input is an EEPROM where some ascii(8 bit) characters is stored simultaneously one after one.
The output will be a large LED display.
I have chosen to use 21 IO pins as output and 2 IO pins as inputs.
Now my design has PC0 and PC1 selected for SCL and SDA for the 24Cxx eeprom from where the character should be read.

In the output there is large 128x20 led matrix.
There is 13x cascaded 4017 decade counters in series to select the 128 columns(D1351 transistor as driver).
By this I'd have control on 128 columns with single IO pin of the AVR. The 20 rows will be fed directly by the Atmega with 20 IO pins and there will be ULN2003 driver used.

Now when I have control over 128x20 led matrix, I'll be displaying 8 characters in each 16x20 space.
Hence 64Bits of the EEPROM is to be read and the 8 characters retrieved from that is to be driven to the output pins.

These are my h/w design. Now I need a code which will decode the ASCII to row and column bitmap.
So, I hope somebody who knows embedded C very well, will help me.
 

Now I need a code which will decode the ASCII to row and column bitmap.

Hi,

There are a good few free programs on the web that will take characters and create bitmap images for them to the pixel size you want.

However, doubt you could readily decode the ascii to the large bit map in the mega32 program, though might be corrected there.

The solution would be to decode your acscii characters into a bitmap then store the bitmaps into the eeprom, or even the main program memory if there is enough room, so you can then call the bit mapped character out and display it direct.

The other thing you might want to check, if not done already, is the time it takes to run down all 128 columns at 16meg.
Will it be fast enough to produce a readable display on the LEDS ?

Don't do C so cannot help with the detailed code, but it should be easier as you do not have to do the ascii conversion now.
For a tightly looped program like you are doing, you might find doing a flowchart a great help to ensure your logic is correct before attempting any detailed coding.

edit
Just to show you how small the ''bitmaps" can be - here is the data 0 - 9 ready to display onto a glcd as 5x7 characters
Code:
	db	0x00,0x3E,0x51,0x49,0x45,0x3E,0x00,0x00 ;48/ --> 0
	db	0x00,0x00,0x42,0x7F,0x40,0x00,0x00,0x00 ; 1
	db	0x00,0x42,0x61,0x51,0x49,0x46,0x00,0x00 ; 2
	db	0x00,0x21,0x41,0x45,0x4B,0x31,0x00,0x00 ; 3
	db	0x00,0x18,0x14,0x12,0x7F,0x10,0x00,0x00 ; 4
	db	0x00,0x00,0x27,0x45,0x45,0x45,0x39,0x00 ; 5
	db	0x00,0x3C,0x4A,0x49,0x49,0x30,0x00,0x00 ; 6
	db	0x00,0x01,0x71,0x09,0x05,0x03,0x00,0x00 ; 7
	db	0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x00 ; 8
	db	0x00,0x06,0x49,0x49,0x29,0x1E,0x00,0x00 ;9
 
Last edited:

If I need to convert to bitmap first and then put the characters in EEPROM no problem then. Because my setup has 128x20=2560 leds aka pixels. So then I need 2560 bits. A G.P 24c04 has 4K memory, so no problem.

To avoid flickering of 128 columns, I have to make the switching faster.
So I've planned to read the 2.56kb or 320Bytes of bits in Atmega's 2KB SRAM in the initial steps. Then there will be a 2d matrix say data[128][8].
And the display function will be as follows
*****main, etc*********
uint8 i;
for(i=0; i<128; i++)
{
***** codes to transfer data[0] to data[7] to selected output lines.******(still have to work on this code)
PORTD=0b00000001;
PORTD=0b0000000; /// these are to send CP to the column selection circuitry at PD0.
}
********* this for loop is in the while(1)
Hence 128 loops consume 128x(20+2(column drive)+1(for condn check)+1(incrtement i))= 3072 instructions
With 16Mhz crystal the Atmega is ready for 16Minstructions per second. So I think there is no flickering.
Initially I've also thought to embed few preset bitmaps in the huge 32K memory.
There are plenty of pins free and there I'd attach switches to select which one to display then the program will goto the display loop with the matrix.
 

I have used the following software to do the job:

WinHex - Download

It has build in tools for C (copy - paste bitmap as C variable).

If your fonts are not ready yet, then google search for "font creator", you will find plenty of results.

Good luck!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top