Hi all,
i am a beginner and i try to communicate with both, an EEPROM and a CAN Controller.
My Problem is:
I need to send more than 8 Bits via the SPI within one clocking cycle, i.e. 8 bits command + 8/16 bit address.
I checked my code with an osci and I can see, that only USISRL is sent, instead of the whole USISR register.
Can anyone find the mistake in my code???
Code example:
void initialize_usi(void)
{...
USICTL0 |= USIPE7 + USIPE6 + USIPE5 + USIMST + USIOE + USISWRST;
USICTL1 |= USIIE + USIIFG +USICKPH ;
USICKCTL |= USIDIV_4 + USISSEL_2 ;//+ USICKPL;
USICNT = USI16B ;
USICTL0 &= ~USISWRST;
}
void main(void)
{
...
USISR = 0x030E; // 03 is the read status register command, 0E the address
USICNT = 24;
while (!(USIIFG & USICTL1)) {} ;
...
}
Thanks a lot,
regards
Marcus