Re: [Amforth] Need some help with the SPI

2019-06-09 Thread Ian Jefferson
What a nice RTFM! I have some fond memories of working with a capable C programmer on an Atmel Butterfly as a platform.  I relied heavily on the data sheet to understand the capability of the ATmega169 at the time and several times was able to identify paths forward by doing so. We were squeez

Re: [Amforth] Need some help with the SPI

2019-06-09 Thread Erich Wälde
Dear Jan, allow me to observe the following things: > // enable SPI.Master > SPI.setDataMode(SPI_MODE0); > SPI.setBitOrder(MSBFIRST); > SPI.setClockDivider(SPI_CLOCK_DIV4); > SPI.begin(); The words and the concepts behind them are documented in great detail in the datasheet of your contr

Re: [Amforth] Need some help with the SPI

2019-06-09 Thread Peter C. Hauser
Dear Jan, spi.setmode is used to set one of the 4 SPI modes 0, 1, 2, or 3, e.g. "1 spi.setmode". The mode to use depends on the device you want to connect to, and you will find it in the datasheet (perhaps not explicitely stated, but the necessary information will be there). Most common is 0.

Re: [Amforth] Need some help with the SPI

2019-06-09 Thread Jan Kromhout
Dear Peter This is the code I need to model in amForth // enable SPI.Master SPI.setDataMode(SPI_MODE0); SPI.setBitOrder(MSBFIRST); SPI.setClockDivider(SPI_CLOCK_DIV4); SPI.begin(); What to do with \ check SPI device datasheet for mode settings : spi.setmode ( spi-mode -- ) spi.mode pin