Arduino SPI w/ two slave devices
hi,
i working on project uses 12-bit adc (intersil isl26321) , 10-bit dac (microchip mcp4911), both on spi interface. have written code interface w/ both devices independently works fine have run problem when combining 2 pieces of software interface both devices in sequence.
i have written subroutines communicating w/ both devices there sort of "cross talk" between them resulting in corrupt data to/from both devices.
the code written returns adc values between 0 , 3 on serial monitor when result should 1000 (1v using 4.096v reference). oscilloscope confirms there no data returned adc. clock , cs both appear correct.
if comment out 2 spi.transfers in lp_bias(), adc results correct.
if leave spi.transfers in , instead comment out call lp_bias(i) in loop, results 2.5 times higher should be. oscilloscope confirms data line returning larger number should. clock , cs still correct.
the swept voltage produced dac appears noisy when adc code included.
i appreciate if @ attached code , give me hint doing wrong.
thank you,
greg
i working on project uses 12-bit adc (intersil isl26321) , 10-bit dac (microchip mcp4911), both on spi interface. have written code interface w/ both devices independently works fine have run problem when combining 2 pieces of software interface both devices in sequence.
i have written subroutines communicating w/ both devices there sort of "cross talk" between them resulting in corrupt data to/from both devices.
the code written returns adc values between 0 , 3 on serial monitor when result should 1000 (1v using 4.096v reference). oscilloscope confirms there no data returned adc. clock , cs both appear correct.
if comment out 2 spi.transfers in lp_bias(), adc results correct.
if leave spi.transfers in , instead comment out call lp_bias(i) in loop, results 2.5 times higher should be. oscilloscope confirms data line returning larger number should. clock , cs still correct.
the swept voltage produced dac appears noisy when adc code included.
i appreciate if @ attached code , give me hint doing wrong.
thank you,
greg
first of all, stop stupid texting , write full words please.
second, why mix normal port functions direct port manipulation?
third, can post schematic? both have separate cs/ss?
and timing critical need mix asm nop commands?
second, why mix normal port functions direct port manipulation?
third, can post schematic? both have separate cs/ss?
and timing critical need mix asm nop commands?
Arduino Forum > Using Arduino > Programming Questions > Arduino SPI w/ two slave devices
arduino
Comments
Post a Comment