This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to set/reset/read a non-GIO-Pin on RM48L952?

Other Parts Discussed in Thread: HALCOGEN

Hi,

I need to use several pins which are not part of the GIO-Ports as output and perhaps as (not interrupted) input. How can I change/read the pin state?

For excample: we do not need to use SPI1-ENA-Pin function. So i used HALCoGen, went to "SPI1->SPI1 Port" and selected "ENA Pin Mode" to be "GIO". How can I set the ENA-Pins state to high/low and how can I read the pins state?

Thanks for answer.

Regards,

Frank

  • Frank,,

    You need to follow the following steps.

    (1) Set up ENA pin as GIO in SPIPC0 register (0x14). You are doing it via HALCoGen.

    (2) Set up ENA pin as GIO input or output in SPIPc1 register (0x18)

    (3) If the pin the configured as input, you can read the pin state from the SPIPC2 register (0x1c)

    (4) If the pin is configured as output, there are two ways to control the pin state.

          1. Write to SPIPC3 register (0x20). You will need to a read-modify-write operation so that the states of other pins are not affected.

           2. Use SPIPC4 and SPIPC5 registers. Writing a "1" to the related bit in SPIPC4 will set the pin high. Writing "1" to SPIPC5 will set the pin low. Writing "0" has not effect.

    Thanks and regards,

    Zhaohong