Thanks. I'll check that out. Yep, I'm aware of TRIS being obsolete, but I was being sloppy since I started with some sample code that used it. I did get warnings, but figured I'd feel like a pro if I already had some bad habits :-) Actually I've never programmed PICs before. Last thing I programmed was an 8051 over 10 years ago, but most of my assembly was on a Z80 (TRS-80 computer) about 20 years ago. Ack!!!! Cheers, -Neil. ----- Original Message ----- From: "Olin Lathrop" To: Sent: Thursday, February 28, 2002 6:34 AM Subject: Re: [PIC]: Experimenting with F872 -- can't read from PORTA ??? > >> > movlw B'00111111' > movwf TRISA ; Port A is all inputs > movlw B'00000110' > movwf ADCON1 ; Port A is all digital > movlw B'00000000' > movwf ADCON0 ; Turn off A/D > tris PORTB ; Port B is all outputs > tris PORTC ; Port C is all outputs > > loop: > movf PORTA,0 ; Grab data at port A > movwf PORTB ; Dump to port B > goto loop > > end > << > > For one thing, you've totally ignored bank settings. You do need to pay > attention to these. Check out my DBANKIF and related macros if you want a > more automatic way of setting the banks. You can find them in STD.INS.ASPIC > at http://www.embedinc.com/pic. > > Secondly, don't use the TRIS instruction. I'm surprised the assembler > didn't give you a warning. This is an old instruction that is (has) being > obsoleted. Note that it's not in the list of instructions on page 136 of > DS30292C. > > It looks like you may have programmed some old chips a long time ago. It's > time to sit down and read the manual again for the chip you are using now. > > > ******************************************************************** > Olin Lathrop, embedded systems consultant in Littleton Massachusetts > (978) 742-9014, olin@embedinc.com, http://www.embedinc.com > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.