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.

DIY Moving Message Display

Status
Not open for further replies.
Re: A zuisti's PIC16 MMD program, now in MikroC too

sir zuisti, i have an available pic but not same as what you are using, what part of the program am i going to change if i use pic16f877a instead of pic16f628a?
thank you sir
 

Re: A zuisti's PIC16 MMD program, now in MikroC too

what part of the program am i going to change if i use pic16f877a instead of pic16f628a?

Probably just the routine HW_Init should be properly transcribed, so study the datasheet.
- Configure ANALOG pins as digital I/O (ANSEL, ANSELH ??)
- Disable comparators (if any, C1ON ??)
- Enable internal pullup for the STOP switch input pin (??)

- set the proper port directions as now
- configure the Timer2 (T2CON, PIE1, INTCON, .... ??)

Sorry but I've never used this PIC, so don't know it enough. Maybe someone else can help you ...
zuisti
 
Re: A zuisti's PIC16 MMD program, now in MikroC too

hello zuisti, i'm planning to use 10 shift registers, i tried to load the code and i noticed that the scrolling is up to the 7th shift registers only,.. what part will i change to allow operation up to 10 shift registers. thanks
 

Re: A zuisti's PIC16 MMD program, now in MikroC too

Hi adelair;
Which version you use? I think (and assume) the Scroll16c-04.c version.
Please attach your whole MikroC project and also the modified DSN file, then I can help you.

But until then:
You wrote planning to use 10 shift registers, so 80 columns (a 10 * 8*8 or 16 * 5*7 led matrix).
One line (row) is now 10 bytes (80 bits) long, so:

1. use a bigger buffer: linebuf[10*7] instead of linebuf[7*7] ... (in case of 5*7 matrices)

2. modify the line "char cnt = 49;" in the routine "clear_linebuf" to "char cnt = 70;" (10*7)

3. modify the line
"buf_fsr = (char)(linebuf + 48); // points the last line's last byte" (7*7 - 1)
to
"buf_fsr = (char)(linebuf + 69); // points the last line's last byte" (10*7 - 1)
in the routine "shift_in_a_column"

4. modify the lines "bytecnt = 7;" to "bytecnt = 10;"
.. (in two places: in the routine "shift_in_a_column" and in the "display")

The so modified program will run slower so you must also modify the timer2 timing (the line "PR2 = 141;" in the "HW_Init". The value 141 must be higher (new time measurements should be made for this in the Proteus).
Without it (in reality) the brightness of the lines will not be the same).

In any case, I strongly suggest that you first try to understand the algorithm (you can use the simplest version of my programs, the -01).

zuisti
 
Re: A zuisti's PIC16 MMD program, now in MikroC too

sir zuisti, this is our DSN file and mikroc file
btw sir, i am using version 01 and (10*8*8) led matrix but the letter patterns are still 5*7
 

Attachments

  • 877acode.zip
    3.2 KB · Views: 227
  • 877a.zip
    21.4 KB · Views: 231
Last edited:

Re: A zuisti's PIC16 MMD program, now in MikroC too

Hi adelair;

Here is the modified, well working Proteus (!!) project.

The 10th matrix was also added, and all was changed to GREEN because the BLUE was horrible (almost invisible, at least to me).
The last line of the 8*8 matrices is turned off because a 7-bytes bitmap table is used.

Hope it helps.
zuisti
 

Attachments

  • 877a_10.zip
    29.5 KB · Views: 298
Re: A zuisti's PIC16 MMD program, now in MikroC too

@adelair:

Meanwhile I found on the net is an 8-bytes/char bitmap table.
It contains 'ugly' characters, you can change/shift to left if necessary. Fortunately easily edit because the binary format.
If you manage to make nicer characters (possible because of the larger place), please let us know.

I once again changed your DSN file (and also the source), it is using the 8th matrix row too.
(otherwise, please re-draw the circuit, because the Proteus does not like these kind of messy wiring, often freeze when editing)

To switch off all rows, other solution must now: I use the pin PORTA.4 to inhibit the ls138 with its pin 4 (output-enable__).

The timer2 setting is also recalculated, the program is slower now (57 Hz refresh rate at 8 Mhz). You can use a higher clock (eg 16 MHz) or an advanced, proper modified version of my programs, eg the -04.

But be careful, already using the 8-MHz clock also causes an increased risk of the RMW problems (as I wrote above).

The modified project is attached.

zuisti
 

Attachments

  • 877a_10_8x8.zip
    29.8 KB · Views: 330
Re: A zuisti's PIC16 MMD program, now in MikroC too

Dear sir Zuisti, thank you so much for the big help you've given us.. My video reply is late so i wasn't able to use the 8x8 pattern you made. :)
 

Attachments

  • MOV03534.zip
    2.5 MB · Views: 290
Re: A zuisti's PIC16 MMD program, now in MikroC too (repaired !)

The error what I found (and repaired): doubled columns at the byte borders:
MMD_error.jpg
Up to now I thought that this is only a Proteus display animation error, but no, the error was caused by my program .

A friend of mine built the circuit (the simplest Scroll16c-01.c version used), then he made a video of the well-functioning system, and sent it to me (thank you). However, can be seen in the above error too, especially when the scrolling stops.

This problem exists in all versions (-01, -02, -03), except for the -04. For a long time I was looking, for a reason, but finally found it : The error was in the "shift_in_a_column" routine, in the simulated "multi-byte shift left with carry" algorithm. See the bytecnt loop: rotate a whole line (7 bytes) left with carry. The repair is simple, just one instruction to be modified.

I did not notice before, because I'm working always only with the fastest (-04) version, and that is correct because it does not simulate the "Rotate Left with Carry" function, but it is using the real asm instruction, the inline "RLF".

Use the corrected program(s) then the shadow, the duplicated column will disappear:
MMD_repaired.jpg

All fixes (for MikroC -01, -02, -03 and Proton Basic -01, -03) attached now.
Later versions (for 16F877a) may also be repaired according to the Scroll16c-01.c

Thanks
zuisti
 

Attachments

  • MMD-Fixes.zip
    13.6 KB · Views: 309
Last edited:

    V

    Points: 2
    Helpful Answer Positive Rating
hi guys could explain me what is the function
in the source code of zuisti 16char_l_u_d,
how it works these macros

E_RD_ch Macro addr 'ch = Eread addr
#if (Prm_1 == Num8)
@ movlw addr
#else
@ movf addr,w
#endif
GoSub _E_RD_ch
Endm

E_WR Macro addr, value 'Ewrite addr, [value]
#if (Prm_1 == Num8)
@ movlw addr
#else
@ movf addr,w
#endif
@ bsf STATUS,5
@ movwf EEADR
#if (Prm_2 == Num8)
@ movlw value
#else
@ bcf STATUS,5
@ movf value,w
#endif
GoSub _E_WR
Endm

thank you very much zuisti
 

... what is the function in the source code of zuisti 16char_l_u_d,

E_RD_ch Macro addr ' ch = Eread addr
.....
GoSub _E_RD_ch
Endm

E_WR Macro addr, value ' Ewrite addr, [value]
....
GoSub _E_WR
Endm

Hi smakol;
The above macros and their GOSUBs (written by me) are simplified (shorter and faster) versions of the corresponding inbuilt Proton functions.
 

hello.
I has experienced to write a program already does something complier in proteus do not work. help look into give me with.
I unknows that.

thank you.
Pued.
 

Attachments

  • aa_1.rar
    25.2 KB · Views: 201
Re: 74138 cascade

How i can add more led's in this schematic please help me.?dotmatrix diossssssss.JPG
 

dear all,
i am working on this project. i am taking help from the codes given in this thread. i ma using atmega 16. my code is given as-

Code:
#include <avr/io.h>
#include <util/delay.h> 
#include <avr/pgmspace.h>                
//# define F_CPU 1000000UL                              

// led display
#define DATAPORT		PORTA
#define shiftclock		0	// LED_RESET pin 11 or serial clock
#define latchclock		1	// LED_CLOCK pin 12 or register clock
#define leddata			3	// LED_DATA	 pin 14
#define SCROLL_DELAY	140  // multiple of 7 (use smaller numbers for faster scroll)


// global variables ***************************    
//unsigned char bitcount,*inpt, *outpt,buffcnt = 0;	    

// led character definitions 
// 5 data columns + 1 space
// for each character
unsigned char led_chars[1][6] PROGMEM = {  
0x00,0x00,0x00,0x00,0x00,0x00,	// space
0x00,0x00,0xfa,0x00,0x00,0x00,	// !	
0x00,0xe0,0x00,0xe0,0x00,0x00,	// "
0x28,0xfe,0x28,0xfe,0x28,0x00,	// #
0x24,0x54,0xfe,0x54,0x48,0x00,  // $
0xc4,0xc8,0x10,0x26,0x46,0x00,  // %
0x6c,0x92,0xaa,0x44,0x0a,0x00,  // &
0x00,0xa0,0xc0,0x00,0x00,0x00,  // '
0x00,0x38,0x44,0x82,0x00,0x00,	// (
0x00,0x82,0x44,0x38,0x00,0x00,  // )
0x28,0x10,0x7c,0x10,0x28,0x00,  // *
0x10,0x10,0x7c,0x10,0x10,0x00,  // +
0x00,0x0a,0x0c,0x00,0x00,0x00,  // ,
0x10,0x10,0x10,0x10,0x10,0x00,  // -
0x00,0x06,0x06,0x00,0x00,0x00,  // .
0x04,0x08,0x10,0x20,0x40,0x00,  // /  
0x7c,0x8a,0x92,0xa2,0x7c,0x00,  // 0
0x00,0x42,0xfe,0x02,0x00,0x00,  // 1
0x42,0x86,0x8a,0x92,0x62,0x00,  // 2
0x84,0x82,0xa2,0xd2,0x8c,0x00,	// 3
0x18,0x28,0x48,0xfe,0x08,0x00,	// 4
0xe5,0xa2,0xa2,0xa2,0x9c,0x00,	// 5
0x3c,0x52,0x92,0x92,0x0c,0x00,	// 6
0x80,0x8e,0x90,0xa0,0xc0,0x00,	// 7
0x6c,0x92,0x92,0x92,0x6c,0x00,	// 8
0x60,0x92,0x92,0x94,0x78,0x00,	// 9  
0x00,0x6c,0x6c,0x00,0x00,0x00,	// :
0x00,0x6a,0x6c,0x00,0x00,0x00,	// ;
0x10,0x28,0x44,0x82,0x00,0x00,	// <
0x28,0x28,0x28,0x28,0x28,0x00,	// =
0x00,0x82,0x44,0x28,0x10,0x00,	// >
0x40,0x80,0x8a,0x90,0x60,0x00,	// ?
0x4c,0x92,0x9e,0x82,0x7c,0x00,	// @
0x7e,0x88,0x88,0x88,0x7e,0x00,	// A
0xfe,0x92,0x92,0x92,0x6c,0x00,	// B
0x7c,0x82,0x82,0x82,0x44,0x00,	// C
0xfe,0x82,0x82,0x44,0x38,0x00,	// D
0xfe,0x92,0x92,0x92,0x82,0x00,	// E
0xfe,0x90,0x90,0x90,0x80,0x00,	// F
0x7c,0x82,0x92,0x92,0x5e,0x00,	// G
0xfe,0x10,0x10,0x10,0xfe,0x00,	// H
0x00,0x82,0xfe,0x82,0x00,0x00,	// I
0x04,0x02,0x82,0xfc,0x80,0x00,	// J
0xfe,0x10,0x28,0x44,0x82,0x00,	// K
0xfe,0x02,0x02,0x02,0x02,0x00,	// L
0xfe,0x40,0x30,0x40,0xfe,0x00,	// M
0xfe,0x20,0x10,0x08,0xfe,0x00,	// N
0x7c,0x82,0x82,0x82,0x7c,0x00,	// O
0xfe,0x90,0x90,0x90,0x60,0x00,	// P
0x7c,0x82,0x8a,0x84,0x7a,0x00,	// Q
0xfe,0x90,0x98,0x94,0x62,0x00,	// R
0x62,0x92,0x92,0x92,0x8c,0x00,	// S
0x80,0x80,0xfe,0x80,0x80,0x00,	// T
0xfc,0x02,0x02,0x02,0xfc,0x00,	// U
0xf8,0x04,0x02,0x04,0xf8,0x00,	// V
0xfc,0x02,0x1c,0x02,0xfc,0x00,	// W
0xc6,0x28,0x10,0x28,0xc6,0x00,	// X
0xe0,0x10,0x0e,0x10,0xe0,0x00,	// Y
0x86,0x8b,0x92,0xa2,0xc2,0x00,	// Z
0x00,0xfe,0x82,0x82,0x00,0x00,	// [
0x00,0x00,0x00,0x00,0x00,0x00,     // *** do not remove this empty char ***
0x00,0x82,0x82,0xfe,0x00,0x00,	// ]
0x20,0x40,0x80,0x40,0x20,0x00,	// ^
0x02,0x02,0x02,0x02,0x02,0x00,	// _
0x00,0x80,0x40,0x20,0x00,0x00,	// `
0x04,0x2a,0x2a,0x2a,0x1e,0x00,	// a
0xfe,0x12,0x22,0x22,0x1c,0x00,	// b
0x1c,0x22,0x22,0x22,0x04,0x00,	// c
0x1c,0x22,0x22,0x12,0xfe,0x00,	// d
0x1c,0x2a,0x2a,0x2a,0x18,0x00,	// e
0x10,0x7e,0x90,0x80,0x40,0x00,	// f
0x30,0x4a,0x4a,0x4a,0x7c,0x00,	// g
0xfe,0x10,0x20,0x20,0x1e,0x00,	// h
0x00,0x22,0xbe,0x02,0x00,0x00,	// i
0x04,0x02,0x22,0xbc,0x00,0x00,	// j
0xfe,0x08,0x14,0x22,0x00,0x00,	// k
0x00,0x82,0xfe,0x02,0x00,0x00,	// l
0x3e,0x20,0x18,0x20,0x1e,0x00,	// m
0x3e,0x10,0x20,0x20,0x1e,0x00,	// n
0x1c,0x22,0x22,0x22,0x1c,0x00,	// o
0x3e,0x28,0x28,0x28,0x10,0x00,	// p
0x10,0x28,0x28,0x18,0x3e,0x00,	// q
0x3e,0x10,0x20,0x20,0x10,0x00,	// r
0x12,0x2a,0x2a,0x2a,0x04,0x00,	// s
0x20,0xfc,0x22,0x02,0x04,0x00,	// t
0x3c,0x02,0x02,0x04,0x3e,0x00,	// u
0x38,0x04,0x02,0x04,0x38,0x00,	// v
0x3c,0x02,0x0c,0x02,0x3c,0x00,	// w
0x22,0x14,0x08,0x14,0x22,0x00,	// x
0x30,0x0a,0x0a,0x0a,0x3c,0x00,	// y
0x22,0x26,0x2a,0x32,0x22,0x00, 	// z
0x00,0x10,0x6c,0x82,0x00,0x00,	// { 
0x00,0x00,0xfe,0x00,0x00,0x00,	// |
0x00,0x82,0x6c,0x10,0x00,0x00 };	// }



//***********************************************
void main() 
{                                               	
	unsigned int i,j;
   	unsigned char ch,row,temp;
 //	unsigned char PROGMEM *dataPtr, *tmpDataPtr;
	unsigned char *dataptr, *tmpdataptr;
	unsigned char messagelength, currentchar, charoffset, tmpcurrentchar, 
					tmpcharoffset, ledarray[16];	
	unsigned char  message[] PROGMEM = {"    ramayana    "};  // 300 chars + 4 spaces at start and end of message                   
	
	DDRA = 0xff;
	DDRD = 0xff;

	                                                 
	// initialise LED display (shift registers)	
	DATAPORT &= ~(1<<shiftclock);	//shiftclock=0
 	DATAPORT &= ~(1<<latchclock);	//latchclock=0
	DATAPORT &= (1<<shiftclock); 	//shiftclock=1                 
	                  
	    
   	      
   			charoffset = 0;
    		currentchar = 0;
    		dataptr = &led_chars[message[0] - 0x20][0];    
    		
		// this loop is the heart of the scroll
		// message is scrolled until a key is hit on the keyboard		

    		while (1) 
			{     
    			// load led array   	
    			tmpdataptr = dataptr;
    			tmpcharoffset = charoffset;
    			tmpcurrentchar = currentchar;
    			for (i = 0; i <= 15; i++) 
				{  
    				ledarray[i] = *tmpdataptr++;  		    	   		    		
    	 			if (++tmpcharoffset==0x06) 
					{  
    	  				tmpcharoffset = 0;    	  		    	  		
    					if (++tmpcurrentchar == messagelength)
    	 					tmpcurrentchar = 0; 
    	  				tmpdataptr = &led_chars[message[tmpcurrentchar]-0x20][0];
    				}      		
    			}

	
    			if (++charoffset == 0x06) 
				{     
    				charoffset = 0;         		
    				if (++currentchar == messagelength)
    					currentchar = 0;	
    			}      
    			dataptr = &led_chars[message[currentchar]-0x20][charoffset];
    	    	
    			// display led array
    			row = 0x02;        
    			for (j = 0;j <= SCROLL_DELAY; j++) 
				{  
	   				for (i = 0; i <= 15; i++) 
					{
						temp = (ledarray[i] & row) ? 1 : 0;
    					DATAPORT &= (temp<<leddata);

    					DATAPORT |= (1<<latchclock);
 						DATAPORT &= ~(1<<latchclock);                  
	
					}                 
    				PORTD= row;  
 					row <<= 1;      // next line to be switched on         
 					if (!row) 	// if last line go back to the first line	
 						row = 0x02; 	  	 	  
 	  				_delay_us(800);
 	    			PORTD = 0x00; 	    
 	   			}
    		}
			    
    
    
        	       
}


but i am not getting the message at o/p display. display is just glowing fully.
please help me by finding out the problem in my code
thanks to all

- - - Updated - - -

please make it correct & clear my doubt, as i m working on it from a long time but i don't get the satisfactory o/p.
 

Re: microcontroller based moving message display

I had this circuit diagram but which used PIC...can any1 here help me to give code in 8051??
Just replace the 8051 instead of this PIC..even i had also a code of it which is compile in Micro C Compiler

The complete project along with proteous file is atttached here with.
 

Attachments

  • MikroC.rar
    89.6 KB · Views: 229

Re: microcontroller based moving message display

Hi hardik.patel;
The attached project is mine (surprised):
https://www.edaboard.com/posts/1125963/#post1125963

Otherwise, do not use this (due to a minor bug), here's the corrected version too:
https://www.edaboard.com/posts/1148762/#post1148762

I know they are using a PIC, but the pure C versions (-01, -02) may be used with other processors, 'only' the specific locations should be changed; for example the port definitions and their using, the init statements, STATUS (carry) handling ... I do not use (do not know) the 8051 family, sorry.
zuisti
 

Re: microcontroller based moving message display

Hi Zuisti sir,

Yes the attached project is your.

But now new confusion is that i wish to do this project for my own region language "Gujrati" (one of the Indian language)..

So for that can anyone here help me that how to create data for individual character of my region language??

Here i had attached a sample of Gujrati language alphabets..or you can also search regarding "Gujrati" language.
 

Attachments

  • Gujarati alphabets.JPG
    Gujarati alphabets.JPG
    75 KB · Views: 116

MMD for "Gujrati" language

Hi hardik.patel;

Well, it's not a simple problem. Much work is needed (1-2 weeks), and also the language should be known a bit. Because the characters are quite complex, definitely use a larger LED matrix to display them, like in this project:
https://www.edaboard.com/threads/11364/#post1125213
I've written this before, then in Proton Basic language (not in C). Sorry but the source does not publish but the circuit may be useful also for this task.

Here are some tips:
- search the net for a Windows Unicode font for your language. For example I found this:
https://gujarati.indiatyping.com/index.php/download-gujarati-font
- download and install the font (eg the akshar.ttf) on your PC (using Windows XP or newer)
- use the known BitfontCreator program to extract (export) the individual character bitmaps
- modify the font pictures (bitmaps) as you want
- create your text ... and your PIC (or other) program ...

Good luck!
zuisti
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top