> >> BANKSEL TRISD >> movlw 0x00 >> movwf PORTA >> movwf PORTB >> movwf PORTC >> movwf PORTD >> >> BANKSEL PORTD >> movlw b'10101010' >> movwf PORTA >> movwf PORTB >> movwf PORTC >> movwf PORTD > >> That produces nothing from the LEDs, > > Of course it won't. As the manual clearly states (and as is customary > with > all PICs), all pins wake up in high impedence state to the extent they > can. > Writing values to the port registers isn't going to have any effect until > you set the pins to outputs. At the very least this means clearing the > TRIS > bits, but may also require disabling analog peripherals associated with > the > pins of interest. Just writing 0 then some value to the port registers > has > no chance of producing a visible result without making pins outputs. > On the PIC16, the TRIS registers were often (always?) the same as the port address plus whatever the offset was to get to the next bank. As was pointed out, the 18 pretty much gets rid of bank issues, but consult the datasheet. So, I think those first movwf port instructions were actually attempts to clear TRIS. I'd do something like clrf TRISA , etc. Also, as others have pointed out, write to LATA and read form PORTA. This gets rid of the read modify write issues. Also, the default linker script generally does the job, so you can write relocatable code without having to dig in to the script. If you just don't include one in your project, the default is used. Good luck! I'm working on a fairly large project for the 18f26k20, but it's all in C except for the bootloader. Harold --=20 FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .