ÄOT-MÇžTRIX Display Programming
I am using 8KHz of frequency for clock and 1KHz of data to pin 1 as shown in the figure attached in the post#6
My program is in the post#6 which I am using to generate the clock and data pulses.
Thank you all.
My program is in the post#6 which I am using to generate the clock and data pulses.Shayaan_Mustafa
What you have posted is a picture of your code.
To use it I would have to retype it myself.
Post your code as a file, or as text I can cut and paste.
Here is my code as a text
org 0 mov p2, #0ffh mov tmod, #12h mov th0, #-57 setb tr0 setb p1.0 l_ow: mov th1, #0ffh mov tl1, #0a4h setb tr1 wait: jnb tf0, next clr tf0 cpl p1.1 ;8KHz, p1.1 next: jnb tf1, wait clr tr1 clr tf1 cpl p1.0 ;1KHz, p1.0 jnb p1.0, l_ow jb p1.0, h_igh h_igh: mov th1, #0fch mov tl1, #0c2h setb tr1 sjmp wait end
It is ok sir?
And have you downloaded my proteus project file?
If so then I am waiting for your conclusion.
Thank you very much.
This runs the simulation in slow motion.
Try going faster 5000,20000, 50000,see what happens.
You will see that the most of the LEDs are on most of the time
It is easier to see letters formed when most LEDs ,the background, are off.
You seem to have a scanning action, now you need to display a character.
I think using the 74HCT164 is confusing you and making things harder.
If you can,remove the 74HCT164 and drive the LEDs from the 8 pins of port 1.
[ Edited Thu Apr 17 2014, 06:19 am ]
Start by changing the speed of the 89C51 in Proteus from 12mHz to 1000Hz.
This runs the simulation in slow motion.
Try going faster 5000,20000, 50000,see what happens.
You will see that the most of the LEDs are on most of the time
It is easier to see letters formed when most LEDs ,the background, are off.
You seem to have a scanning action, now you need to display a character.
I tried your approach, It worked. Fortunately and by the grace of GOD my code is working fine.
I think using the 74HCT164 is confusing you and making things harder.
If you can,remove the 74HCT164 and drive the LEDs from the 8 pins of port 1.
Yes, 74HCT164 is confusing me. You guessed very true. But I must use it. My teacher said that by doing it software is very much easy means by using the rotate instruction. He further said, if you have guts then try to achieve your goal with shift register. You know sir, I connected my dot matrix directly from the AT89C51 ports' pins but my teacher ordered me to do it using shift register.
Now my problem again:
I changed AT89C51's frequency to 1000Hz or 5000Hz then I see what is going on is all right. But how to do it if I do it on my board? Means soon I will implement it on the circuit board, And I can't change the internal clock of the AT89C51 like I did in the proteus. So I will have to change my code. Can you tell me what changes should I make or what frequency should I use to see transitions? I hope you will be getting my point.
Thank you very much sir.
Yes, 74HCT164 is confusing me. You guessed very true. But I must use it. My teacher said that by doing it software is very much easy means by using the rotate instruction. He further said, if you have guts then try to achieve your goal with shift register. You know sir, I connected my dot matrix directly from the AT89C51 ports' pins but my teacher ordered me to do it using shift register.Shayaan_Mustafa
I think your teacher is wrong to make you use the 74HCT164 before getting experience
displaying patterns, but we're stuck with it
First think about what you really need to do.
The 74HCT164 has to light up one row at a time, at the same time you use Port2
to light up the LEDs to make a pattern.
At high speed the rows "blur" together to form an image.
Look at the code I have attached for an idea of how to light one row at a time.
Don't worry about adjusting the speed for now, just try to understand how
it works.
When you understand test.asm try the second test_plus.asm.
It demonstrates how to display a "+" pattern.
A simulation in Proteus does not work like the real thing, but it should be okay.
Because of the way the LED matrix works you need to remove the ULN2803
and connect P2 directly to the matrix
[ Edited Fri Apr 18 2014, 04:20 am ]
By the way, if I removed ULN2803 then how would 8051 sink the current drawn from the matrix, huh??
And also, a line simulation is not showing on the 12MHz internal frequency of the 8051 but "+" is shown at this frequency.
I have already displayed some characters and simulations to my teacher but main problem still remains i.e. simulation is too fast that human eye can't detect it. I need to slow down my simulation. obviously I need to create large delays in my program or I should use 800Hz of clock cycle instead of 8KHz at p1.1 and 100Hz of data pulses instead of 1KHz at p1.0
I must submit my project by the coming Monday. That's why I don't have much time sir. Whatever I did is my own working and designing. But when I got stuck then I moved to www.8051projects.net for help.
Thank you very much sir.
Iif I removed ULN2803 then how would 8051 sink the current drawn from the matrix, huh??Shayaan_Mustafa
The LED matrix in Proteus does not fully imitate a real matrix.
The model does not need to sink current.
And also, a line simulation is not showing on the 12MHz internal frequency of the 8051 but "+" is shown at this frequency.
I have already displayed some characters and simulations to my teacher but main problem still remains i.e. simulation is too fast that human eye can't detect it. I need to slow down my simulation.Shayaan_Mustafa
I don't know what you are actually looking for here.
You are not supposed to see the scan line at full speed.
If you want a demonstration just replace
"wait: jnb tf0,wait ;wait for timer to expire"
with a call to a long delay
I don't know what you are actually looking for here.
You are not supposed to see the scan line at full speed.
I have attached a file i.e. what I want to see but I am not seeing.
If you want a demonstration just replace
"wait: jnb tf0,wait ;wait for timer to expire"
with a call to a long delay
Whattt???? Should I replace wait: jnb tf0, wait with a delay subroutine? Is it allowed? I mean what would happen if I don't clear the flag after it sets? Is this valid not to use wait: jnb tf0, wait? OK I try as you say. I try then update you sir. But kindly see my video file I have attached. It explains what I want.
Thank you.
https://drive.google.com/file/d/0Bz7wzonLqZeBTGsxV2RkSUNnZnc/edit?usp=sharing
[ Edited Sat Apr 19 2014, 02:12 am ]