comparison pru_rtaudio.p @ 13:6adb088196a7

Fixed ADC bug; added a simple passthrough test
author andrewm
date Fri, 23 Jan 2015 15:17:09 +0000
parents a6beeba3a648
children 670be80463a3 0d80ff9e2227
comparison
equal deleted inserted replaced
12:a6beeba3a648 13:6adb088196a7
670 DAC_WRITE r7 670 DAC_WRITE r7
671 671
672 // Read ADC channels: result is always 2 commands behind 672 // Read ADC channels: result is always 2 commands behind
673 // Start by reading channel 2 (result is channel 0) and go 673 // Start by reading channel 2 (result is channel 0) and go
674 // to N+2, but masking the channel number to be between 0 and N-1 674 // to N+2, but masking the channel number to be between 0 and N-1
675 LDI reg_adc_data, 0
676 ADD r8, r1, 2 675 ADD r8, r1, 2
677 SUB r7, reg_num_channels, 1 676 SUB r7, reg_num_channels, 1
678 AND r8, r8, r7 677 AND r8, r8, r7
679 LSL r8, r8, AD7699_CHANNEL_OFFSET 678 LSL r8, r8, AD7699_CHANNEL_OFFSET
680 MOV r7, AD7699_CFG_MASK 679 MOV r7, AD7699_CFG_MASK