How do you read multiple GPIO bits into a single variable?
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?
Answers
-
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:
The resulting diagram looks like this:
If your bits aren't all contiguous, then you can combine smaller bit segments using shift and or blocks.
0