ADC/GPIO/Clock Startup Stumper

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

ADC/GPIO/Clock Startup Stumper

2,899 Views
codyhubman
Contributor III

Came across an interesting issue and currently not satisfied with the "fix" performed. Some background, during testing of the MKEAZ128 chip a custom control board an issue was found that seemed to be an issue with the thermistor placed on A6 (which I recognize is defaulted to ADC). Once the Thermistor reached ~90 F the processor started to get hung up and wouldn't connect to the controller. Soon we found out the processor would work with no issues at those temperatures if it was on before turning it up that high. After further investigation SystemInit() was getting hung up at the following spot.

pastedImage_1.png

What is in red is where the code would get hung up. However, When adding the code in blue (pin A0) everything would work fine and the proper clock would be selected. Any hints on why this is a problem? For now we are continuing testing and this weird code works. (The A0 pin is tied to a 10k resistor and goes out to a header.) However I still am not satisfied with not understanding this. Any hints, suggestions, or reasoning would be greatly appreciated! Thank you!

-Cody

0 Kudos
24 Replies

2,417 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cody hubman,

       Do you mean PTA6 will cause the problem?

     

     When you can test the project, please test the following case:

1. Before you do the clock mode settings, you can try to configure the PTA6 as the GPIO function instead of the ADC function.

  Then heat the PTA6 again, whether you still have problems, please note, you need to make sure the Temperature range (ambient): -40 to 125°C.

2. You can try my attached KDS KEA PE simple project, you can add some LED blinky refer to your own board, then test it again without modify the PTA6 pin function, whether the problem still exist.

After you test it, please let me know the result.

Waiting for your updated information.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,417 Views
codyhubman
Contributor III

Yes, PTA6 is causing my problem. However I went back and seen if this error occurred on past boards with a different pin assignment for the thermistor and it still happened.

I assume your suggestion will work. That code that I added in blue also worked and as long as I configure any ADC GPIO to drive a 1 before I do my clock settings everything works perfectly fine. Im just trying to figure out why my A6 with the thermistor would affect setting up my clock

0 Kudos

2,417 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cody hubman,

  Except the PTA6 ADC with thermistor, do you check any other ADC pins with thermistor, whether other ADC pins also have this issue or not?

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,417 Views
codyhubman
Contributor III

Ill double check tomorrow which pin I used but I did try this on an old board that I was prototyping with that ran a 44pin instead of a 64 pin KE06z and the thermistor caused the startup code to not finish with that model as well. Im pretty sure I didn't have it on the A6 tomorrow but I will verify that tomorrow

0 Kudos

2,417 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cody hubman,

  Do you mean KE06 alao have this problems?

  Do you have any NXP official KEA128 or KE06 board? Can you reproduce the problem on the NXP official board as well?

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

2,417 Views
codyhubman
Contributor III

So far what I the ones I have dealt with too but these were all on Proto-boards. I do have a FRDM KE06z board that I can try to reproduce the problem but I didn't have enough time today. I will also report those findings tomorrow

0 Kudos

2,417 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cody hubman,

     It doesn't matter, after you find time to test it, just share your test result with me.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,417 Views
codyhubman
Contributor III

It was a different ADC pin that causes a crash for my past boards... However I did try setting up a thermistor on the KE06z freedom board and it seemed to hand the clock setup without any issues so I'm suspicious that it's a hardware issue somewhere. Could it be a filtering issue from the thermistor? pastedImage_1.png

0 Kudos

2,417 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cody hubman,

  Check your KEA chip, whether it is the same package as the FRDM-KE06 board? If yes, you can replace the FRDM-KE06 chip to the KEA chip, then test it again, whether it has problems or not? Just check whether it is related to the PCB layout interference.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,417 Views
codyhubman
Contributor III

It is a similar problem to my KEA128 64 pin, 44 pin ke06z128, and 64 pin ke06z128. Because It doesn't seem to be an issues with the FRDM board I am suspicious that it is a hardware problem... It's a really weird problem

0 Kudos

2,417 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cody hubman,

   A test thought for your own board, but you need to do it very carefully.

  Find a tweezer, just move the PTA6 pin leave your own PCB, then heat the pin again, whether you still have problems or not?

  It seems your hardware is influenced by your thermistor, maybe some interference flow to the power, the crystal, or the ground signals.

   

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,444 Views
codyhubman
Contributor III

That's a really good idea I'll give it a shot. However, on my 44 pin board I had the same thermistor circuit but setup with a through hole that protruded at least an inch from the board. But I will still give it a go

0 Kudos

2,444 Views
codyhubman
Contributor III

So I disconnected the PA6 pin and the code startup up as normal after heating up the thermistor so at least it's not a layout issue. Is there something in the internal circuitry that would cause issues with this circuit pastedImage_1.png

0 Kudos

2,444 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cody hubman,

   Try my attached project which is using the FEI mode on your disconnected the PA6 board:

https://community.nxp.com/servlet/JiveServlet/download/1271856-1-466197/KEA128.rar 

  Then debug it, where the code is stopping?

   This code just using the FEI mode, KDS PE project, didn't modify PTA6 pin function, still the ADC function.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

2,444 Views
codyhubman
Contributor III

I couldn't seem to get this code to freeze anywhere. I'll look around it and see why it's appearing to be successful. Do you know where this code selects the clock? Ill keep looking around for it and report back any findings on my problems. Also do you know if this code selects an external clock for ICS? Thanks for all your help so far I really appreciate it

0 Kudos

2,445 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cody hubman,

      The code which I give you is based on the PE KDS.

      About the clock code, please check the following __init_hardware API:

pastedImage_4.png

  Of course, you also can choose the FEE mode by referring your own external crystal.

pastedImage_5.png

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,418 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cody hubman,

  When you use the FEI mode, where you are stopping? Please give me you test result!

  BTW, please tell me which code you are using? The NXP official code? Which IDE?

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,418 Views
codyhubman
Contributor III

So this is in the MKE06Z.C startup code file and it's part of a prebuilt setup in Kinetis Design Studio. I assume this is NXP official code. Clock Setup 0 or 1 suggests it starts with FEI. But It gets stuck on a similar while loop. (I think). I'm also not sure if there is an interrupt causing an issue but idk why that would be the case. 

Im so thrown off why my thermistor would be affecting my ICS selection. It works perfectly fine if I activate any random ADC Default GPIO before it checks to see which clock has been selected. I'm not at work now otherwise I would have posted the rest.

It only takes about 5 seconds of blowing the heat gun on the thermistor too for it to get hung up on the ICS code.

0 Kudos

2,418 Views
codyhubman
Contributor III

A little update. When I did the LED blink code on a pin that was not defaulted to ADC it no longer worked. I tried A1 then instead of A0 (which is another ADC default pin) the code booted fine. So I guess the question is now... What with my ADC might be causing this to get hung up. To summarize my issues...

When I heat the thermistor the bootup code never selects a clock unless I write a 1 to a GPIO pin with ADC selected as the default.

0 Kudos

2,418 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cody hubman,

   When you meet the code is stopping your red area:

From the RM register:

pastedImage_3.png

So, when you code stop there, it means your external OSC is stopping oscillating, you can check your hardware, check the osc pin, whether it is oscillating or not.

 BTW, you also can try to use the internal IRC, whether you still have this problems or not?

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos