Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Jan 21st, 2005, 5:49 PM   #1
HaZaRd2K5
Newbie
 
Join Date: Jan 2005
Posts: 1
Rep Power: 0 HaZaRd2K5 is on a distinguished road
PIC16F684 and MC3479

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.
HaZaRd2K5 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:21 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC