cancel
Showing results for 
Search instead for 
Did you mean: 

SPC570S GPIO Setup

NBula.1
Associate III

HI,

I have a question regarding the GPIO setup.

I have setup a few pins and outputs from the pin map editor. For all of those pins, the toggle

function work without any issue. However when I try to turn them on or off using the write_pad function or the set_pad, clear_pad function it does not work.

Nisal

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
zambrano.luigi
Senior III

Hi,

I guess that you have configured the pin PE11 (GPIO75) because it is connected with the LED D13. So, I think the aim of the test is to see the LED D13 blinking. Let me underline that the behavior of the function pal_lld_writepad is exactly what expected. The first istruction in the cycle

pal_lld_writepad(PORT_E, PIN_GPIO75, PAL_HIGH);

will switch-off the LED D13, while the second instruction

pal_lld_writepad(PORT_E, PIN_GPIO75, PAL_LOW);

will switch-on the LED13.

If you want to see the LED D13 blinking, you have to add also a delay between the switch on and the switch off. So, you have to modify the cycle as below:

for (;;) {

osalThreadDelayMilliseconds(500);

pal_lld_writepad(PORT_E, PIN_GPIO75, PAL_HIGH);

osalThreadDelayMilliseconds(500);

pal_lld_writepad(PORT_E, PIN_GPIO75, PAL_LOW);

}

Moreover, please, remember to close the jumper JP14 that connect the LED D13 to the power.

Regards,

Luigi

View solution in original post

6 REPLIES 6
zambrano.luigi
Senior III

Hi,

please, could you share an example of code and clarify the expected behavior?

Regards,

Luigi

Hi Luigi,

Attached here with is the project.

Nisal

zambrano.luigi
Senior III

Hi,

I guess that you have configured the pin PE11 (GPIO75) because it is connected with the LED D13. So, I think the aim of the test is to see the LED D13 blinking. Let me underline that the behavior of the function pal_lld_writepad is exactly what expected. The first istruction in the cycle

pal_lld_writepad(PORT_E, PIN_GPIO75, PAL_HIGH);

will switch-off the LED D13, while the second instruction

pal_lld_writepad(PORT_E, PIN_GPIO75, PAL_LOW);

will switch-on the LED13.

If you want to see the LED D13 blinking, you have to add also a delay between the switch on and the switch off. So, you have to modify the cycle as below:

for (;;) {

osalThreadDelayMilliseconds(500);

pal_lld_writepad(PORT_E, PIN_GPIO75, PAL_HIGH);

osalThreadDelayMilliseconds(500);

pal_lld_writepad(PORT_E, PIN_GPIO75, PAL_LOW);

}

Moreover, please, remember to close the jumper JP14 that connect the LED D13 to the power.

Regards,

Luigi

HI Luigi,

I am extremely sorry, I missed that part. It is working fine now. Thank you for your help.

I have another question regarding using unions in SPC5. Does the SPC5 micro controllers follow big endian format or

little endian format?

Nisal

zambrano.luigi
Senior III

Hi Nisal,

the SPC5 micros are big endian.

Regards,

Luigi

PSeka.1
Associate II

Hi Luigi,

i m working on SPC560CL3 MCU. Is it possible to change big endian to little endian?

thanks and regards

prabu.s