microcontroller - SPI not working properly with high micocontroller speed -
i interfacing spi based sensors msp430 micro controller. problem :
the micro controller operating @ 20mhz , spi clock 1 mhz.
when reducing speed of micro around <4 mhz interface working fine, when increase , junk data spi slave.
what precautions need take handle these kind of problems.,
on msp430, 1 uses usci peripheral in spi mode run interface. peripheral allows selecting source of clock generated spi master controlling divide down of clock match clock rate accepted spi slave. check out ucsselx bits in ucaxctl1 register. depending upon clock source selected, may need prescale generated clock using usci_ax bit rate control registers. sounds question running spi on smclk no prescaling. explain why reducing cpu frequency makes spi peripheral work. better off system point of view keeping smclk @ high frequency , prescaling spi master clock match limits of attached peripheral.
deciding how clocks used system issue. need consider source of clocks, i.e. aclk or smclk, , limits of attached peripherals. should tell how may need prescale higher speed clocks (i.e. smclk) match limitations of spi slave. complicated enough have draw out make sure can meet peripheral requirements.
Comments
Post a Comment