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.

About 8051 Microcontroller

Status
Not open for further replies.

AlirezaAAA

Newbie level 6
Joined
Mar 20, 2006
Messages
12
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,368
Hello .
I have a question . I want to send a pulse to a 8051 microcontroller when one of the keyboard arrow keys is pressed and after that the microcontroller moves the stepper motor(or servomotor) to the specified direction . How can I do it? I'll do appreciate you if you give me Assembly/C Source code for performing this operation .

Thanks in advance
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
One optin is to send "code" in a form of ASCII or HEX string through PC serial port to 8051, the micrcontroller will decode the string and drive motor to the required position ..
Other option is to connect a PS/2 keyboard directly to 8051 and take control over motor that way ..

Do you have any preference?

Regards,
IanP
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
;------------------
; Defines
;------------------
;XXXXXXXXXXXXXXXXXXXXXXXX KeyBoard XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
.flag KEYB_DATA, P1.5 ; AT Keyboard data (change this for your hardware)
.flag KEYB_CLOCK, P3.2 ; AT Keyboard Clock (change this for your hardware)
; This 2 pins should be connected to the keyboard crresponded pins with an 4K7 Pullup.
; The keyboard also needs GND and +5V.
This is about the required hardware (0V, +5V, P1.5 and P3.2) ..
If you need you can always change these pins ..

And here is the ASM:
https://www.8052.com/codelib/kb.asm

Regards,
IanP
 

    AlirezaAAA

    Points: 2
    Helpful Answer Positive Rating

AlirezaAAA

Newbie level 6
Joined
Mar 20, 2006
Messages
12
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,368
Do you have any schematic material for this subject?

And how about the second step?How can I move the stepper motor to the specified position after one of the arrow keys is pressed?
 

polarized

Member level 4
Joined
May 13, 2002
Messages
76
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Europe
Activity points
966
Hello,


I would sugest a simple 20pin 8051 based MCU from Atmel like 89C4051, a 12MHz crystall, a reset circuit, a 7805 voltage regulator and transistor drivers over optocouplers or maybe galvanically connected. The best idea would be to design the exact schematic and the parts values by yourself as this will for sure improve your electronics knowledge greatly and will be fun in the process.
 

AlirezaAAA

Newbie level 6
Joined
Mar 20, 2006
Messages
12
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,368
Would you please give me a schematic material for this subject? Or a step-by-step instruction to perform the mentioned operation?

Thanks in advance .
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
Take a look a hardware example on 8051-derivative-to-Keyboard connection ..
Important thing is that the CLOCK signal has to be connected to any interrupt pin (INt0 or INT1) whereas the DATA signal can be connected to any available pin ..
Full description of this example you can find at:
https://www.semiconductors.philips.com/acrobat_download/applicationnotes/AN434.pdf
PS2 pin allocation:
https://www.burtonsys.com/PS2_keyboard_and_mouse_mini-DIN-6_connector_pinouts.html

If you would like to have a look at Keyboard C-code goto:


Regards,
IanP
 

    AlirezaAAA

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top