🎉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 I use GPIO to write to 12-bit DAC?

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

Submitted by Viswanathan on Mon, 06/29/2009 - 20:36 

I need to send out 2 different signals of 12 bits each. Just for testing I have connected both outs to the same signal for testing.
I dont know how to setup uni-polar or bi-polar.
My signal will be from say -3 to +3. I expect -3 to give 0x0000 and +3 to be 0xFFF

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 pete on Mon, 06/29/2009 - 20:41.

    VisSim supports contiguous bit access on GPIO read or write, so just setup the digital out block to use the bits you want, and create a transform to map from +/-3 to 0 to 0xFFF. The key to the transform is to scale the +-3 input to 0-8 in a fx4.16 scaling, then using the VisSim fixed-point shift block to give a right adjusted 12-bit result. I have attached a simulation and an embedded diagram to illustrate this.

    Unable to find an attachment - read this blog