Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Algorithm for LEDs Moving Sign

Status
Not open for further replies.

boonreans

Junior Member level 3
Joined
Jun 24, 2001
Messages
28
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
114
I want an algorithm for scan bitmap file for signbord please help!!

Thank! 8O
 

ZeRoN

Advanced Member level 4
Joined
Jun 28, 2001
Messages
104
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
1,184
1. Use raster scanning method, see application circuit of NC6B595 shift register.
http://www.ett.co.th/product/07004.html
You will able to display binary data by shift to column register, then enable row driver. This scanning process must fast 30Hz (use timer interrupt to scan)

2. Convert bitmap file to raw binary, then you can show it by put to display buffer.
 

boonreans

Junior Member level 3
Joined
Jun 24, 2001
Messages
28
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
114
Thank you ZeRon!!

Do yo have how convert bitmap format in C language code..
 

ZeRoN

Advanced Member level 4
Joined
Jun 28, 2001
Messages
104
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
1,184
I wrote converter by my self.
I can guide you How to convert the B&W .BMP format
to binary.
 

sedatatmaca

Junior Member level 1
Joined
Sep 13, 2002
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
43
I don't know how to use timer with scanning prosses
Can you help me?
 

ZeRoN

Advanced Member level 4
Joined
Jun 28, 2001
Messages
104
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
1,184
see interrupt relate doc in "ebook upload/download" for interrupt details.

-write code to config timer int. for 30Hz (~30mS.)
-write interrupt service routine to ...
- turn off ROW driver.
- increase ROW. (0-N, then overflow to 0)
- shift COL data at Nth bit of buffer to COL shift register.
- turn on ROW driver.

the LED dot matrix will scan row by row
automatically.
 

sedatatmaca

Junior Member level 1
Joined
Sep 13, 2002
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
43
I made it witout timer interrupt, by scaning manual....
Can you give me c code with timer interrupt...

I couldn't do it with interrupt..
I will be happy if you help me..
 

ZeRoN

Advanced Member level 4
Joined
Jun 28, 2001
Messages
104
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
1,184
There're some different in C code written The interrupt service routine for each Compiler.
Here is C code for KE*IL C-Compiler (MCS-51 family).
Just an example :!:

//#define CHIP_89C51RD2

#include <stdio.h>
#include <intrins.h>
#ifdef CHIP_89C51RD2
#include "reg51rd2.h"
#else
#include "reg51.h"
#endif

#define XTALFREQ 11059200
#define TIMERINTERVAL 0.030 /* Timer Interval 30mS. for 30Hz*/
#ifdef CHIP_89C51RD2
#define FCYCLE (XTALFREQ/6)
#else
#define FCYCLE (XTALFREQ/12)
#endif
#define TCONST (65536-((UINT)(TIMERINTERVAL*FCYCLE)))
#define HiTCONST (UCHAR)(TCONST/256)
#define LoTCONST (UCHAR)(TCONST%256)

#define TIMER0STOP (TR0=0)
#define TIMER0RUN (TR0=1)

#define ENABLE_INT (EA=1) /* enable interrupts */
#define DISABLE_INT (EA=0) /* disable interrupts */

// Timer0 Interrupt Service Routine
void timer0int_isr(void) interrupt 1 using 1 //USE REGISTERS BANK 1
{
TIMER0STOP;
TH0=HiTCONST;
TL0=LoTCONST;
TIMER0RUN;
// Do scan one row here
//...
//...
}


void timer0_init(void)
{
TH0=HiTCONST;
TL0=LoTCONST;
TMOD=(TMOD&0xF0)|0x01; /* 16 bits Timer */
ET0=1; /* Timer 0 Interrupt enabled */
TIMER0RUN; /* Timer 0 Started */
}

void main(void)
{
#ifdef CHIP_89C51RD2
AUXR=0x01;//Internal ERAM enabled, Reduce EMI (ALE off)
#endif
timer0_init();
ENABLE_INT;
//Do foreground process.
//...
//...
}
 

sedatatmaca

Junior Member level 1
Joined
Sep 13, 2002
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
43
I did My LED display with 74164(eight bit shift register) which doesn't contain strobe pin......
I did it
Because of it ..
Can I use timer interrupt?
 

HO2a

Junior Member level 2
Joined
Jun 5, 2003
Messages
23
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
155
Thank You ZeRoN for your code,
my Dot matrix had been worked with loop but when i test your c code the screen start tremble you know why ??
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top