🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

How do you read multiple GPIO bits into a single variable?

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Submitted by Joe on Thu, 02/21/2013 - 08:09 

 

We are planning on using a 16 bit external A to D converter with the 28335.
The A/D converter is a parallel interface. Is there a tutorial or example in VisSim Embedded, that shows how to read 16 individual bits and then combine them into a single variable?

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Submitted by Anders89 on Thu, 02/21/2013 - 08:22.

    Use an Embedded > Delfino > Digital/Analog Input block, and right click to configure. If they are contiguous bits, you select the start bit and number of bits. The configuration below is for 16 bits in port A starting as bit 10:

     

    DigitialIn-16Bit.png

     

    The resulting diagram looks like this:
     

    DigitialIn-16Bit-block.png

     

    If your bits aren't all contiguous, then you can combine smaller bit segments using shift and or blocks.