I'm trying to get a PIC16F684 to output to an MC3479 stepper motor control chip. This is what I've got so far, but it's not working:
list R=DEC ; sets the default numbering system to decimal
include "p16f684.inc" ; includes the header file
__Config _FCMEN_OFF & _IESO_OFF & _BOD_OFF & _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_ON & _WDT_OFF & _INTOSCIO
;**********************************
; SETUP
org 0
clrf PORTC
movlw 7
movwf CMCON0 ; turn off comparators
bsf STATUS, RP0
movlw b'00000001'
movwf ANSEL ^ 0x080
clrf TRISC ^ 0x080
bsf ADCON1^0x080, 4
bcf STATUS, RP0
movlw b'00000001'
movwf ADCON0
;Mainline of Stepper-LDR_Control.asm
PAGE
check:
movlw 5
addlw -1
btfss STATUS, Z
goto $ - 2
bsf ADCON0, GO
btfsc ADCON0, GO
goto $-1
loop:
movf ADRESH, W
movwf PORTC, 1 ; outputs to the stepper motors attached to PORTC
goto check ; "bsf" will turn stepper on "1/0" will select CW/CCW
; "bcf" will turn stepper off
END
In particular, the part I can't get working is the code right after "loop:". The "movf ADRESH, W" is OK, but for some reason, it wont output to RC0. Any help would be appreciated.