
Originally Posted by
drlava
First off, are you sure your galvos are tuned optimally? Do you have a computer controlled DAC with which you can display the ilda test frame (or load it onto your micro).?
I really have no idea unfortunately. I bought them from Dave at Lasershowparts. I kind of assumed (bad idea come to think of it) they would be tuned pretty well, or they would be blatantly out of tune.
No computer controlled DAC available i'm afraid. I did load a couple of test frames that Steve suggested onto the micro, there's a pic of the output a couple of posts back.
I'm not running any timing either, however the loops are all exactly the same. Each point in each character is being sent to the DAC after the same number of clock cycles. I think the only variable in timing will be the latching time for the DAC - i.e. the DAC will latch earlier for a smaller voltage swing.
Between the characters there will be a bit of a longer break however. I've attached the code below in case it helps anyone:
Code:
int maxt = maxDAC12; // the maximum number for the function variable used by the horiz. & vert. DACs
// (should match the number of possible outputs of each DAC, to allow a 1:1 relation)
unsigned short int tot_points1 = 190;
unsigned short int tot_points2 = 243;
unsigned short int tot_points3 = 182;
unsigned short int tot_points4 = 393;
unsigned short int point_num = 0;
unsigned short int delay_time2 = 0;
unsigned short int delay_time1 = 50;
const unsigned short points1[190][2] = {
// points go here
};
const unsigned short points2[243][2] = {
// points go here
};
const unsigned short points3[182][2] = {
// points go here
};
const unsigned short points4[393][2] = {
// points go here
};
void main(void)
{
P5DIR |= 0x02; // Set P5.1 to output direction
P6DIR |= 0x03; // set P6.1 & P6.2 to output
P6OUT &= 0x0C; // Set P6.1 & P6.2 to low
ADC12CTL0 = REF2_5V + REFON; // Internal 2.5V ref on
TACCR0 = 13600; // Delay to allow Ref to settle (delay of approx 13ms = 13600/SMCLK)
TACCTL0 |= CCIE; // Compare-mode interrupt.
TACTL = TACLR + MC_1 + TASSEL_2; // up mode, SMCLK
__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, enable interrupts
DAC12_0CTL = DAC12IR + DAC12AMP_7 + DAC12ENC; // Int ref gain 1
DAC12_1CTL = DAC12IR + DAC12AMP_7 + DAC12ENC; // Int ref gain 1
DAC12_0DAT = 0x0000;
DAC12_1DAT = 0x0000;
while (1)
{
P5OUT ^= 0x02; // Toggle an LED (heartbeat)
do{
point_num++;
DAC12_0DAT = points1[point_num - 1][0];
DAC12_1DAT = points1[point_num - 1][1];
}while(point_num != tot_points1);
point_num = 0;
do{
point_num++;
DAC12_0DAT = points2[point_num - 1][0];
DAC12_1DAT = points2[point_num - 1][1];
}while(point_num != tot_points2);
point_num = 0;
do{
point_num++;
DAC12_0DAT = points3[point_num - 1][0];
DAC12_1DAT = points3[point_num - 1][1];
}while(point_num != tot_points3);
point_num = 0;
do{
point_num++;
DAC12_0DAT = points4[point_num - 1][0];
DAC12_1DAT = points4[point_num - 1][1];
}while(point_num != tot_points4);
point_num = 0;
}
}