Jump to content

AOUT LC Resolution


Calphool

Recommended Posts

Hello, I built an AOUT LC (used resistor networks for the 10k resistors rather than a bunch of discretes). I'm really confused on what happens when I use the function AOUT_Pin16bitSet(). For example, my expectation is that if I call AOUT_Pin16bitSet(0,32767), I'd see +5v on all the data output pins of the two 74hc595 chips, but instead the lower 3 of the second chip are zero, and the 7th pin of the first chip is 0.

That seems like some kind of bit shift / carry problem, but I don't quite understand how that AOUT_Pin16bitSet() function works. I was using AOUT_Pin7bitSet successfully, but since that's only 7 bits, I think I'm losing one pin on each 74hc595, and I'd like to get the full 8 bits of output.

What I need is the ability to correct my pitch levels in software since the hardware I'm interfacing my AOUT LC to isn't perfectly linear in its response, but 7 bits is too coarse.

Any help someone could provide would be greatly appreciated.

--Joe R.

Link to comment
Share on other sites

a) First of all:

32767 == 0x7FFF == 0111 1111 1111 1111b

That's 15 bits not 16. Try 65535 == 0xFFFF

Make sure the variable you use is unsigned 16bits.

b) Show some source :)

c) Can you confirm all of the outputs work properly using different set functions?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...