Post Go back to editing

how i can verify my read function for ADF4159 device?

Category: Software
Product Number: ADF4159
Software Version: Cross Core Embedded Studio

void SpiRead(void)
{
int i;
*pPORTB = *pPORTB & ~(1 << 10);// TxData = 0
*pPORTB = *pPORTB & ~(1 << 12);// CLK =0
*pPORTB = *pPORTB | (1 << 9);// LE = 1

*pPORTB = *pPORTB | (1 << 10);// TxData = 1

for(i = 36; i >= 0 ; i--)
{
*pPORTB = *pPORTB | (1 << 12);// CLK = 1
*pPORTB = *pPORTB & ~(1 << 10);// TxData = 0

printf("%d",(*pPORTB >> 14) & 1);
//arr[i] = ;
*pPORTB = *pPORTB & ~(1 << 12);// CLK = 0
}

//*pPORTB = *pPORTB & ~(1 << 12);// CLK = 0
*pPORTB = *pPORTB & ~(1 << 9);// LE = 0
}



my write function is able to write data on ADF4159 that i have configure.but when i will call My read function that time im getting output = 0x00000000 from ADF4159 device . during this read call my clock pin is giving proper pulses that i have check .MUXOUT pin is giving proper pulses im not able to understand whether my read function is working proper or not?
[edited by: paija at 10:00 AM (GMT -5) on 13 Jan 2023]
Parents Reply Children