Just an FYI...yes, reading from PORTx, writing to LATx, and write are worki= ng corrctly, just the input side. --- On Sat, 5/2/09, Isaac Marino Bavaresco wr= ote: > From: Isaac Marino Bavaresco > Subject: Re: [Bulk] [PIC] inputs on 18F4420 > To: "Microcontroller discussion list - Public." > Date: Saturday, May 2, 2009, 8:55 PM > alan smith escreveu: > > Things that make you go hmmmmm > > > > I have solid hardware working with a 16F887, least > solid in the > > fact the IO works fine. I took the same board, and > replaced it > > with a 18F4420, as its the only part I could identify > that its pretty > > much a drop in replacement, in as much as pin > definitions, etc. > > > > So the code ports over, and with eliminating the page > boundary calls > > and other minor things, its cycling and doing its > thing, almost. > > > > The ports that are outputs work fine, the drive what > they are supposed > > to drive. But the inputs are not working, so thats > what makes > > me go hmmmmm...... > > > > Yes I've checked the TRIS registers, they are > setup correctly. I > > have probed at the pins and I see the input changing > from 0 to 1, > > so we are good there. Ive also made sure that PORTB > is set for digital > > and ADCON1 has all digital. > > > > Just wierd...doesn't seem to want to see inputs... > > = > = > PIC18 MCUs, besides the PORTx and TRISx, have the LATx > registers. > Usually you write to LATx registers and read from PORTx > registers. > If you read LATx, then you read what you had previously > written to it. > To read the pins state you must read the PORTx registers. > = > Because you are porting from a PIC16 device, I would say > it's unlikely > such a mistake, because PIC16 don't have LATx > registers, so you are > probably reading PORTx registers. > = > But check this anyway... > = > Regards, > = > Isaac > = > __________________________________________________ > Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! > Messenger = > http://br.beta.messenger.yahoo.com/ = > = > -- = > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist