[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Connecting AD-Converter to syncser0



Hi again :-)

Another problem is that the 12 bits received will stay in the 
FIFO. The FIFO is not flushed until 32 bytes have been read.
There are two solutions to this problem:

1. Disable the DMA config option
2. Add a timer that flushes the DMA at a regular interval (as
in the async serial driver). I have not added a flush timer
to the sync serial driver because in most cases there is a
continuous stream of data received and then there is no need
to flush the DMA.

Best Regards
/Mikael

-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
Behalf Of Claudius Moor
Sent: Friday, July 06, 2001 10:48 AM
To: dev-etrax
Subject: Connecting AD-Converter to syncser0


Hi all,

I am trying to connect an AD-Converter (MAX1202) over SPI to syncser0.
For this purpose, I recompiled the kernel with "SyncSer0+DMA enabled". I
also added an argument (SPI_MBIDIR) to the synchronous serial driver
(sync_serial.c), which sets the port in MASTER_BIDIR mode when calling
ioctl(fd, SSP_SPI, SPI_MBIDIR).

Now, after writing config-data (8 Bit; 0xff for CH7 and external clock
mode) to syncser0, my AD-converter initializes correctly and sends 12
bits back to my Dev.Board_lx. The problem is, that I cannot read those
bits. I am only able to read bits (not the correct values), when setting
DIN of the AD-converter manually "high" and /CS "low". The converter is
continuously sampling data and sending on DOUT then.

Clocking a control byte into DIN starts conversion on the MAX1202. With
/CS low, each rising edge on SCLK clocks a bit from DIN into the
internal shift register. After /CS falls, the first logic "1" bit
defines the control byte's MSB. In external clock mode, the SSTRB output
pulses high for one clock period before the most significant bit of the
12-bit conversion result shifts out of DOUT.

I connected the AD-converter to the dev.board as follows:

Dev.Board             AD-Converter
==================================
  rxd1 (X25/1)	   <-     SSTRB
  /cts1(X25/4)     <-     DOUT
  txd1 (X25/2)     ->     CLK
  /rts1(X25/3)     ->     DIN
  pb4  (X4/7)      <-     /CS


Does anyone out there know how to set up syncser0 so that I can read my
AD-converter?

I'm using kernel-2.4.3, Cris compiler 1.11 and Devboard_lx 1.0.0.
I also attached my application spi.c. It opens syncser0, writes the
control byte and tries to read the sampled value.

Many thanks in advance.

Claudius

__