MPC5746C ADC problem

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

MPC5746C ADC problem

1,499 Views
2548903578
Contributor III

Hi,

When I configured the ADC in mpc5746C, after using PE to configure the ADC, I found that the program would always enter IVOR1_Handler when the ADC was initialized. The program has an operating system.

0 Kudos
11 Replies

1,124 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

From the description you have provided is almost impossible to tell you where is the problem
I guess, you are accessing some reserved/uninitiated space of memory/registers.

If you debug your driver assembly step by step you will see where exactly you code crash and why it jumps to IVOR1.

regards,

Peter

0 Kudos

1,124 Views
2548903578
Contributor III

The compressed package is the code I modified from the official website routine. There is a problem here, I think the problem is the same. Can you show it to me?

0 Kudos

1,124 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

I have just tested your code and it is running without any exceptions being pulled.

It converts ADC channels, jumps to ISR, etc..

I see nothing strange.

Are you using our evaluation board, or custom board?

What about clocks? Crystal used, etc...

Check if this is aligned with example settings.

regards,

Peter

0 Kudos

1,124 Views
2548903578
Contributor III

Hi,

I added an operating system to the ADC demo, and the ADC crashed. Why is this?

0 Kudos

1,124 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

Seems to me like SW issue.

What does "crashed"means? you end up in some exception?
You cannot just add something to operating system without any knowledge on the SW and HW.

How do you handle interrupts?

Do your OS has permissions to write to ADC registers? There can be a lot of choke points...

I suggest you to first make OS run and make sure it runs well.

Then starting add some simple tasks which for example enable ADC, do conversion and serve interrupt.

Once this works, you will have  a good idea on how to proceed.

regards,

Peter

0 Kudos

1,124 Views
2548903578
Contributor III

Hi,

In the case of ensuring the normal operation of the operating system, once the ADC is added. "No source available for" uSDHC_DriverIRQHandler () at 0x1002bc8 "" will be displayed when the ADC is initialized.I do n’t know much about this chip, I really do n’t know how to solve this problem, and I did n’t look for similar problems and solutions, so I hope you can help me solve it. thank you very much!微信截图_20200410105353.png

0 Kudos

1,124 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

Hmm, ok, it will be hard for you to resolve issues when you have very limited knowledge on uC.

First it seems like you are missing some source files in project. Make sure you have al of them for compilation and there will be no warnings/errors (critical ones).

No source available mean you won't be able to see C code which is in that file. You will see only assembly instructions. This is usually solved by adding a source file to debugger GUI or by recompiling the project.

It is nothing critical, which prevents application from normal run.

regards,

Peter

0 Kudos

1,124 Views
2548903578
Contributor III

Hi,

When no operating system is added, the ADC can work normally. After the operating system is added, the ADC initialization crashes directly and the operating system does not work properly. After I shielded the code related to ADC, the operating system can work normally.The last picture is the development board I used.微信截图_20200408112810.png微信截图_20200408132240.png微信截图_20200408132900.png微信截图_20200408133539.png

0 Kudos

1,124 Views
2548903578
Contributor III

Hi,

I experimented again, and there was really no problem. My configuration is basically the same as Demo, but that interruption error will occur.

0 Kudos

1,124 Views
2548903578
Contributor III

Hi Peter,

 I have only recently come into contact with the chip, so there are many things I don't understand. I would like to ask where to check the code in this case. I generated the ADC using PE, then transplanted the formal initialization code, and the program had this problem. I really don't know what to do, I hope you can give me some suggestions. thank you very much.

regards,

zxs zxs

0 Kudos

1,124 Views
2548903578
Contributor III

I found the problem during debugging, but I don't know why it happened. This is the picture when I debug, I hope someone can help me, thank you very much!b311f274d66f67a3515d0ba723e2652.png

1dadf121dfd7facf1e50c4d86716395.png

0 Kudos