Searching \ for '[PIC] inputs on 18F4420' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/microchip/ios.htm?key=input
Search entire site for: 'inputs on 18F4420'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] inputs on 18F4420'
2009\05\02@223221 by alan smith

picon face

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...


     

2009\05\02@235832 by John Coppens

flavicon
face
On Sat, 2 May 2009 19:32:17 -0700 (PDT)
alan smith <spam_OUTmicro_eng2TakeThisOuTspamyahoo.com> wrote:

> Just wierd...doesn't seem to want to see inputs...

Hello Alan.

I see that portB pins can be used for 4 functions. Sure you have disabled
the low voltage programming mode/in-circuit programming etc?

John

2009\05\03@002834 by Tony Vandiver

flavicon
face
Any JTAG stuff in the configuration bits?  Make sure to look at the pin
names in the datasheet so you know if the ones in question might have
another function.

Tony


alan smith wrote:
{Quote hidden}

2009\05\03@092312 by olin piclist

face picon face
alan smith wrote:
> 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.

There are issues than pages to worry about.  Pages is the easiest since they
are essentially gone.  Banking is easier, but still there.  Then there are a
lot of subtle things, like the rotate instructions having different names,
and some instructions effecting status bits differently.  Any GOTO $-1 will
be broken as instructions now take two addresses instead of 1.  All in all
though, going from a PIC 16 to a PIC 18 is not too bad as long as the code
was written responsibly in the first place.

> 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......

You forgot to turn off the A/D and/or the comparator.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\03@121132 by alan smith

picon face

True...been bit by that before.  But I have an input to PORTB.0, and typically nothing else is double mapped to that, as its the primary interupt pin. Nothing I can see at this point indicates that its configuration, but after sleeping...for a few hours, something might show up as the culprit.

--- On Sat, 5/2/09, Tony Vandiver <.....tonyKILLspamspam@spam@traceelectronics.com> wrote:

{Quote hidden}

> --

2009\05\03@121140 by alan smith

picon face

True...been bit by that before.  But I have an input to PORTB.0, and typically nothing else is double mapped to that, as its the primary interupt pin. Nothing I can see at this point indicates that its configuration, but after sleeping...for a few hours, something might show up as the culprit.

--- On Sat, 5/2/09, Tony Vandiver <EraseMEtonyspam_OUTspamTakeThisOuTtraceelectronics.com> wrote:

{Quote hidden}

> --

2009\05\03@121148 by alan smith

picon face

True...been bit by that before.  But I have an input to PORTB.0, and typically nothing else is double mapped to that, as its the primary interupt pin. Nothing I can see at this point indicates that its configuration, but after sleeping...for a few hours, something might show up as the culprit.

--- On Sat, 5/2/09, Tony Vandiver <KILLspamtonyKILLspamspamtraceelectronics.com> wrote:

{Quote hidden}

> --

2009\05\03@121940 by alan smith

picon face

Olin

I'll double check the A/D and comparitors, and that could explain some of it,but not really PORTB.0 lack of being seen. I have the ADCON1 register set for all digital inputs, PBADEN is off.  I have weak pullups enabled on INTCON1.7 (cleared).

And yes..the $-1 will get you, but I prefer labels. I havent used that form in years now.  The code moved over with minor changes...rrf, etc that had to be changed..and its functioning correctly except for the inputs.

Keep on hunting today....

--- On Sun, 5/3/09, Olin Lathrop <TakeThisOuTolin_piclistEraseMEspamspam_OUTembedinc.com> wrote:

{Quote hidden}

> --

2009\05\03@141004 by peter green

flavicon
face

> I have the ADCON1 register set for all digital inputs
Something to watch for: make sure you are reading the right
documentation on adcon1 values. The ADC behaviour changed between the
first and second generation of 18f chips.

2009\05\03@170353 by olin piclist

face picon face
alan smith wrote:
> I'll double check the A/D and comparitors, and that could explain
> some of it,but not really PORTB.0 lack of being seen.

Sure it can.  RB0 is also AN12.

> I have the ADCON1 register set for all digital inputs,

So you say, but have you actually read it back after initialization to make
sure it got set the way you think or not got clobbered later?  The same goes
for TRISB.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\03@181304 by alan smith

picon face

Yep, read it back.  Basically right after I init the part, set up the ports,etc, etc I put it into a loop to just hold it there, and stop it running.  Then I look at the watch window, validating that all the registers are set correctly. Since the PORT register should simply reflect whats on the pins, I force the inputs to a state and single step it looking for a change..nothing.  Ive stepped away from it most of today so I can have a fresh look later tonight, so who knows...might be something I didnt catch the first time.


--- On Sun, 5/3/09, Olin Lathrop <EraseMEolin_piclistspamembedinc.com> wrote:

{Quote hidden}

> --

2009\05\03@181716 by alan smith

picon face

Yes..I am using the current data sheet for that part but thanks for pointing that out.  SOmetimes the obvious is what gets you!


--- On Sun, 5/3/09, peter green <RemoveMEplugwashTakeThisOuTspamspamp10link.net> wrote:

> From: peter green <EraseMEplugwashspamspamspamBeGonep10link.net>
> Subject: Re: [PIC] inputs on 18F4420
> To: "Microcontroller discussion list - Public." <RemoveMEpiclistKILLspamspammit.edu>
> Date: Sunday, May 3, 2009, 11:10 AM
> > I have the ADCON1 register set for all digital inputs
> Something to watch for: make sure you are reading the right
>
> documentation on adcon1 values. The ADC behaviour changed
> between the
> first and second generation of 18f chips.
> --

2009\05\05@070444 by Alan B. Pearce

face picon face
>Yes..I am using the current data sheet for that part but thanks
>for pointing that out.  SOmetimes the obvious is what gets you!

But have you checked the errata ... ??

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...