Code: Select all
int i;
char channel;
dac.LDAC <: 0;
dac.CS <: 1;
dac.WR <: 0;
while (1) {
for (i = 0; i < SINE_TABLE_LENGTH; i += INCREMENT) { //INCREMENT = 155, length = 16383
#pragma loop unroll
for (channel = 8; channel < 15; channel++) {
dac.chanSelect <: (channel);
dac.data8 <: sin8[i];
dac.data4 <: sin4[i];
dac.CS <: 0;
dac.CS <: 1;
}
}
}
I tried generating 2 different tables of unsigned char to pre-compute the bit mask/bit shift, but for some reason, the DAC would just stay at a single value.
Any help would be appreciated!
EDIT: Realized I don't need the clock stuff since i'm just using it at 100 MHz anyway.
EDIT: Updated code, still only getting 105 points per period.