Apr 09, 2019
05:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 09, 2019
05:20 AM
I am using tricore tc233 microcontroller for project purpose . I try to configure P40 pin as digital pin but by default it use as analog pin
The configuration I made is below, (p40.0 to p40.3)
portswitch->IOCR0.U = 0x08080808; // pull up input
portswitch->PDISC.U = 0X00000FF0;
when I try to flash this code , debugger moving to trap further not proceeding. Also Cannot able to write into this PDISC register,
Help us to guide how to over come this issue, and how to make analog to digital input of port 40.
Please share if any pseudocode or sample code to make analog input to digital input.
The configuration I made is below, (p40.0 to p40.3)
portswitch->IOCR0.U = 0x08080808; // pull up input
portswitch->PDISC.U = 0X00000FF0;
when I try to flash this code , debugger moving to trap further not proceeding. Also Cannot able to write into this PDISC register,
Help us to guide how to over come this issue, and how to make analog to digital input of port 40.
Please share if any pseudocode or sample code to make analog input to digital input.
- Tags:
- IFX
1 Reply
Apr 09, 2019
08:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 09, 2019
08:45 PM
When writing to the special function registers you need to check the access rights. The PDISC register has the following access rights SV, E, P. Which means you must be in supervisor mode, is CPU EndInit protected and has master access protection.
If you are using the software frameworks you can use the defined functions:
If you are using the software frameworks you can use the defined functions:
uint16_t cpuWdtPassword = IfxScuWdt_getCpuWatchdogPassword();
IfxScuWdt_clearCpuEndinit(cpuWdtPassword);
portswitch->PDISC.U = 0X00000FF0;
IfxScuWdt_setCpuEndinit(cpuWdtPassword);