3 Replies Latest reply on Jan 27, 2014 10:09 AM by asha.ganesan

    Switching the connection of a GPIO between different sources using HSIOM register

    asha.ganesan

      Hi All,

         

      Many of us may not be aware of the tips and tricks achievable using HSIOM (High Speed I/O Matrix) register in PSoC 4. I have attached a demo project which demonstrates how to switch the connection of a GPIO between different sources through firmware.

         

      To add a footnote to this demo project, connection of a GPIO to Analog Mux makes use of Digital System Interconnects (DSI). Hence it is not straight forward to switch the connection of a GPIO between Analog Mux and any Digital block. However, in this project we have made use of Capsense dedicated routing for Analog Mux and have DSI dedicated for connecting GPIOs to UDBs.

         

      I hope it is useful to you.

         

      Regards,
      Asha

        • 1. Re: Switching the connection of a GPIO between different sources using HSIOM register
          sebastian.seczkowski

          Looks You are the only specialist for these kind of problems related to PSOC4.

             

          I've already waiting for response several days.

             

          So could You explain me how to switch comparator input to digital output and drive sth from firmware if HSIOM reg is 0?

             

          Second:

             

          My pin is sourced from Clock. Why HSIOM is 0 again?

             

          Could You extend Your project for such functionality, please?

             

          You will help not only me, but also all guys from CYpress support team.

          • 2. Re: Switching the connection of a GPIO between different sources using HSIOM register
            sebastian.seczkowski

            To make things more clear reg 0 means pin if driven from firmware ( in fact it's analog input).

               

            When I change HSIOM to dig. out  and back to analog it never goes back to analog anymore.

               

            WHat should I change is HSIOM reg was 0 initially. And Port_0 ( where pin belongs to) is not set in cyfitter.cfg?

            • 3. Re: Switching the connection of a GPIO between different sources using HSIOM register
              asha.ganesan

              Hi Sego,

                 

              I extremely apologize for the delay.

                 

              If you would like to configure a pin to be muliplexed between analog input and a digital output, you must first enable both analog and digital terminals in the pin configuration dialog box. Any input to comparator has to be routed through AMUXBUS A or AMUXBUS B line and hence the HSIOM register value for that port pin should either be 0x6 or 0x7. If you would like to connect it as a digital output (firmware controlled), just change the HSIOm register value to be 0x0. Also please note that when you are switching a GPIO between different sources like this, it is highly recommended to tape out the Output Enable (OE) terminal of the "pin" component and connect it to logic 1.

                 

              If the default value of the comparator's input is appearing as 0x0, kindly let us know. Ideally it shouldn't happen.

                 

              Regards,
              Asha