sorry if this is a stupid question but can someone let me know if my thinking is right about this. basically all micros store there assigned constant or variable values as binary correct? so i can just preform simple math operations within my program then simple shift out or bit bang that value out with out having to convert it into a binary first correct? iam working with a simple 12 bit DAC and iam getting some output but its not close the what i thought it would be i believe it is spill over from excess bits sent then stored and when i send data again it picks up where it left off adding those excess bits in and just getting worse and worse with each cycle?
really just wondering if my math is right any help would be great thanks
In the long ago, I had a 'high end' computer sound card that was abandoned by it's makers and I needed to get it working on a system that did not exist when the card was manufactured. The problem was that the card would transfer samples to/from a 20 bit ADC/DAC but would report in it's registers a 24 bit word or three bytes. And more annoyingly the nibbles (four bits) were scattered all over the place in those three bytes or six if it was stereo.
The solution was to feed good, clean sine waves, square waves and triangular waves into the ADC and try and generate the same on the output connected to a scope. For an arduino, I'd suggest you hard code a nice waveform and get the device to repeat it over and over while looking at the scope to see what is wrong.
-facepalm-
Sorry. Wow. Why did I just make that so complicated?
Just hard-code all of the 12 bit 'ones' and configure a button press on the arduino to cycle through all twelve of them. And make note of each result. Eventually something in the code should jump out at you.
And yes, please post us some code. Inquiring minds want to know.