Hi,
I'm develop a custom board using S3A7 with part# R7FSS3A77C3A01CFB.
I configure pin P306 and pin P313 to be all output mode
Below is how I define the pin
#define PCNTR1_BASE (uint32_t)0x00010000
#define ADG1414_CS PCNTR1_BASE << 6
#define ADC_ADS1258_CS PCNTR1_BASE << 13
if I toggle P313 low using register,
R_IOPORT3->PCNTR1 &= ~ADC_ADS1258_CS_P3
then P306 will be pulled LOW and won't toggle HIGH regardless what method I'm using i.e.
R_IOPORT3->PCNTR1 |= ADG1414_CS
or g_ioport.p_api->pinWrite(IOPORT_PORT_03_PIN_06, IOPORT_LEVEL_HIGH);
However, if I use the method below
g_ioport.p_api->pinWrite(IOPORT_PORT_03_PIN_13, IOPORT_LEVEL_LOW);
to toggle pin P313 low, then P306 won't be effected. What would be the reason? I have tried on few of our boards and they all act the same. I need to use register access so the pin can toggle faster.
Thanks,
if left shift is greater than 8, be sure to cast the type (uint32_t).
#define ADC_ADS1258_CS (uint32_t)(PCNTR1_BASE << 13)
Hello Copper,
I have a suggestion based on the register description https://www.renesas.com/us/en/document/mah/s3a7-microcontroller-group-users-manual?r=1054611#G24.2215835: "A reserved bit is read as 0. The write value should be 0." And you write '1' to all bits but ADC_ADS1258_CS using this command R_IOPORT3->PCNTR1 &= ~ADC_ADS1258_CS_P3
I recommend you to use the PCNTR3 register (https://www.renesas.com/us/en/document/mah/s3a7-microcontroller-group-users-manual?r=1054611#G24.2202351) to set pins high and low if you want to operate with the registers directly
Kind regards,
Sergey
If this response, or one provided by another user, answers your question, please verify the answer. Thank you!
Renesas Engineering Community Moderatorhttps://community.renesas.com/https://academy.renesas.com/https://en-support.renesas.com/knowledgeBase/