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.

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
 

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
 

;------------------
; 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:
**broken link removed**

Regards,
IanP
 

    AlirezaAAA

    Points: 2
    Helpful Answer Positive Rating
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?
 

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.
 

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 .
 

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:
**broken link removed**
PS2 pin allocation:
http://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

Back
Top