RS232 Simulation?
Tue Jan 15 2008, 11:51 pm
dez please show me what you have done till now.. I will add things which are needed..!
Wed Jan 16 2008, 12:17 am
;delay function delay macro duration local waitf mov cx,duration loop waitf end m ; cursor function cursor macro r,c mov bh,00 mov ah,02 mov dh,r mov dl,c int 10h endm ; display function display macro str mov ah,09h mov dx,offset str int 21h endm .stack 64 .data ;Seven Segment Table zero db 3fh; - | - - | | |- |- -| |-| |-| one db 6; | | | _| _| - |- |_ -| - - two db 5bh; - | |_ _| | _| |_| | |_| _| three db 4fh four db 66h five db 6dh six db 7dh seven db 7 eight db 7fh nine db 6fh speedCtr db ? l1 db ' Welcome ','$' l2 db ' Press f to rotate clockwise ','$' l3 db ' Press r to rotate counter-clockwise ','$' l4 db ' You may adjust the speed by 'u' for up and 'd'for down ','$' l5 db ' You can see the motor speed on the 7-seg ','$' l6 db ' Press q to quit the program ','$' .code mov dx,378h ;parallel port initialization mov al,00h ;for writing data out dx,al ; D7 is for forward D6 is for backward D5 is for enabling of dc motor with L293d main: mov ax,@data mov ds,ax clr cursor 2,6 display l1 cursor 4,6 display l2 cursor 6,6 display l3 cursor 8,6 display l4 cursor 10,6 display l5 cursor 12,6 display l6 cursor 16,6 mov [speedCtr],0 key_check: mov ah,07 int 21h cmp al,'r' je r_pressed cmp al,'f' je f_pressed cmp al,'u' je up_pressed cmp al,'d' je down_pressed cmp al,'q' je quit jmp key_check r_pressed: delay 2; wait for 2 seconds and then start rotating in reverse direction mov al,01000000b; 01100000B for reverse direction mov dx,378h out dx,al jmp key_check f_pressed: delay 2; Wait for 2 minutes and then start rotation forward direction mov al,10000000b; 10000000B for forward direction mov dx,378h out dx,al jmp key_check down_pressed: add [speedCtr],-1 jmp key_check up_pressed: add [speedCtr],1 jmp key_check quit: mov ah,4ch int 21h end main
Wed Jan 16 2008, 12:21 am
first i need to define a speedcontrol macro that will increase or decrease the speed when user push 'u' or 'd'.
secondly i need a 7seg function that will send the speed to 7segment which is stored in speedCtr
and thats all.
Wed Jan 16 2008, 12:50 am
yes
i m trying to write just a program in dos to control the peripherals. There is no microcontroller
i m trying to write just a program in dos to control the peripherals. There is no microcontroller
Wed Jan 16 2008, 03:26 am
i cant believe there are many step motor examples around the net
but there is no bloody dc motor by pwm example.
but there is no bloody dc motor by pwm example.
Wed Jan 16 2008, 10:18 pm
i can help you with 8051... if you can translate that..then will be possible i guess..
Powered by e107 Forum System