Pin setting

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
pistons7
Level 4
Level 4
50 questions asked 10 likes given 100 sign-ins

I am using TC399. And I made a simple program to set the P31_0 pin to Low.

However, it cannot be set to LOW.
P31 register "0xF003BF00: OUT" is 0x00000000. And "0xF003BF24: IN" is 0x000000FF even though it is set to LOW.
Why can't it be set to LOW?

 

static uint8 uDisPort ;

void core0_main (void)
{
IfxCpu_enableInterrupts();


IfxScuWdt_disableCpuWatchdog (IfxScuWdt_getCpuWatchdogPassword ());
IfxScuWdt_disableSafetyWatchdog (IfxScuWdt_getSafetyWatchdogPassword ());

IfxCpu_emitEvent(&cpuSyncEvent);
IfxCpu_waitEvent(&cpuSyncEvent, 1);


IfxScuCcu_initConfig( &IfxScuCcu_testClockConfig );
IfxScuCcu_init( &IfxScuCcu_testClockConfig );

g_ScuClock.pllfreq = IfxScuCcu_getPllFrequency();
g_ScuClock.cpufreq = IfxScuCcu_getCpuFrequency( IfxCpu_getCoreIndex() );
g_ScuClock.spbfreq = IfxScuCcu_getSpbFrequency();
g_ScuClock.srifreq = IfxScuCcu_getSriFrequency();
g_ScuClock.stmfreq = IfxScuCcu_getStmFrequency();

gpio_init_pins();

while (1)
{
uDisPort = IfxPort_getPinState( &MODULE_P31 , 0U );
IfxPort_setPinState( &MODULE_P31,0 , IfxPort_State_low);
}

return;
}

0 Likes
1 Solution
cwunder
Employee
Employee
5 likes given 50 likes received 50 solutions authored

Two comments, the first is that it appears you have a problem with the board or device on P31.0.  The port driver is trying to drive the pin high but it is being read as low.

cwunder_0-1679249998060.png

Second comment is that P31.0 is a FAST pad. You are not allowed to use Speed grade 4 for this type of pad.

cwunder_2-1679250291339.png

 

cwunder_1-1679250111407.png

 

View solution in original post

0 Likes
5 Replies
cwunder
Employee
Employee
5 likes given 50 likes received 50 solutions authored

Can you provide what the value of the P31_IOCR0 register is? The PC0 bitfield coding determines the port line functionality. For example if you want P31.0 to be a push/pull general purpose output then P31_IOCR.B.PC0 should be 0x10.

cwunder_0-1679169713179.png

 

0 Likes
lock attach
Attachments are accessible only for community members.

I'll paste the register as an image.

And I have one concern.

For example , I configured P31_0 using pinmapper.

As the result , aurix_pin_mappings.h is displayed as below.

As a result, aurix_pin_mappings.h is displayed as below.
The register shows speed grade 3 even though I set it to speed grade 4.

// p31_0
#define IFXCFG_PORT_GPIO10 IfxPort_P31_0
#define IFXCFG_PORT_GPIO10_MODE IfxPort_Mode_outputPushPullGeneral
#define IFXCFG_PORT_GPIO10_PAD_DRIVER IfxPort_PadDriver_cmosAutomotiveSpeed4

0 Likes
cwunder
Employee
Employee
5 likes given 50 likes received 50 solutions authored

Two comments, the first is that it appears you have a problem with the board or device on P31.0.  The port driver is trying to drive the pin high but it is being read as low.

cwunder_0-1679249998060.png

Second comment is that P31.0 is a FAST pad. You are not allowed to use Speed grade 4 for this type of pad.

cwunder_2-1679250291339.png

 

cwunder_1-1679250111407.png

 

0 Likes

I appreciate you.
It was helpful.
I will review hardware checks and pin assignments.

0 Likes

H/W is no problem.

It became possible to output by changing the EBU_MODCON register.

0 Likes