Other Parts Discussed in Thread: PGA900
Tool/software: Code Composer Studio
I am trying to communicate with the pga90 using I2C to read PADC values.
In the COMBUF interrupt service routine (COMBUF_Handler(void)?) I would like to read COM_DIF_TO_MCU data from the master, interpret it, read the register of interest (PADC), then make it so that the pga900 periodically updates the COM_MCU_TO_DIF.
I am trying to get this data for PADC_DATA1 & PADC_DATA3 then periodically write this to COM_MCU_TO_DIF (24-bit mode, PADC_DATA1 is LSbyte and PADC_DATA3 MSbyte)
I would like to have a function for example:
void readPADC_DATA1 (UC PADC_DATA1)
{
(????????) // This is what I am not sure I need to fill in to get a function that reads the PADC_DATA1 & PADC_DATA3
}
Which I can then call in the COMBUF interupt service routine so that my I2C master can read:
ADCMSByte = readPADC_DATA1 ()
COM_MCU_TO_DIF_write(ADCMSByte);
The reference code has all these below but I am not sure which one actually contains the ADC values that I can update the COM_MCU_TO_DIF with so that my I2C master can read. Sorry I am a beginner so It is not so obvious for me!
#define PADC_DATA1 (*((VUC *)0x40000520)), #define PADC_DATA3 (*((VUC *)0x40000522)),
#define PADC_DATA (*((VS2 *)0x40000520)), #define PADC_DATA_24BIT (*((VSL *)0x40000520))
VS2 ADC_PchannelValue; /* PADC Value */ & interrupt void PADC_Handler(void)