Hey all!
I want to ask something about SPI in the firmware of AFE4490 SPO2 EVM.
So, if you see on the source code of AFE4490, there is an SPI and GPIO set function written like this:
void Set_UCB1_SPI(void)
{
P4SEL |= BIT1+BIT2+BIT3; // Set SPI peripheral bits
P4DIR |= BIT0+BIT1+BIT3; // STE, SCLK, and DOUT as output
P4DIR &= ~BIT2; // Din as input
P4OUT |=BIT0; // Set STE high
UCB1CTL1 |= UCSWRST; // Enable SW reset
UCB1CTL0 |= UCMSB+UCCKPH+UCMST+UCSYNC; // [b0] 1 - Synchronous mode
// [b2-1] 00- 3-pin SPI
// [b3] 1 - Master mode
// [b4] 0 - 8-bit data
// [b5] 1 - MSB first
// [b6] 0 - Clock polarity high.
// [b7] 1 - Clock phase - Data is captured on the first UCLK edge and changed on the following edge.
UCB1CTL1 |= UCSSEL_2; // SMCLK
UCB1BR0 = 0x01; // 8 MHz
UCB1BR1 = 0; //
UCB1CTL1 &= ~UCSWRST; // Clear SW reset, resume operation
UCB1IE =0x0;
}
I was trying to give comments on the :
P4SEL |= BIT1+BIT2+BIT3; // Set SPI peripheral bits
P4DIR |= BIT0+BIT1+BIT3; // STE, SCLK, and DOUT as output
P4DIR &= ~BIT2; // Din as input
part, so it is disable the communication with the MSP430 board (and it should goes to my board instead)
but, when i download it to the board, it also shut-ted down the photodiode LED.
I found this confusing that how come disabling the port SPI initialization also disabling the power goes to the LED?
I wonder if I missed something here and failed to notice something?
This is the link to the firmware by the way:
http://e2e.ti.com/support/applications/high_reliability/f/30/t/273490.aspx
and i was refering the function above on the AFE44X0.c
I hope someone can help me with this...
Thank you in advance!
Best Regards,
Stella