Discussion in "8051 Discussion Forum" started by    Shayaan_Mustafa    Apr 12, 2014.
Wed Apr 16 2014, 04:00 pm
#11
My teacher said, you are using high frequency that's why our eye can't detect the line going through the matrix. He further said that human eye can't detect frames if they exceed 29frames/second. So reduce the frequency. Can any expert it to me?

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.
Thu Apr 17 2014, 02:13 am
#12


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.
 Shayaan_Mustafa like this.
Thu Apr 17 2014, 02:18 am
#13
Sorry sir,

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.
Thu Apr 17 2014, 02:41 am
#14
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 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 ]
 Shayaan_Mustafa like this.
Thu Apr 17 2014, 01:42 pm
#15

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.
Fri Apr 18 2014, 04:17 am
#16


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

Attachment


[ Edited Fri Apr 18 2014, 04:20 am ]
 Shayaan_Mustafa like this.
Fri Apr 18 2014, 06:56 am
#17
I tried your simulations. And obviously both are of the my level programming. I understand how both works and how did you use look up table to generate the plus sign.
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.
Fri Apr 18 2014, 11:28 pm
#18


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
 Shayaan_Mustafa like this.
Sat Apr 19 2014, 01:45 am
#19

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.
Sat Apr 19 2014, 01:52 am
#20
Here it is.

https://drive.google.com/file/d/0Bz7wzonLqZeBTGsxV2RkSUNnZnc/edit?usp=sharing


[ Edited Sat Apr 19 2014, 02:12 am ]

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am