2021-02-16 08:03 PM
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
Solved! Go to Solution.
2021-02-21 10:37 PM
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
2021-02-19 04:17 AM
Hi,
please, could you share an example of code and clarify the expected behavior?
Regards,
Luigi
2021-02-19 09:35 AM
2021-02-21 10:37 PM
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
2021-02-23 11:54 PM
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
2021-02-24 12:42 AM
Hi Nisal,
the SPC5 micros are big endian.
Regards,
Luigi
2022-01-28 04:40 PM
Hi Luigi,
i m working on SPC560CL3 MCU. Is it possible to change big endian to little endian?
thanks and regards
prabu.s