المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : mr. Abu hatem important????



maxdevil30
21-06-2011, 07:07 PM
hi Abu hatem i read your subject a bout changing the serial of microbox and i ask my brother in swiss to help me if he know the program that you attache it and he send me the way but i cant understand it well so i will give to you maybe it will help you here is it:

How to use SPI driver

****************************** ****************************** ****
1. Introducation
****************************** ****************************** ****

SPI is a serial transfer protocol. It has four interface signals:
MISO, MOSI, SCLK, and SPISS. The first two signals are data signals,
SCLK is clock signal, and SPISS is chip select signal.

ADSP21535 has two SPI ports, and can generate 7 chip select signal
when acting as master. Please refer to Analog Device datasheet for
details.

The two SPI ports can be operated by open /dev/spi0 and/or /dev/spi1.

When SPI sends a word, it receive a word at the same time. So, the
number of SPI receiving must equal to number of sending.

If SPI want to read(receive) data, it must write(send) data firstly.

****************************** ****************************** ****
2. Act as master
****************************** ****************************** ****
Before open driver, first make clear whether chip select signal is
used or not, if used, which chip select signal is used. For example,
CS 3(SPIxSEL3) is connected with SPI slave's SPISS.

i. open /dev/spi1 (spi0 is connected with SROM)
ii. ioctl CMD_SPI_OUT_ENABLE, so MISO is in normal state.(else
it is in open drain state.
iii. 'ioctl' "CMD_SPI_SET_BAUDRATE", set SCLK's baud rate. If you
write a short value "0xabcd", the baud rate is SCLK/(2*0xabcd).
iv. ioctl' "CMD_SPI_SET_CSENABLE", arg is 3.
v. 'ioctl' "CMD_SPI_SET_CSLOW", arg is 3.
vi. 'ioctl' "CMD_SPI_SET_MASTER", SPI acts as master.
vii. 'ioctl' "CMD_SPI_MISO_ENABLE", master can receive data.
viii. 'write' a word, or data buffer to SPI driver.
ix. 'read' a word, or data buffer from SPI driver.
x. 'close' close SPI driver when finish operating.

****************************** ****************************** ****
3. Act as slave
****************************** ****************************** ****
The sequence is similar with master mode.

i. 'open' "/dev/spi1" (spi0 is connected with SROM)
ii. 'ioctl' "CMD_SPI_OUT_ENABLE", so MISO is in normal state.(else
it is in open drain state).
vi. 'ioctl' "CMD_SPI_SET_MASTER", arg 0, SPI acts as slave.
vii. 'ioctl' "CMD_SPI_MISO_ENABLE", slave can send out data.
vii. 'write' a word, or data buffer to SPI driver.
viii. 'read' a word, or data buffer from SPI driver.
ix. 'close' close SPI driver when finish operating.

****************************** *******
***************************

1

----------------------- Page 2-----------------------

3. SPI transfer format
****************************** ****************************** ****
SPI can operate in 8 bits, or 16 bits, in active high, or low,..
User application can use ioctl to set data format before beginning
read or write.
Master and slave must keep in same format.

ioctl CMD_SPI_SET_POLAR arg 1: active low 0: active high
ioctl CMD_SPI_SET_PHASE arg 1: toggle from beginning 0: toggle
from middle
ioctl CMD_SPI_SET_RECVOPT arg 1: Flush old da

ابو حاتم-
21-06-2011, 07:23 PM
نعم اخي الكريم بخصوص هذا البرنامج جاري العمل باذن الله على ايجاده لكي يتعامل مع اللودر الخاص بتغير السيريل وتحميله كونه حجمه كبير وعندي معلومات حوله والى الان لم اجد موقع صيني رافعه على روابط لكي افحصه واجربه