Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 23rd March 2004, 08:28 PM   (permalink)
Default Programming

I am trying to write a program using the 68hc11 microcontroller to run a stepper motor clockwise or counter clockwise and full or half step. I am STUMPED :cry: It has been several years since I had this type programming. I know that it is very simple but I don't know where I am wrong. I am using PORT A
PA5 is either clock wise or counter clock wise
PA6 is either full or half step
PA7 is the clock

Here is what I have so far: ALL HELP IS GREATLY APPRECIATED :lol:

BCLR $26 $40 ;ENABLE I/O
BSET $26 $60 ;PA5,PA6, SET TO OUTPUT
BSET $00 $20 ;PA5 SET TO CLOCK WISE
BSET $00 $40 ;PA6 SET TO FULL STEP
LDAA #11 ;NUMBER OF STEPS
STAA $1000 ;LOCATION OF STEPS
STEP BSET $00 $80 ;PA7 SET FOR CLOCK
BSR DLY
BCLR $00 $10 ;CLEAR CLOCK
DEC $1000
BNE STEP
HERE BRA HERE


DLY bset $26 $03 ;SETS INTERVAL FOR 32.77msec
ldaa #30 ;MULTIPLIER 30*32.77msec = 1SEC bclr $24 $40 ;DISABLES INTERRUPT
rep bset $25 $40 ;CLEARS FLAG
mon brclr $25 $40 mon ;IF SET END OF INTERRUPT
deca
bne rep
rts
lena2383 is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 05:45 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker