Hi Community,
I am working on S32K118 eval board, I need to get the status of each pin, can you please help me to know whether I can get this using PINS_DRV_Readpins command and how to obtain the output.
Thank You
Hi Community,
I want to read the status of each pins of every port, I used PINS_DRV_READPINS function, but I am not getting the required result, can you please help me with this. I am attaching the part of the code as reference, kindly let me know where I am getting it wrong. I want to print the value of the returned by this function on the console.
Thank You
Are you able to read the state of a pin in the last reply?
May I ask if the problem you are encountering now is that PINS_DRV_READPINS cannot read the correct value, or the correct value cannot be send out through LPUART?
Hi Robin,
Thank you for your reply, I am unable to read out the value through LPUART, is there a way to get that value displayed through UART. Kindly let me know about this. I had attached the code I m using to read the value, please let me know whether it is the proper method.
If the PINS_DRV_ReadPins able to get the correct status of PORT, and the issue is iota can not convert to decimal. Then would you please submit a new question in S32 Design Studio, maybe IDE experts can help you solve the iota problem.
Hi Robin,
Thank you for your reply, will post it there.
Hi abhinandan,
Although the description of PINS_DRV_ReadPins shows: This function returns the current input values from a port. Only pins configured as input will have meaningful values.
But I think you can still read the pin state via the GPIO port data input register (GPIO_PDIR).
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Robin,
Thank You for your reply, will check this.
Hi Robin,
PINS_DRV_ReadPins function always return 1 for corresponding GPIO pin which is configured as input or else always return 0 if configured as output. Is this correct? For input configuration it didn't change the pin value to zero for short circuiting the configured pin with Ground.
How about direct read the value of GPIO_PDIR?
When pin is configured as input with internal pull down enabled, then test PINS_DRV_ReadPins.
When pin is configured as output and output high or low, then test PINS_DRV_ReadPins.
yes PIN_DRV_ReadPins function return the GPIO_PDIR value,
this is how i have read the PTC8 pin status
//Reading the input value of PTC8:
uint32_t pinstatus = PINS_DRV_ReadPins(GPIOC_PORT) >> (PTC8_INPUT) & 0x01;
Hi Robin,
This is what i want to works like push button configuration,
1.Initially PTC8 pin is in zero state value
2.When interrupt came(e.g.,PTC8 pin connecting with VCC) the value become 1.
3.When PTC8 pin connecting with GND then the value become 0.
Configure PTC8 as output, and able to see the PDIR change with toggle.
Why you configure PTC8 as input but call PINS_DRV_SetPins and PINS_DRV_ClearPins.
So you just want the external voltage connect to PTC8, and trigger PORT interrupt, then output value to other pins?
In short, you want to implement the PTC8 pin interrupt and control the output level of other pins in the pin interrupt?
Please refer the button interrupt in can_pal_s32k118 example:
Hi Robin,
Yeah this button interrupt (can_pal) code does what i need, but when i configured PTC8 pin instead of both button pin PTD3 and PTD5,interrupt is not triggered what will be the problem? Do you have any idea?
S32K118EVB Q064 or S32K118EVB2Q048 are you using?
The R683 is DNP, so the signal did not route to PORTC 8 by default.
I am able to trigger PORTC 8 interrupt, test on S32K118EVB.