LED moving message diaply using PIC16f628 CD4017 and 74LS595
Introduction of MMD Project-2:-
The PIC microcontroller PIC16f628 is used the main processor in the MMD. The difference from the previous moving message diaply and this is method for scaning the rows. In previous MMD a decoder 74LS138 was used to scan the rows. But in this project, i have used CD4017 for row scanning instead of use of any decoder.
Components of the LED moving message display:-
LED matrix = 8x8 LED matrix 8 Nos,
MCU = PIC16f628
Shift registers = 74LS595 8Nos
crystal = 4MHz with 22 pF capacitors.
and other basic components like reset switches and regulated power suplly of 5V which have enough current baring for this project like 1Amp max.
The circuit diagram of the 8 x 8 x 8 LED matrix moving message display using PIC microcontroller is as under:-
Code of the Moving message diaply is written in proton basic compiler and is as under:-
Device=16F628A
XTAL=4
ALL_DIGITAL=true
Output PORTB
Symbol SER = PORTB.0 ' Serial data Pin
Symbol SRCLK = PORTB.1 ' Serial data Clock Pin
Symbol SRClr = PORTB.2 ' Serial data Clear
Symbol Latch = PORTB.3 ' Columns, Latch
Symbol RowClk = PORTB.4 ' Row clock, to select new row
Symbol Rowrst = PORTB.5 ' Row reset, selects row 0
High SRClr ' Turn off the serial register clear
Dim serial_buffer[128] As Byte
STR serial_buffer = "www.PICinf.blogspot.com" , 0
Dim i As Byte
Dim n As Byte
Dim b As Byte
Dim c As Byte
dim m as byte
dim l as byte
dim ch_index as byte
dim start_ch_idx as byte
dim end_ch_idx as byte
for b =0 to 128
if serial_buffer[b]>0 then serial_buffer[b] =serial_buffer[b]-32
next b
' setup for positive pulses:
lATCH = 0 : SRCLK = 0 : SER = 0
c = 0
start_ch_idx =0
end_ch_idx = 30
Loop:
PulsOut Rowrst,2 ' give a pulse on row reset pin, to select row 0
For i=0 To 6
ch_index = start_ch_idx
for n = 0 to 10
GoSub GetPatternAndOut
inc ch_index
if ch_index = end_ch_idx then ch_index =0
next n
PulsOut Latch,4
DelayUS 250
PulsOut RowClk,2
for n = 0 to 7
SHOut SER,SRCLK,lsbfirst,[0]
next n
PulsOut Latch,4
Next i
inc l
if l = 10 then
l = 0
Inc start_ch_idx
If start_ch_idx = end_ch_idx Then start_ch_idx = 0
endif
GoTo Loop
End
GetPatternAndOut:
m = LRead LABEL+((serial_buffer[ch_index]) * 8) +i
m = ~m
' out a clock pulse and restore data pin to 0
'out the low 5 bits of pattern
SRCLK = 1 : SRCLK = 0: SER = 0
If m.4 = 1 Then SER = 1
SRCLK = 1 : SRCLK = 0: SER = 0
If m.3 = 1 Then SER = 1
SRCLK = 1 : SRCLK = 0: SER = 0
If m.2 = 1 Then SER = 1
SRCLK = 1 : SRCLK = 0: SER = 0
If m.1 = 1 Then SER = 1
SRCLK = 1 : SRCLK = 0: SER = 0
If m.0 = 1 Then SER = 1
SRCLK = 1 : SRCLK = 0: SER = 0
Return
LABEL:
LDATA $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 'Space
LDATA $FB,$FB,$FB,$FB,$FB,$FF,$FB,$FF '!
LDATA $F5,$F5,$F5,$FF,$FF,$FF,$FF,$FF '"
LDATA $F5,$F5,$E0,$F5,$E0,$F5,$F5,$FF '#
LDATA $FB,$F0,$EB,$F1,$FA,$E1,$FB,$FF '$
LDATA $E3,$EA,$E5,$FB,$F4,$EA,$F8,$FF '%
LDATA $F7,$EB,$EB,$F7,$EA,$ED,$F2,$FF '&
LDATA $F9,$F9,$FD,$FB,$FF,$FF,$FF,$FF ''
LDATA $FD,$FB,$F7,$F7,$F7,$FB,$FD,$FF '(
LDATA $F7,$FB,$FD,$FD,$FD,$FB,$F7,$FF ')
LDATA $FB,$EA,$F1,$FB,$F1,$EA,$FB,$FF '*
LDATA $FF,$FB,$FB,$E0,$FB,$FB,$FF,$FF '+
LDATA $FF,$FF,$FF,$F3,$F3,$FB,$F7,$FF ',
LDATA $FF,$FF,$FF,$F1,$FF,$FF,$FF,$FF '-
LDATA $FF,$FF,$FF,$FF,$FF,$F3,$F3,$FF '.
LDATA $FF,$FE,$FD,$FB,$F7,$EF,$FF,$FF '/
LDATA $F1,$EE,$EC,$EA,$E6,$EE,$F1,$FF '0
LD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
Dear sir
am martins from Nigeria i did electrical electronic enginerring in schol just graduated last year i com across your website in the net and saw some of your circuit diagram wish i have been lookin for over months it was greate the circuite diagram that am talking about is moving message display(mmd) with three Ic 16f628A+cd4017+74ls595, please i want you to send me the soft ware of programming 16f628A and also more explenation about this mmd programming and construction thanks i wil luv to hear from u
@ martins (For Moving Message Display MMD using PIC):-
The circuit diagram and code written in proton basic compiler for PIC microcontroller 16f628 based Moving message display is given in above post.
You can copy the code and then convert it to HEX file, which is actually burned into microcontroller using programmer.
The circuit diagram is also provided.
If still you have any problem in the development of the moving message project, then feel free to ask.
Thanks sir for guid line for dis project.i have a problem on the code, you said i should copy your code and pest in hex file, where will i start copying is it at Device=16f628A or at Return Label? and also i want to change the disply in your code been www.picinf.blogspot.com to martins home of technology how can i do it. Thanks am waitting to hear from you
@ martins (For Moving Message Display MMD using PIC) :-
What kind of probelms you are facing in the development of moving message display using PIC microcontroller??
I think, the project is very simple and clear, every thing is available on the post. The circuit diagram, the code written in proton basic and explanation is given there. Then why you are in trouble, i donot know WHY?/
1. you said i should copy your code and pest in hex file,
I never say like that. ok, you get it wrong. I said , you should copy the code, paste in your code file for basic language then compile it using proton basic compiler. The proton basic compiler will generate a hex file from the basic code file. This hex file will be then required to burn (write) into microcontroller PIC16f628.
2. where will i start copying is it at Device=16f628A or at Return Label?
You should copy all the code and this is matter of common sense, you should know from where the code is starting and where it is ending. If still you donot know about the start of code and end of code then i am trying it to make simple as:-
The start of code
Device=16F628A
The end of the code is
LDATA $F5,$EA,$F5,$EA,$F5,$EA,$F5H 'DEL
3. YOu want to change the display message like you want to display "martins home of technology " instead of "www.picinf.blogspot.com". Then simple, replace the text (STR serial_buffer = "www.PICinf.blogspot.com" , 0
)in code with what you want to display and then complie and make new hex file and then burn it into microcontroller.
Sir Rana, is abut the (MMD) display, what if i want the display of the message to be barkslash or flying or caton display how can i do that.
@ Martins Nwafor :-
This is moving message display based on pIC Microcontroller. You can display only TEXT on this MMD. The text will be scrolling from right to left as it is shown in video of MMD also.
But you can NOT show any flying cartons, or images here using this code of moving message display because for that function you have to write some special program which can handle that functionality.
Thanks so much, u have try for me mey God bless u and give u more wissdom Amen, friend can you send me soft ware of proton basic compiler in my email dress at nwaformartins@yahoo.com, for me to down load in my pc for the programming i have sarch for it al.
I understand all u have explen so far thank this is my first time in coding microcontroller
@ Martins Nwafor :-
I always feel happy to help others if i could.
It is good that you understand about the functionality of moving message display.
Now if you are asking about the proton basic compiler then sorry i can not send you, you can download it from internet.
can u put more comments on the code?? it's quite hard to understand.. tnx.. hope for your response...
Good day sir,
postive and negetive of the chips were not shown in the MMD circuit diagram why? I want to know thanks
@ Martins Nwafor :-
The circuit diagram for moving message display shown above is designed using proteus ISIS. and you are right in this circuit the positive and negitive power supply lines for chips (ICs) is shown. It is because in proteus we can not show it, all power supply lines are hidden by default. These VCC and ground are connected automatically to power lines.
But in real life when we try to build the circuit diagram on board using actual components, we should do it by ourself.
So, i suggest, plz check the datasheets of microcontroller and other ICs and connect the power supply where required.
In your MMD project's introduction you mentioned a reset switch but in the circuit diagram it is not there, i need the circuit diagram having the reset switch, i am just starting the project.
Martins Nwafor (RESET SWITCH Connection ):-
The reset switch is connected to the reset PIN of microcontroller. This reset switch helps the programmer to restart the microcontroller without power downing the actual circuit.
If you want to use it (becasue use of reset switch is optional)then check the datasheet of PIC microcontroller used in moving message display and there you will find some interesting information about reset switch and its relvent issues.
Sir, how many alphabet can this micro chip contain, can it contain up to 50 letters i mean the display of MMD.
@ Martins Nwafor (length text of moving message display):-
Currently the software of the moving message display is written to handle the string containing 128 characters. You can increase the message text even beyond this length, but for that you have to chnage the program and i think, it is not difficult to change such parameters. First try and if you feel problem, you can discuss it.
I think you will have to adjust following lines in the code, written at different stages.
1.Dim serial_buffer[128] As Byte this is initalize of array of 128 characters, so you should change it accordingly.
2.
STR serial_buffer "www.PICinf.blogspot.com" , 0
here you have to put the actual text you want to display.
3. end_ch_idx = 30
this is endding number of characters counts,currently you can display only 30, thus you have to change this also.
i think this will solve your problem.
I understand what just explain, but for reset switch i need to be more clear,this reset switch is it a different circuit that will be design and connect to the microconcotroll, or is it build in side the microcontrol thanks for ur co-operation so far God bless
@ Martins Nwafor (problem with reset circuit for microcontroller):-
The reset circuit consisting of a push button and a resistor of 10Kohm connected in series are external componenets which are connected to reset PIn of microcontroller.
Thats why i asked you to read the datasheet of the PIC microcontroller PIC16f819. see the reset circuits given there and then implement them if required.
the reset buttons are OPTIONAL CIRCCUITS and if not used then there is no difference for program runing for microcontroller functioning.
ok
can we use cristal having higher frequency like 8 or 12MHz,so that the scan procidure can create more good display
The 8x8 dot matrix shoul be common cathod or common anod
@ Anonymous (Crystal values for MMD):-
Yes, we can use the higher values of crystal for This project, But the results of moving message displaywill be changed. YOu will be required to adjust the delays used in the program according to the crystal values.
@ Anonymous ( common anode or common cathode):-
Normally the LED matrix are not defined in such a way.
Sir,i have problem programming with Amicus18 proton basic compil, with the MMD code, i copy the code of MMD and pest on compil file and click on compil botting and save the code, and and open the save file an click on the cod,and it open and i click on compil after compil it wrot at the bottom (erro:unrecognised Amicus18 revision. Rev1 or Rev2 or18f25k20 or1825k22 texts only) and i tested it with soft ware sample an it work it wrot at the boottom copilation succes for target device 18f25k20(64MHZ) PLES I NEED UR HEAP AM WAITIN FOR U REPLY
Martins Nwafor (PIC Microcontroller and proton basic):-
There are many variations in your setup like the PIC microcontroller i used is PIC16f628 but i think you are using some other number.
I used crystal of 4Mhz but you are using 64MHz.
Then i donot know about Amicus 18 ptoton compiler.
I simple used a proton basic compiler with no defination of ONLY 18F PIC microcontrollers.
YOu can send me you project files for review , i will check those on my compiler, does those works or not.
Sir, i didnt change any thing in your (MMD) CODE, i just down loaded Amicus proton basic compiler in the net, new vasion of proton basic compiler .so i now copy your cod an pest on compli file and after compiling it wil say eror, pleas type free proton basic compiler in google sarch an you wil se were i down loaded the soft ware of Amicus18 and mplab new vasion of proton basic compil, i dnt change any componet am stil working with your circuit diagram look at the comment the person that meantion abut crystal is another deffenet person not me
Martins Nwafor (Compiler problem for MMD):-
I am using PROTON BASIC Compiler from crownhill.
Below is their website
http://www.protonbasic.co.uk/
Then i search for you on Internet and found a forum from where you can find links of proton compiler for download free , some complete cracked versions were also available.
http://www.sonsivri.com/forum/index.php?topic=25430.0
Instead of instructing me for the downloading of your compiler version, why not you send me the URL from where you get it.
Welcome!
I would like to ask whether it would be nice instead of the 74LS595 to a 74HC595?
Another question: 6 8x8's display does it work?
Answer Thank you.
(I did google translator, I hope to read)
Hello Dr.Rana! I understood everything in this project beside one thing.. I dont know how to implement a message i want into 24lc512/256.
Thank You for answer.
Post a Comment
Hi: This is PICINF.blogspot.com comments section. Here you are requested to write your question or problems in detail. Write the question in such a way that, it have all necessary information, sothat i can understand and reply.If you want to send pictures and codes then e-mail me (rghkk@hotmail.com).Thanks.