Hello, im trying connect the ADD7734 to a Dspic30F6012A microcontroller, but i have not sucess. The problem is the ADC never initialize because when i read the default value of a register i got something are not be default and the MOSI are everytime the same value 0XFF and i don´t know why. To communicate with AD7734, i use the library of the ADC but to work with the SPI of DSPIC30F these library was changed. To build the code i used the specs of acess the registers of AD7734:
I use the channel1, AN1 to measure a range voltage between -10 to 10 V.
-12 Mhz Max conversion Time Rate
Timing Specifications :
-Read Op /CS Falling Edge to SCKL Falling Edge Setup Time
-Read at high SCKL
Write Operations :
- Data Valid to SCLK Rising edge Setup Time
/* Config. Registers */
- Mode Register:
MD - 001 : Continuous Conversion Mode : After the conversion is complete, the relevant channel data register and channel status register are updated, the relevant RDY bit in the ADC status register is set, and the AD7734 continues converting on the next enabled channel.
CLKDIS - 0
DUMP - 1 : the DUMP bit is set to 1, the channel status register will be followed immediately by a
read of the channel data register regardless of whether the status or data register has been addressed through
the communication register. The continuous read mode will always be dump mode reading of the channel status
and data register, regardless of the dump bit value
CONTRD - 1
24 bit - 1
CLAMP - 1
- Communications Register : AD7734_REG_COMM Address 0x00
Write Comm. Register
Write Mode. Register
Write Comm. Register
- Conversion On CH1 Complete
Read CH1 Status
Read CH1 Data
- Channel Setup Registers channel 0-3 (4) Channel1 - 29h
00001000b - 08h
7-5 bit : 0
Stat OPT: 0
ENABLE : 1
2 bit : 0
1 -0 bit : 00 ( +/- 10v )
- Communications Register (Add 00h)
/* Address specifying to which register the read or write operation will be directed! */
7 : 0
6 : R = 0 ; W = 1
[5-0] : Address ---001 (ANI1)
CH1 Address 0x09
0101001 - 0x29
- Channel Data (08h-B0h) default 8000h - Channel1 09h
- ADC Status Register - 00000010 (RDY1)
In conversion modes, the register bits reflect the individual channel
status. When a conversion is complete, the corresponding channel
data register is updated and the corresponding RDY bit is set to 1.
When the channel data register is read, the corresponding bit is
reset to 0. The bit is also reset to 0 when no read operation has
taken place and the result of the next conversion is being updated
to the channel data register. Writing to the mode register resets
all the bits to 0
SPI ( DSPIC30F Microchip)
The SPI serial port consists of the following Special Function Registers (SFR):
- SPIxBUF: Address in SFR space that is used to buffer data to be transmitted and data that
is received. This address is shared by the SPIxTXB and SPIxRXB registers.
- SPIxCON: A control register that configures the module for various modes of operation.
- SPIxSTAT: A status register that indicates various status conditions.
Someone can help me? I put the code here and a printscreen of the logic analyzer.