Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with INPUT PIN2
21-05-2012, 09:45 AM,
#1
Problems with INPUT PIN2
Since last week I own a brand new Pinguino PIC32 (Rev. C) and this weekend I was building some circuits on my breadboard.
I build exactly this circuit: http://arduino.cc/en/Tutorial/DigitalReadSerial ,
the only difference is that I used a 4.7kOhm resistor to set PIN2 to 0V per default. My problem is that the Pinguino always reads PIN2 as HIGH as long as I use the 4,7kOhm resistor. With every other PIN the circuit works perfectly fine (with changed code of course) but PIN2 resists to work proper. Now I found out it works if I only use a 360Ohm resistor to connect GND to PIN2. Is my Pinguino broken? In my opinion 360 Ohm is far to low to use as a pull-down. Or is it because PIN2 is also used for BUT? ( I think this means the user-button)

Thx,

Sebastian
Reply
21-05-2012, 10:41 AM, (This post was last modified: 21-05-2012, 10:43 AM by mf01.)
#2
RE: Problems with INPUT PIN2
Hi MasterB,

if you look at the schematic of the PIC32 Pinguino OTG (which I assume is the board you have as you refer to Rev C but it is similar in this area for the PIC32 Pinguino) you will see that there is a 4k7 pull-up resistor already connected to D2 and also that the actual button (BUT) connects D2 to ground via a 330R resistor, so the value you are using is consistent with this. Also from TABLE 29-8: DC CHARACTERISTICS: I/O PIN INPUT SPECIFICATIONS in the MicroChip PIC32MX3XX/4XX Family Data Sheet (61143H) the maximum value for a LOW input is either 0.15 VDD or 0.2 VDD depending on the particular input type, which gives 0.495V or 0.66V with a 3.3V supply (VDD). For simplicity and to save having to check the characteristics for a particular input I would use the lower figure (0.495V) as guide.

From the above I would as that your board is functioning correctly.

Just a note, but if you use a 4k7 pull down resistor then the voltage on this particular pin will be mid-way between 3V3 supply and ground due to the presence of the existing 4k7 pull-up resistor associated with BUT. There is a note in Section 12.1.2 DIGITAL INPUTS in the MicroChip data sheet referred to above that says that "Analog levels on any pin that is defined as a digital input (including the ANx pins) may cause the input buffer to consume current that exceeds the device specifications." so for this pin and any other pins where similar pull-up resistors are already included on the board, you should definitely avoid using a 4k7 pull-down resistor. The simplest way is to avoid using such pins for digital inputs if you can.

The schematic is available from the Olimex website and also from www.pinguino.cc.

You may also want to look at this OTG Xref Table that highlights some of the other pins that may not behave as your may initially think.

Regards
Board = PIC32-Pinguino-OTG Rev C
OS = Linux Unbuntu 11.10 till 26 Apr 2012
OS = Linux Unbuntu 12:04 from 27 Apr 2012
Reply
21-05-2012, 01:04 PM,
#3
RE: Problems with INPUT PIN2
Thank you for the answer mf01, that helped a lot! So if I am right any resistor higher than approximately 830R would mean that PIN2 reads HIGH as the voltage is above 0.495V, doesn't it? So all the other Pins should work fine, or do the Pins at section CON5 also have an 33k resistor? I am not sure how to read the schemiatic but the blue line goes to 3V3 via R13, or am I wrong?

Could you pleas explain what "Analog levels" mean? Should the input voltage be far above oder below the reference value of 0.495V to be considered digital? Then I have to consider this when using all Pins at CON5.

By the way, I might be wrong with the Rev. C, it is definetly a PIC32 Pinguino without OTG, so it might be Rev. B

Thanks
Reply
21-05-2012, 02:02 PM,
#4
RE: Problems with INPUT PIN2
Quick passing comment: the board says on it the Rev Smile

John
Reply
21-05-2012, 03:05 PM,
#5
RE: Problems with INPUT PIN2
Hi again Master B,

You have made an assumption about the high level which is not correct. There is a similar specification for the high level in the MicroChip Family Data Sheet that I referred you to. Again it varies for different input types. Not wanting to reproduce the whole document here I just included the parts about the Low value relating to your original query. The worst case for the High value is a minimum of 0.8 VDD, approx 2.65 V for a 3V3 supply so a value less than 0.495V is Low and and value greater than 2.65V is High with an undefined area in between. If in doubt or if you need further clarification check the datasheet.

I don't think that the pins on CON5 have a 33k resistor. I think that your possible confusion is the way that the schematic is drawn to the left of CON5. Two lines appear to cross the thicker vertical line. Whereas the line labelled D10(#SS does cross the thicker vertical line (same label on both sides of the thicker vertical line), UEXT_#CS is NOT connected to D13 (SCK/LED1) (different labels on either side of the thicker vertical line). I know this confused me initially and I eventually checked it with a test meter. If in doubt check it Wink.

In the context of the note I quoted in my earlier post "analog level" is any voltage falling between a digital Low and a digital High as defined in the MicroChip Family Datasheet for the particular input. Essentially if you are using an input as a digital input then you should try to make sure that it is either a High or a Low rather than some value in between.

I have three PIC32 Pinguino OTGs and they are all labelled PIC32- PINGUINO Rev.C on both sides of the board. The simplest way to check which board you have is to download the User Manuals from the Olimex website and compare the layout on the top of the board with the pictures (photos) in the User Manuals. Although there are some similarities between the two boards the OTG board has some additional (unused) pads between the main processor IC and the CON1 & CON2.

Regards
Board = PIC32-Pinguino-OTG Rev C
OS = Linux Unbuntu 11.10 till 26 Apr 2012
OS = Linux Unbuntu 12:04 from 27 Apr 2012
Reply
21-05-2012, 03:09 PM,
#6
RE: Problems with INPUT PIN2
Thanks, that has helped a lot!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)