Other Parts Discussed in Thread: PGA308
Hi,
I'm trying to program PGA308 with 1W UART with a PIC32, but it isn't working. I don't understand why. I had checked the signal in the input of PGA with oscilloscope and it is correct.
Please someone help me.
This is code where I send the program byte to PGA308:
// Set Fine offset 0
U1TXREG = 0x55;
U1TXREG = 0x00;
U1TXREG = 0x00;
U1TXREG = 0x00;
while(!U1STAbits.TRMT);
Delay1ms();
// Set GDAC 1
U1TXREG = 0x55;
U1TXREG = 0x01;
U1TXREG = 0xFF;
U1TXREG = 0xFF;
while(!U1STAbits.TRMT);
Delay1ms();
// Set OG 2, PGA 100, COA 0
U1TXREG = 0x55;
U1TXREG = 0x02;
U1TXREG = 0x00;
U1TXREG = 0x14;
while(!U1STAbits.TRMT);
Delay1ms();
// Set CFG1
U1TXREG = 0x55;
U1TXREG = 0x03;
U1TXREG = 0x80;
U1TXREG = 0x01;
while(!U1STAbits.TRMT);
Delay1ms();
// Set CFG2
U1TXREG = 0x55;
U1TXREG = 0x04;
U1TXREG = 0x00;
U1TXREG = 0x40;
while(!U1STAbits.TRMT);
Delay1ms();
// Set CHKS
/*
ZDAC+GDAC=FFFF
FFFF+1=0001
0001+CGO=1401
1401+CG1=1581
1581+1=1582
1582+CG2=5582
5582+1=5583
!5583=AA7C
*/
U1TXREG = 0x55;
U1TXREG = 0x05;
U1TXREG = 0x7C;
U1TXREG = 0xAA;
while(!U1STAbits.TRMT);
Delay1ms();
//
U1TXREG = 0x55;
U1TXREG = 0x86;