k64 adc channel b cannot finished conversion

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

k64 adc channel b cannot finished conversion

570 Views
johntse
Contributor II

I have a problem, using K60 it was working but when i changed my CPU to K64 on the same Board

I have a problem where all the ADC channel B cannot work,  once conversion starts, it never finishes

or it looks like it was never triggered.

so all the B channels such as ADC0_SE4b or ADC1_SE4b will hang and never terminates

all A channels on ADc0 or ADC1 has no issue at all.

this only happens on K64 CPU, I am using  CPU : MK64FN1M0VLQ12 - 120Mhz 144pin

I am not even using interrupts or DMA. I just want to verify that all the A/D channels are working.

did not expect that such a simple thing is such a nightmare. the manual did not indicate that Channel B needs hardware to trigger. setup for both channel A or B are exactly the same.

looking thru all the forums, there is not examples

 

0 Kudos
3 Replies

553 Views
johntse
Contributor II

dear pablo

thank you for your response, i am really desperate now, i thought that the k60 cpu adc channel b is working but it is not actually working

it did read some voltages but the values all wrong

looking thru both k60 and k64 manuals  page 854 of k64 rev 4 oct 2019

it did indicate that channel B cannot use the adc software trigger function, quoted below:

Writing any of the SC1n registers while that specific SC1n register is actively controlling
a conversion aborts the current conversion. None of the SC1B-SC1n registers are used for
software trigger operation and therefore writes to the SC1B–SC1n registers do not initiate
a new conversion.

so my only choice is to use the pdb0 to trigger it but no matter what i do, i am unable to trigger ch B ADC

to keep it as simple as possible

i set the pdb0 for software trigger, one shot, bypass all delays. i load the channel into SC1B, software trigger the pdb0

read back the SC1B to see if COCO is set, but it was never set, tried BB mode and also continuous mode, also dont work

all examples are mostly using DMA or interrupt, i dont want to make my test complex and more error prone. just a simple example about will do

also, the pdb0 do not explicitly indicate where or how to set up the adc0 and adc1 triggers, so where and how exactly  does the pdb0 triggers the adcs

john

 

0 Kudos

528 Views
PabloAvalos
NXP TechSupport
NXP TechSupport

Hi @johntse 

 

I would like to apologize for the delay on my answer., we are overloaded on the requests I really appreciate that you were so patient.

 

Regarding what you are trying to use, it is a good idea to use PDB to trigger your ADC channel B on your Kinetis K Series, so I would like to suggest you based on your question, to check this thread from our community where other people shared their codes to trigger an ADC channel with PDB: https://community.nxp.com/t5/Kinetis-Microcontrollers/Triggering-ADC-with-PDB-in-K66-microcontroller...

After checking that one, you should try to check this application note too, that it is for a Kinetis KV Series, but it might be helpful on understanding the functionality and some characteristics about PDB, using eFlexPWM to trigger ADC: https://www.nxp.com/docs/en/application-note/AN5237.pdf

 

Hope this links are useful for you, please let me know if you have more questions.

 

Thank you so much.
Sincerely,
Pablo Avalos.

0 Kudos

555 Views
PabloAvalos
NXP TechSupport
NXP TechSupport

Hi @johntse 

 

Thank you so much for using our community and thank you for all your patience.

 

Regarding your issue, I would like to know if all the ADC conversion were working well previously with K60 mcu on your board? After that, may you tell me if you already tried to run an ADC example on your new K64 mcu on your board? So in this way, we can realize that everything is working properly on your board and there is no hardware issue.

 

A suggestion is to run the SDK example and select the channel where you want to receive your voltage signal, so it has to work.

 

Please let me know your comments or if you have more questions.

 

Thank you in advance.
Best Regards.
Pablo Avalos.

0 Kudos