µTasker Forum

µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: eduardovra on April 11, 2008, 07:48:46 PM

Title: GPIO Pins and Pull-ups in MCF52233
Post by: eduardovra on April 11, 2008, 07:48:46 PM
Hi All !

I'm working in a custom board that uses MCF52233 and I'm having trouble to use PORTTA as GPIO input pin.
Look to my code so you could give your opinion:

Code: [Select]
PTAPAR = 0x00;        // First I configure the port for GPIO Mode
DDRTA &=  0x00;        // Then I set the direction as input
MyVar = PORTIN_SETTA;     // So I try to read the pin state

Although it's disconnected electrically, the voltimeter always shows 0 volts in the pins, so I always read 0 from the port's register.
When I connect the 3.3 V supply directly to pins of the port, I can read high logic state from my code. I conclude there's a problem with the processor's pull-up resistors.
I've read the Processor's Reference Manual from Freescale and it says that all pins that are configured as GPIO have default enabled pull-up resistors internally, but it seems don't have.

Any tips ?

Best Regards

Eduardo
Title: Re: GPIO Pins and Pull-ups in MCF52233
Post by: mark on April 12, 2008, 02:25:20 PM
Hi Eduardo

In my experience the GPT port operates as stated in the user manual - out of reset it is an input with active pull up resistor.

I have just verified this on a M52233DEMO board as follows:


These results are therefore consistent with the presence of the pull-up device, which can not be disabled.
Note that the electrical specification doesn't state an equivalent resistor value but rather a current. This current can vary quite widely so I interpret this as meaning that the actual pull up value (which is weak) can vary between around 30K and 300K. [In a project with M5213 I noted all GPIOs as having approx. equivalent 30k pull-ups on all GPIOs].

Is it possible that you have something connected to the pin on your board which is taking current from the input? When measuring a weak current source be careful that the measuring equipment is not loading it (eg. an analogue multimeter could have a relatively low impedence and so pull the input value down when connected).

As summary, I don't think that the M52233 has an error so I think that you need to carefully re-check your measurements. The code looks fine, but the default state out of reset is in fact the same.

Good luck

Regards

Mark