Em 10/8/2010 09:17, David Duffy (AVD) escreveu: > I'm having trouble getting started with the 18F45K20 demo board that=20 > came with my PicKit3. > > Having only used PIC12 and PIC16 series before, the PIC18 looks quite=20 > foreign! > > I've set up a new project, modified the 16F46K20 template a little as=20 > there was no template for the 18F45K20. > > Now, my aim is to just light some of the LEDs on the demo board. I'm=20 > using assembler in absolute mode to start with. > > The main program looks like this: > > START > 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 > > GOTO $ =20 > > That produces nothing from the LEDs, so I'm obviously missing=20 > something. Can someone please point me to a working example to flash=20 > the LEDs? Everything on the 'net seems to be in C. > David... First, SFRs don't need 'banksel' on PIC18, they are available at the 'access' bank. Second, PORTs and TRISs are in the same bank, so for accessing the TRIS registers you must use their name explicitly with the 'movwf'. For smaller PICs this may work, but is not a good practice. Third, don't forget to configure the pins to digital mode, for pins that support analog functions. Isaac __________________________________________________ Fale com seus amigos de gra=E7a com o novo Yahoo! Messenger=20 http://br.messenger.yahoo.com/=20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .