Stepper Motor controller with HC11

Posted on Aug 10, 2012

PID-Control with 68HC11. STEPPER CONTROL. 68HC11 read encoder. High accuracy RPM-measurement with 68HC11

Stepper Motor controller with HC11
Click here to download the full size of the above Circuit.
Stepper Motor controller with HC11 - image 1
Click here to download the full size of the above Image.

The encoder is connected to PORTA PA0 and PA1 The board must be in BOOTSTRAB MODE (tested with Loggyboard) ********** listing from encoder.ass ************** $ZEROPAGE.INC PORTA EQU $1000 PORTD EQU $1008 DDRD EQU $1009 TOC3 EQU $101A TFLG1 EQU $1023 SPCR EQU $1028 BAUD EQU $102B SCCR1 EQU $102C SCCR2 EQU $102D SCSR EQU $102E SCDR EQU $102F BIT5 EQU 00100000B BIT6 EQU 01000000B ORG $B600 LDS #200 Load Stackpointer JSR RS_INIT RS232 INIT LDD #0 STD ENC_COUNT set to zero clr ERRORFLAG JSR SET__MASK init MASK ENC_PLUS and ENC_MINUS *********************************************************************** LOOP JSR REALTIME loop time 0,5 msec JSR ENCODER * ------------------ LDX PTR_SERIAL JSR X * ------------------ jmp LOOP *------------------------------------------ REALTIME LDAA #BIT5 wait for Real Time Interrupt WAIT_REAL2 BITA TFLG1 BEQ WAIT_REAL2 STAA TFLG1 * ---------------------- SetToc3 LDD TOC3 ADDD #1000 0,5 msec STD TOC3 * -------------------- RTS *************************************************** SET__MASK LDAA PORTA ANDA #00000011B STAA ENC_LAST bra SET_MASK2 ******************************************** ENCODER LDX ENC_COUNT LDAA PORTA ANDA #00000011B isolate input bits...

Leave Comment

characters left:

New Circuits



Popular Circuits

3 LED Car battery Indicator
Radio Control a two wheel robot from your PC
operating modes
250mW audio amplifier
Darkroom Timer v2.0A for PCB Exposure Box
Light dimmer circuit
ESR & Low Resistance Test Meter
LED Pumpkin Candles for Colorful Halloween Jack-O-Lanterns
Telephone control automatic lamp circuit 1
Photoelectric counting circuit diagram