SPI interface

Thread Starter

alkid

Joined Sep 20, 2007
12
Hi
To put the sck to logic 1 or 0 do i use the congfigure wizard to set it or i have to wrote the source code for it :confused: And what is CKPOL and CKPHA are they just logic 1 or 0 setting? And do anyone try or how to use the the C8051F120DX SPI interface to connect the SPI interface of the nRF24L01? tks :)
 

Papabravo

Joined Feb 24, 2006
21,157
In a hardware SPI interface there is nothing that you need to do to control SCK(SPI Serial Clock). You do need to make sure that the pin can output SCK and is not trying to do some alternate function.

CKPOL and CPHA are a pair of configuration bits that control the idle level of the clock and which edge is used to clock data in and out. You set these bits to match the peripheral that you are trying to talk to. Most competently written datasheets will tell you in words or in pictures what these bits need to be. It is possible that a single system with multiple SPI devices will require different settings.

Once the SPI port is configured the clocks are generated automatically when the SPI Data register is written. You have to write some data in order to read some data. Slave devices can't speak unless they are spoken to.
 

Papabravo

Joined Feb 24, 2006
21,157
OK. So you have a program, which you call a wizard, that configures something. What are the inputs to the program? What are the outputs of the program. In order to use the "wizard" you need to have some idea of how an SPI interface works. Do you have this understanding? In order to use the outputs of this program you must have some idea what to do with them. Do you know what to do with the outputs.

More questions. Is this wizard part of a larger software package or is it a stand alone program? What platform is this programm running on? Is the documentation for the wizard available online so we can read it and try to see things from your perspective.

You seem to give us credit for having far more information and insight then we actually have. I still don't understand what your root problem is.
 

nanovate

Joined May 7, 2007
666
The OP is referring to the Config program that comes with the Silabs development tools.

In order to use the "wizard" you need to have some idea of how an SPI interface works.
I agree. All the this program does is provide a GUI frontend to click-set certain config bits and it auto generates code for you. You still need to know what you are doing and there is no guarantee that you have not enabled two functions on the same IO pin.

The Config or Config2 tool is no substitute for reading the datasheet.
 
Top