Breadboarded first circuit with Picmicro, wrote a test program in Mplab / Mpasm. Runs/assembles sucessful in Mplab sim w/watch windows etc. Programed chip using a Micro Engineering Labs EPIC programer. Circuit has 8 leds on portb, when powered up all leds light up (portb high, not what it is supposed to do). Thought it was a problem with my circuit or one of the parts etc. After changing parts, testing etc., for the fun of it I took a demo program that came with the programer made some changes assembled it using melabs Pic Macro Assembler program and programed the chip and the circuit worked just like it is suppose to? Tried many changes to program in Mplab/Mpasm and reprograming the chip with the same results (runs well in sim, but does not run in circuit) and program demo from melabs works. I must be missing something. I really want to use Mplab/Mpasm for developing. I have included the code below, any help would appreciated. I'm using; PIC16F84A-20, Mplab v4.12.12, EPIC programer from Micro Egineering Lab. *************************************************************** #1)below program from Mplabs - (crude, should work but does not) email may have played with tabs and line length *************************************************************** list p=16F84A include __CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC portb equ 0x06 count equ 0x0c ;--------------------------- org 0x000 ; start movlw 0x00 ;load W with 0x00 tris portb ;copy W tristate, port B outputs clrf portb ;all lines low ; bsf portb,0 ;turn on led go bsf portb,0 ;turn on led call delay ;delay via sub bcf portb,0 ;turn off led ; bsf portb,1 ;turn on led call delay ;delay via sub bcf portb,1 ;turn off led ; bsf portb,2 ;turn on led call delay ;delay via sub bcf portb,2 ;turn off led ; bsf portb,3 ;turn on led call delay ;delay via sub bcf portb,3 ;turn off led ; bsf portb,4 ;turn on led call delay ;delay via sub bcf portb,4 ;turn off led ; bsf portb,5 ;turn on led call delay ;delay via sub bcf portb,5 ;turn off led ; bsf portb,6 ;turn on led call delay ;delay via sub bcf portb,6 ;turn off led ; bsf portb,7 ;turn on led call delay ;delay via sub bcf portb,7 ;turn off led ; goto go ;repeat ; delay movlw 0x02 ;decimal 10 movwf count ;load counter repeat decfsz count,f ;decrement counter goto repeat ;not 0 return ;counter 0, end delay ; end ************************************************************ #2) below from melabs demo (assembled w/ Pic Macro Assembler) This code works. email may have played with tabs and line length ************************************************************* maclib 'p16f8x.inc' ; device pic16f84,hs_osc,wdt_off,pwrt_on,protect_off ; leds = portb ;led output port ; dir_b = 00h ;all out ; org 0ch ;start of ram space ; binary ds 1 ;binary count cnt_low ds 1 ;delay counters cnt_mid ds 1 cnt_high ds 1 ; org 0 ;reset vector ; jmp start ;go to beginning of program on reset ; org 5 ;start of code space ; retw 'DEMO84 Rev 1.3' ; ; ; delay for about 1 second based on 4mhz clock cycle ; delay mov cnt_high,#4 clr cnt_mid clr cnt_low delay1 nop djnz cnt_low,delay1 djnz cnt_mid,delay1 djnz cnt_high,delay1 ret ; ; ; it all starts here ; start mov leds,#0 ;start with all leds off setb rp0 ;point to register page 1 mov trisb,#dir_b ;set port b data direction register clrb rp0 ;point back to register page 0 ; ; ; main loop to send binary sequence to port b ; mov binary,#1 ;start with first led on ; mainloop mov leds,binary ;send the binary count to the leds ; call delay ;wait around a second ; inc binary ;increment to next binary value ; jmp mainloop ;do it forever ;