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.

TMS320F28015. I/O port bit testing

What is the preferred method(s) for code efficiency for testing an I/O port to see if it is high or low? I will need to continually poll various I/O ports to check and see if its a 1 or 0. Then reset the program counter. 

 

 

  • Mark,

     

    What method are you currently using to read the ports? The GPxDAT registers can be read as a whole or bit wise. If you are reading multiple ports it would be more efficient to read the entire GPxDAT register all at once instead of multiple lines of single reads. You can see more about the GPxDAT registers in Chapter 4 of the System Control and Interrupts Reference Guide located at:

     

    http://focus.ti.com/lit/ug/spru712g/spru712g.pdf

     

    Hopefully this helps.

     

    Regards,

     

    Tim Love

    MCU Applications

     

  • Thanks for the reply.  Looks like I will be reading the I/O ports bit wise at this point in time. I will be single reading 1 I/O port, then another to make a decision. Then poll other I/O ports that if their state changes from an external source to reset the PC to 0. What assembly language programmers guide is available to assist in code generation? I have SPRU513 and SPRU430. Any others?

  • These all the correct documents for assembly language programming. Another suggestion is to use the Header Files and Peripheral Examples package and manipulate the IOs in C. You can then look at the generated assembly for manipulating this IO.

    Regards,

    Tim Love