Hi, I've done all this now, and in the debug/watch thingo in MPLAB it shows PORTA changing from high to low, etc. However, when I program the chip it doens't work. I know i have my connections right, as i've tested with another program that does the same thing but is coded in Jal. The problem is i can't understand the asm that comes out of the jal compiler so i can't see where i've gone wrong. Thanks --------Revised Code: ;Setup list P=16F877 include "c:\P16F877.inc" errorlevel -302 __CONFIG _CP_OFF & _XT_OSC & _WDT_OFF & _PWRTE_OFF & _BODEN_OFF & _LVP_OFF ;Declarations CounterA equ 20h CounterB equ 21h CounterC equ 22h org 0 goto Start Bank1 Macro bsf STATUS,RP0 bcf STATUS,RP1 bcf STATUS,IRP Endm Bank0 Macro bcf STATUS,RP0 bcf STATUS,RP1 bcf STATUS,IRP Endm Init clrf PORTA Bank1 movlw b'00001111' ;move into adcon1 movwf ADCON1 movlw b'11110000' ;0,1,2,3 of porta are output movwf TRISA Bank0 ;bank 0 clrf ADCON0 movlw b'00000000' ;all porta low movwf PORTA retlw 0 ;PIC Time Delay = 1.0000006 s with Osc = 20.000000 MHz Delay movlw D'26' movwf CounterC movlw D'119' movwf CounterB movlw D'85' movwf CounterA goto Delay_0 retlw 0 Delay_0 decfsz CounterA,1 goto Delay_0 decfsz CounterB,1 goto Delay_0 decfsz CounterC,1 goto Delay_0 retlw 0 Start call Init Main movlw b'00000001' movwf PORTA call Delay movlw b'00000010' movwf PORTA call Delay movlw b'00000100' movwf PORTA call Delay movlw b'00001000' movwf PORTA call Delay goto Main End ----- Original Message ----- From: "Jinx" To: Sent: Friday, November 29, 2002 8:09 PM Subject: Re: [PIC]: First ASM problems > > movlw 0x07 ;assuming all digital > > movwf cmcon > > Sorry, that should be (still in bank1) > > movlw b'00000111' ;set Port I/O configuration > movwf adcon1 > > bank0 > clrf adcon0 ;or at least clr bit0 (ADON) > > Deeply ensconced in F628s at the moment and cmcon is a > similar PortA register > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics