GPIO output problem on Kinetis KL02

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO output problem on Kinetis KL02

Jump to solution
1,029 Views
lfschrickte
Contributor IV

Hi folks,

I'm having a super weird problem with two pin outputs in my application.

I'm using a Kinetis MKL02Z16VFK4 part and trying to put logical level 3.3V on PTB3 and PTB4. And here is the strange thing:

1. If I measure them with a multimeter, the measurement is ~3.76V (ON) and 0.0V (OFF)

2. If I measure them with a scope, there is almost no signal at all (it reaches something like 120mV during on state - which looks more like noise)

I've two boards with the same problem - and in order to isolate my problem I've mounted a third one leaving all pins open, using only the basic components, which are shown in figure below.

sch2.png

sch1.png

- I'm connecting a 12Vdc power supply directly on LDO input 12Viso (red and yellow wires on picture below).

- 3.3Viso net is connected to VCC_RASMCU net.

- I've soldered all capacitors and resistors (except R206, of course).

In the picture below the PCB area of interest is shown:

IMG_20141203_131047338_HDR.jpg

Another important facts:

1. All other PTB pins are working well - I can even measure them in the scope (using the same reference, so it is probably not a reference issue)

2. There is no load or other component connected to the device

3. The LDO output is OK - I've checked it multiple times

4. I've already developed a product based on another Freescale's Cortex-M0+, so this MCU is not new to me, neither PE and other related stuff. I hope I haven't done anything stupid!

5. It is happening in the same way in all three boards I've mounted, even replacing the MCU twice in one of them - so I guess there is no soldering problem.

In order to make sure there are no other external influences, I've developed a simple software, which loop through a 'set, delay, clear, delay' routine. The software was programmed using KDS + PE. I've tried the Bit and GPIO components already, and also using directly GPIO PDD.. all giving me the same results.

Loop code snippet
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization.                    ***/

dev_GPIO1 = GPIO1_Init(NULL);

for (;;) {
GPIO1_SetFieldBits(dev_GPIO1, PB_ALL, GPIO1_PB_ALL_MASK);
delay(3000);
GPIO1_ClearFieldBits(dev_GPIO1, PB_ALL, GPIO1_PB_ALL_MASK);

delay(3000);

}

I can't figure out how the MCU is putting 3.76V in an open output if it is supplied with 'only' 3.3V (3.31V measured).

I'm kind of lost here, so any feedback will be appreciated. I'm starting to think that it is maybe a silicon problem! If some of you have the same chip with PTB3 and PTB4 working well, please let me know in this topic!

Thank you!

Regards

Luiz Fernando

Tags (2)
0 Kudos
1 Solution
690 Views
mjbcswitzerland
Specialist V

Luiz

I assume that you know that these two ports are true open-drain.

pastedImage_0.png

If you are reading more than 3.3V with the multimeter the multimeter is probably supplying some current and causing a higher voltage to me measured. Your oscilloscope is probably very high impedent in comparison and so will measure almost no change.

Simply connect multimeter and oscilloscope "at the same time" to see the effect of the measurement instruments - remember that measurement instruments can effect the measurement being made so always consider this carefully.

Regards

Mark

View solution in original post

0 Kudos
3 Replies
691 Views
mjbcswitzerland
Specialist V

Luiz

I assume that you know that these two ports are true open-drain.

pastedImage_0.png

If you are reading more than 3.3V with the multimeter the multimeter is probably supplying some current and causing a higher voltage to me measured. Your oscilloscope is probably very high impedent in comparison and so will measure almost no change.

Simply connect multimeter and oscilloscope "at the same time" to see the effect of the measurement instruments - remember that measurement instruments can effect the measurement being made so always consider this carefully.

Regards

Mark

0 Kudos
690 Views
lfschrickte
Contributor IV

No, Mark, I didn't know that! I've been searching for the wrong keywords in the reference manual - after you replied me I could find this information on it!

Things are working as expected now, thank you very much for your fast response!

Regards,

Luiz Fernando

0 Kudos
690 Views
mjbcswitzerland
Specialist V

Luiz

Using the uTasker project one sees such things without needing to search:

pastedImage_0.png

and can avoid lost development time ;-)

Regards

Mark

0 Kudos