|
From: CBFalconer on 21 Jun 2008 07:10 sani_figs wrote: > > I tried connecting the pins directly and i tested it with a simple > code which fetches a single byte of data. I am getting no response > from the chip. Can this be due to the need of level translator? or > maybe because I made wrong SPI settings? I set my CPOL to 0 and > CPHA to 1, but I'm feeling that my SCLK freq is wrong also because > I used the BRH and BRL (for baud rate) settings that was used in > the sample code from zilog (controlling a DS1722 temp sensor). I > can't make out the right settings for these parameters from the > datasheet of the ADE7758. By the way, Im using a Z8F6421 MCU. What, if anything, is this about? If you want to post a followup via groups.google.com, ensure you quote enough for the article to make sense. Google is only an interface to Usenet; it's not Usenet itself. Don't assume your readers can, or ever will, see any previous articles. More details at: <http://cfaj.freeshell.org/google/> -- [mail]: Chuck F (cbfalconer at maineline dot net) [page]: <http://cbfalconer.home.att.net> Try the download section. ** Posted from http://www.teranews.com **
From: Rich Webb on 21 Jun 2008 08:14 On Sat, 21 Jun 2008 00:59:25 -0500, "sani_figs" <adrian_figui(a)yahoo.com> wrote: >Hi, I will connect my ADE7758(metering IC) to a Z8 Encore! MCU through SPI >(4pins: SCK,MISO,MOSI,CS). My problem is, although the input and output >voltage ratings of the two chips match(5-6Volts input and output), I feel >that there should be some hardware in between, meaning, I should not >DIRECTLY connect the SPI pins of the MCU to the pins of the other IC. Any >help on this matter will be well appreciated. Thanks! A series resistor on the interconnecting lines will limit the current between two pins if, during startup or initialization, you inadvertently end up with two outputs fighting each other. Generally (I'm sure there are exceptions) for microcontroller I/O pins, a power-on reset passes through a high impedance, off-bus state to a high impedance, input-port state. One typically has to explicitly configure a peripheral (e.g., SPI) to drive output pins, after the remote chip has finished its power-on routine and has settled down to the correct states. However, you can add something like a 1K series resistor to the interconnecting lines as insurance at the cost of slowing down the edges on the transitions and reducing your maximum achievable SPI clock. -- Rich Webb Norfolk, VA
From: sani_figs on 21 Jun 2008 12:11 >When I'm reading the datasheet for the ADE7758 >(http://www.analog.com/UploadedFiles/Data_Sheets/ADE7758.pdf), there are >some nice timing diagrams on page 7. Compare this to the timing diagrams of >the SPI module. Thanks Sir Frank, I'll try looking at these timing diagrams since I have noted that when reading data from the chip, there should be a 4us delay (t9 in the timing diagram) between the fetch command and the output of the data. Maybe I'm missing that part in the code. I'll try implementing that delay. :)
From: lowcost on 21 Jun 2008 17:46 Frank Buss ha scritto: > 6V looks more like absolute maximum ratings. But you can read the > datasheets to see if it works: ADE7758 says for logic inputs it needs at > least 2.4V for detecting high and no more than 0.8V for detecting low. It > outputs at least 4V for high and max 0.4V for low. The Z8 ENCORE! F0830 has > some 5V tolerant pins, low level output voltage is max 0.6V and for low > level input voltage it is max 0.3*Vdd allowed. This is 0.99V for 3.3V=Vdd, > so this works. But the high level output voltage is min 2.4V, which means > for the worst case that it doesn't work... uhm, Voh min 2.4V @ which current ? and on hiz load ? regards
From: Thanushan on 23 Jun 2008 07:17 On Jun 21, 10:27 am, "sani_figs" <adrian_fi...(a)yahoo.com> wrote: > Hi, > I tried connecting the pins directly and i tested it with a simple code > which fetches a single byte of data. I am getting no response from the > chip. Can this be due to the need of level translator? or maybe because I > made wrong SPI settings? I set my CPOL to 0 and CPHA to 1, but I'm feeling > that my SCLK freq is wrong also because I used the BRH and BRL (for baud > rate) settings that was used in the sample code from zilog (controlling a > DS1722 temp sensor). I can't make out the right settings for these > parameters from the datasheet of the ADE7758. By the way, Im using a > Z8F6421 MCU. > Thanks! Are you pulling the CS low before performe any operation. to check your code, scope the SCLK pin and MOSI pin to see the frequency, polarity and phase. Thanushan
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Earn 25 US$ in just 5 mins . . . Next: which oscilloscope? |