Exact match. Not showing close matches.
PICList
Thread
'[PIC] Weird voltages on RB-pins (PIC16F886)'
2007\06\28@064859
by
Rikard Bosnjakovic
|
part 1 1542 bytes content-type:text/plain; charset=ISO-8859-1; format=flowed (decoded 7bit)
See the attached schematic. It is a simple cable-tester for a couple
of adapters I built. The tester is supposed to work like this:
A loop puts RB7, RB6, ..., RB3 high (in that order), one at a time.
RA0-RA4 are the inputs that checks if the actual pin is OK or not (a
high RB7 should give a high RA0, RB6->RA1, and so on).
When I did one cable-pin at time as described above, the tester worked
as it should. One red LED and one green LED got lit for my reference
cable. The problem with testing one pin at a time is if accidentally
switched two wires in the cable. Then the green leds would - ofcourse
- not be lit, but I thought it would be nice to see which of the wires
that are wrong.
So I rewrote the code to test all five wires for each of the
PORTB-pins. That is, RB7 high -> test all of RA0, RA1, ... and turn on
the green LEDs, move to RB6, check all RA's again, etc. I cannot see
anything wrong in my code, and it's probably not wrong either.
What's really confusing me is that when RB7, RB6 and RB5 are high
(still one at a time), my multimeter shows only ~0.6volts on those
pins. When RB4 and RB3 are high, I get ~4.7 volts and those wires are
tested accordingly.
All analog inputs are turned of (ANSEL and ANSELH are cleared), the
TRIS-regs are correct, comparators are disabled, vreg is off, pull-ups
are disabled. The board is double-checked, no broken copper traces and
no double-traces.
Anyone got a fair guess of what could be wrong?
--
- Rikard - http://bos.hack.org/cv/
part 2 20157 bytes content-type:application/pdf; name=schematic.pdf (decode)
part 3 35 bytes content-type:text/plain; charset="us-ascii"
(decoded 7bit)
2007\06\28@070357
by
Marcel Birthelmer
My first guesses would have to be that you're maybe exceeding the
specced max current for the chip/ports? Also, I think it might be
considered bad practice to connect multiple LEDs to the same resistor,
but I might be wrong about that.
Regards,
- Marcel
2007\06\28@074618
by
Jan-Erik Soderholm
Rikard Bosnjakovic wrote:
> See the attached schematic.
Use one resistor/LED.
And where are the values of all components ?
> All analog inputs are turned of (ANSEL and ANSELH are cleared), the
> TRIS-regs are correct, comparators are disabled, vreg is off, pull-ups
> are disabled.
Hard to verify for us who can't see the code...
Write the shortest possible test-case that shows the problem
and post that (not your full app, just a short code that shows
the problem...)
Jan-Erik.
2007\06\28@080933
by
Alan B. Pearce
>> See the attached schematic.
OK
>Use one resistor/LED.
Well, he doesn't need to if the leds are multiplexed, which would be OK in
this application, so only one LED is on at a time. Even flicker would be
acceptable as the LEDs are scanned - shows that the unit is operating, and
not stalled.
>And where are the values of all components ?
That is the more important thing, and what micro are you using ???? - OH it
is in the subject line, but not on the circuit - bad move.
2007\06\28@083339
by
Kevin Timmerman
Are you using an ICD2 to program the PIC? If so, make sure to use the
Program menu in MPLAB, not the Debug menu. If the chip is programmed
with the debug executive, it will take control of RB6 & RB7 (program
clock and data). Also make sure LVP is not enabled, that would disable RB5.
>What's really confusing me is that when RB7, RB6 and RB5 are high
>(still one at a time), my multimeter shows only ~0.6volts on those
>pins. When RB4 and RB3 are high, I get ~4.7 volts and those wires are
>tested accordingly.
2007\06\28@090716
by
Rikard Bosnjakovic
|
part 1 919 bytes content-type:text/plain; charset=ISO-8859-1; format=flowed (decoded 7bit)
On 6/28/07, Kevin Timmerman <spam_OUTlistsTakeThisOuT
pcmx.net> wrote:
> Are you using an ICD2 to program the PIC? If so, make sure to use the
> Program menu in MPLAB, not the Debug menu. If the chip is programmed
> with the debug executive, it will take control of RB6 & RB7 (program
> clock and data). Also make sure LVP is not enabled, that would disable RB5.
I'm using an ICD2-clone. Project->Build configuration (in MPLAB) is
set to "release", and LVP is off.
I forgot to include the code in the original post, so I'm attaching it here.
> Use one resistor/LED.
> And where are the values of all components ?
Only one LED is on at a time, so there's no need to waste board-space
by adding a resistor per LED. The LED-resistors (R2 and R3) are 220
ohms, all other resistors (pull-downs + MCLR) are all 10k each.
--
- Rikard - http://bos.hack.org/cv/
part 2 2082 bytes content-type:application/zip; name=code.zip (decode)
part 3 35 bytes content-type:text/plain; charset="us-ascii"
(decoded 7bit)
2007\06\28@093423
by
Ariel Rocholl
|
Kevin's question is whether you use the ICD2 as a programmer or as a
Debugger. This is unrelated to the build mode.
2007/6/28, Rikard Bosnjakovic <.....rikard.bosnjakovicKILLspam
@spam@gmail.com>:
{Quote hidden}>
> On 6/28/07, Kevin Timmerman <
lists
KILLspampcmx.net> wrote:
>
> > Are you using an ICD2 to program the PIC? If so, make sure to use the
> > Program menu in MPLAB, not the Debug menu. If the chip is programmed
> > with the debug executive, it will take control of RB6 & RB7 (program
> > clock and data). Also make sure LVP is not enabled, that would disable
> RB5.
>
> I'm using an ICD2-clone. Project->Build configuration (in MPLAB) is
> set to "release", and LVP is off.
>
> I forgot to include the code in the original post, so I'm attaching it
> here.
>
> > Use one resistor/LED.
> > And where are the values of all components ?
>
> Only one LED is on at a time, so there's no need to waste board-space
> by adding a resistor per LED. The LED-resistors (R2 and R3) are 220
> ohms, all other resistors (pull-downs + MCLR) are all 10k each.
>
>
> --
> - Rikard -
http://bos.hack.org/cv/
>
> -
2007\06\28@094132
by
Ariel Rocholl
|
I do not see in your code you disabling comparators, as per the datasheet:
MOVLW H'7' ;Turn off
MOVWF CMCON0 ; comparators
2007/6/28, Ariel Rocholl <.....forosKILLspam
.....arocholl.com>:
{Quote hidden}>
> Kevin's question is whether you use the ICD2 as a programmer or as a
> Debugger. This is unrelated to the build mode.
>
>
> 2007/6/28, Rikard Bosnjakovic <
EraseMErikard.bosnjakovicspam_OUT
TakeThisOuTgmail.com>:
> >
> > On 6/28/07, Kevin Timmerman <
lists
spam_OUTpcmx.net> wrote:
> >
> > > Are you using an ICD2 to program the PIC? If so, make sure to use the
> > > Program menu in MPLAB, not the Debug menu. If the chip is programmed
> > > with the debug executive, it will take control of RB6 & RB7 (program
> > > clock and data). Also make sure LVP is not enabled, that would disable
> > RB5.
> >
> > I'm using an ICD2-clone. Project->Build configuration (in MPLAB) is
> > set to "release", and LVP is off.
> >
> > I forgot to include the code in the original post, so I'm attaching it
> > here.
> >
> > > Use one resistor/LED.
> > > And where are the values of all components ?
> >
> > Only one LED is on at a time, so there's no need to waste board-space
> > by adding a resistor per LED. The LED-resistors (R2 and R3) are 220
> > ohms, all other resistors (pull-downs + MCLR) are all 10k each.
> >
> >
> > --
> > - Rikard -
http://bos.hack.org/cv/
> >
> > --
2007\06\28@094206
by
Ariel Rocholl
|
I do not see in your code you disabling comparators, as per the datasheet:
MOVLW H'7' ;Turn off
MOVWF CMCON0 ; comparators
2007/6/28, Ariel Rocholl <@spam@forosKILLspam
arocholl.com>:
{Quote hidden}>
> Kevin's question is whether you use the ICD2 as a programmer or as a
> Debugger. This is unrelated to the build mode.
>
>
> 2007/6/28, Rikard Bosnjakovic <
KILLspamrikard.bosnjakovicKILLspam
gmail.com>:
> >
> > On 6/28/07, Kevin Timmerman <
RemoveMElistsTakeThisOuT
pcmx.net> wrote:
> >
> > > Are you using an ICD2 to program the PIC? If so, make sure to use the
> > > Program menu in MPLAB, not the Debug menu. If the chip is programmed
> > > with the debug executive, it will take control of RB6 & RB7 (program
> > > clock and data). Also make sure LVP is not enabled, that would disable
> > RB5.
> >
> > I'm using an ICD2-clone. Project->Build configuration (in MPLAB) is
> > set to "release", and LVP is off.
> >
> > I forgot to include the code in the original post, so I'm attaching it
> > here.
> >
> > > Use one resistor/LED.
> > > And where are the values of all components ?
> >
> > Only one LED is on at a time, so there's no need to waste board-space
> > by adding a resistor per LED. The LED-resistors (R2 and R3) are 220
> > ohms, all other resistors (pull-downs + MCLR) are all 10k each.
> >
> >
> > --
> > - Rikard -
http://bos.hack.org/cv/
> >
> > --
2007\06\28@095746
by
Ariel Rocholl
|
Sorry for the added noise, I was looking at PIC16F688 not 886. The previous
code doesn't seem to be required for disabling comparator in the 886 (I was
working with 16F688 yesterday, probably the cause of mistake - eyes read
what they want to)
2007/6/28, Ariel Rocholl <spamBeGoneforosspamBeGone
arocholl.com>:
{Quote hidden}>
> I do not see in your code you disabling comparators, as per the datasheet:
>
>
> MOVLW H'7' ;Turn off
>
> MOVWF CMCON0 ; comparators
>
>
> 2007/6/28, Ariel Rocholl <
TakeThisOuTforosEraseME
spam_OUTarocholl.com>:
> >
> > Kevin's question is whether you use the ICD2 as a programmer or as a
> > Debugger. This is unrelated to the build mode.
> >
> >
> > 2007/6/28, Rikard Bosnjakovic <
RemoveMErikard.bosnjakovic
TakeThisOuTgmail.com>:
> > >
> > > On 6/28/07, Kevin Timmerman <
listsEraseME
.....pcmx.net> wrote:
> > >
> > > > Are you using an ICD2 to program the PIC? If so, make sure to use
> > > the
> > > > Program menu in MPLAB, not the Debug menu. If the chip is programmed
> > > > with the debug executive, it will take control of RB6 & RB7 (program
> > > > clock and data). Also make sure LVP is not enabled, that would
> > > disable RB5.
> > >
> > > I'm using an ICD2-clone. Project->Build configuration (in MPLAB) is
> > > set to "release", and LVP is off.
> > >
> > > I forgot to include the code in the original post, so I'm attaching it
> > > here.
> > >
> > > > Use one resistor/LED.
> > > > And where are the values of all components ?
> > >
> > > Only one LED is on at a time, so there's no need to waste board-space
> > > by adding a resistor per LED. The LED-resistors (R2 and R3) are 220
> > > ohms, all other resistors (pull-downs + MCLR) are all 10k each.
> > >
> > >
> > > --
> > > - Rikard -
http://bos.hack.org/cv/
> > >
> > > --
>
2007\06\28@101301
by
Rikard Bosnjakovic
On 6/28/07, Ariel Rocholl <EraseMEforos
arocholl.com> wrote:
> Kevin's question is whether you use the ICD2 as a programmer or as a
> Debugger. This is unrelated to the build mode.
Sorry. I'm using the ICD2 as a programmer. For debugging, I only use
the simulator.
--
- Rikard - http://bos.hack.org/cv/
'[PIC] Weird voltages on RB-pins (PIC16F886)'
2007\07\03@030016
by
Rikard Bosnjakovic
Just for the record, the problem is now "solved".
For some reason, RA0-RA2 did not work as inputs. They interfaced bad
with any output-port on the 16F887. I found this out by manually
"hijacking" the datalines and cross coupled the (not) intended ports,
and found that test #1-3 did not work under any circumstance when
connected to RA0-2, but flawlessly when connected elsewhere. Tried to
change the IC in case it was damaged, but I got the same weird
behaviour on other chips as well.
So, I moved RA0-3 to RC1-3. Works as a charm, but I have no clue as to
why RA0-2 didn't work as inputs, despite comparators/vrefs/analogs etc
turned off.
--
- Rikard - http://bos.hack.org/cv/
2007\07\03@064940
by
Brent Brown
|
I have a project using a PIC16F886. In my initialisation routine I set bit ADON = 0
(in ADCON0) to turn the A/D converter off. According to the datasheet ADCON0 = 0
on reset state anyway, but I have a funny feeling that I had problems with digital
inputs until I did that (my memory not too accurate).
On 3 Jul 2007 at 9:00, Rikard Bosnjakovic wrote:
{Quote hidden}> Just for the record, the problem is now "solved".
>
> For some reason, RA0-RA2 did not work as inputs. They interfaced bad
> with any output-port on the 16F887. I found this out by manually
> "hijacking" the datalines and cross coupled the (not) intended ports,
> and found that test #1-3 did not work under any circumstance when
> connected to RA0-2, but flawlessly when connected elsewhere. Tried to
> change the IC in case it was damaged, but I got the same weird
> behaviour on other chips as well.
>
> So, I moved RA0-3 to RC1-3. Works as a charm, but I have no clue as to
> why RA0-2 didn't work as inputs, despite comparators/vrefs/analogs etc
> turned off.
>
>
> --
> - Rikard -
http://bos.hack.org/cv/
> --
More... (looser matching)
- Last day of these posts
- In 2007
, 2008 only
- Today
- New search...