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.

A beginner in 8051 needs pro advice! AT89S51

Status
Not open for further replies.

-joe-

Newbie level 3
Newbie level 3
Joined
Aug 30, 2005
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,353
a warm greeting to all of you all,

i am just learning micro controller and i face some assembly programming question for my assignment.

I am using AT89S51 with 2 X ULN2803 to generate alphabet A to Z on a 8X8 LED dot matrix display. My problem now is the are 3 buttons :

forward to display next char ---> PORT1.0
backward to display previous char ---> PORT1.1
auto disply all char sequently ---> PORT1.2

I am very confused how to write an assembly code for these 3 buttons.:cry:
i managed to generate a program and hex codes for all the alphabet , but i can't write out a proper code for the buttons... please help!!

your kindness will be highly appreciated.
 

Attachments

  • assignment_178.pdf
    175.9 KB · Views: 154

Try somthing like this (assuming button pressed = 0V, button released = 5V):

Button_Loop:
MOV A, P1
JNB ACC.0, NextButton
JNB ACC.1, BackButton
JNB ACC.2, AutoButton
JB AutoBut, AutoButton
MOV B, #10h
DJNZ B, $
SJMP Button_Loop

NextButton: ; display next character
CLR AutoBut
code .....
LJMP Button_Loop

BackButton: ; display previous character
CLR AutoBut
code .....
LJMP Button_Loop

AutoButton: ; auto display
SETB AutoBut
code .....
SJMP Button_Loop

Regards,
IanP
 

    -joe-

    Points: 2
    Helpful Answer Positive Rating
hey thankyou very much for the help

i really appreciate it!!
 

89C51 you have 2 external interrupt INT0 and INT1 but you can expand more 2 external interrupt using 2 timer. Set Timer to Counter Mode to count the even. when a pulse come from P3.4 or P3.5, the count resgister is increase. If the counter is 8bit, set TH0=ff, when a pulse comes, the Counter is overflow and an interrupt is trigged--
Connect your button to interrupt pins and write interrupt subroutines code, it is easier
 

I want to do a similar project can you please show me your circuit diagram?
 

ya, I know. I got the circuit.

Can any one explain why pull ups were used in uln2803?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top