Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Microcontroller default state problem

Status
Not open for further replies.

FreshmanNewbie

Advanced Member level 1
Advanced Member level 1
Joined
May 10, 2020
Messages
435
Helped
0
Reputation
0
Reaction score
3
Trophy points
18
Activity points
4,318
I have a Microcontroller - S32K116 - 48 Pin IC. - Datasheet - Reference Manual

I have a Voltage divider (for input voltage monitoring purpose) connected to the Pin 16 (PTC3) of the Microcontroller.

Image :

enter image description here


I have NOT programmed my Microcontroller. But I have connected this Voltage divider circuit to the PTC3 pin of the Microcontroller in my board.
If I give 5V input to the Microcontroller and the same 5V for the Voltage divider, If I measure the output of the voltage divider, I am getting like 0.7V to 0.8V. I should actually get a output voltage of 2.5V, for input voltage of 5V, right?

But then I realized that since my Microcontroller is not programmed, there must be something to do with the default state of the pins (does default state means before programming the microcontroller or after releasing the reset of the microcontroller?) of the microcontroller.

I checked the Reference manual of the Microcontroller.

Note 1 :

On page 89 of the reference manual, table 4.3, it is mentioned as for "Other pins" - the default state is "High Impedance".

Note 2 :

On page 91 of the reference manual, there's a paragraph mentioning - "By default, ALT0 mode (configured by PTXn_PCR[SSS] as 3’b000) corresponds to disabled functionality and pad represents disabled (highimpedance) state. In case if the pad consists of analog functions, the ALT0 mode corresponds to analog functionality once the analog module is configured to enable corresponding channel/input."

My questions :
  1. From the Note 1, can somehow like provide me a small illustration of what the "High Impedance" state of the Microcontroller pin would actually look like? (I understand that in High Impedance state, there is no current draw, but just want to know how the impedance state of the microcontroller pin would look like)
  2. In the sheet, S32K116_IO_Signal_Description_Input_Multiplexing", I found like
enter image description here


I am not able to link this table with the Note 2 - paragraph which I have mentioned above.

a. What does default state actually mean? Is the state before the microcontroller is programmed? Or is the state after the microcontroller (once after programmed) Reset is released? What does the default state mean in this context and what does the ALT0 mode indicate? Since, my PTC3 is an analog pin, what is the paragraph in Note 2 trying to convey?
  1. Why am I getting 0.7V or 0.8V instead of the required 2.5V when my Microcontroller is not programmed?
 

You shouldn't really apply voltages to the MCU until it is ready to run but it is unlikely any damage will have been done in your case.
You are correct that 'high impedance' basically means the pin is disconnected inside the IC so Ohms Law alone would give you the expected half voltage at the junction of the resistors but you have no idea whether an UNprogrammed device is actually setting it to high impedance at all. It is a condition your firmware would normally set the pin to but may not be the default if it is blank. The voltages you are seeing suggest the pin is actually an output and the voltage from the resistors is 'fighting' something from inside the MCU.

You will probably find that as long as the MCU clock is running and if it is held in a reset state, the voltage will be as expected but under different conditions anything could happen. The MCU may even be shipped with a bootloader that is driving the pin. If you program it first and ensure the pin is configured as an analog input it should be fine.

Brian.
 

I don't see an obvious explanation for getting 0.7 V with the shown circuit, presumed the µC is powered and pin is actually configured to default state. Respecetively we can't check the problem remotely.

This kind of problems can be best debugged by playing with the chip at your fingertips, reading and modifying register values etc.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top