electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

ADE7753


Post new topic  Reply to topic    EDAboard.com Forum Index -> Hobby Circuits and Small Projects Problems -> ADE7753
Author Message
markdem



Joined: 16 May 2006
Posts: 33


Post15 Mar 2008 7:12   

ade7753 reset


Hi All, I am tring to write a driver for a ADE7753, but having some MAJOR problems. When I do a read to register 0x3f, which should be chip revision, I only get zero. Reads from any other register is the same. I have checked my hardware about 100 times, but it all seems to be OK. I dont have a scope to check the OSC or the SPI clock.

I have serached on this forum, the CCS forum and google, but I cant seem to find any code.

Has anybody actualy used this chip, and if so, could you PLAESE post the driver code.

Thank you

Mark
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5154
Helped: 766
Location: Bochum, Germany


Post15 Mar 2008 11:23   

ade7753 code


The interface is similar to most Analog chips with an SPI interface. You most likely misunderstood the protocol or implemented it incorrect. I suggest to single step the code and to check the sequence of all SPI related signals during a communication cycle starting with /CS falling edge. Did you notice, that /RESET input also resets the interface? Holding /RESET low could probably also cause the said behaviour.
Back to top
markdem



Joined: 16 May 2006
Posts: 33


Post22 Mar 2008 6:37   

ade7753 software driver


Hello again, got some spare time today, so i Built a Proteus model so I can use the logic analyser, as i dont have a real one. After finding some small problems, I have made the PIC send out what the ADE7753 is expecting, including the CS and CLK lines. I have also simulated the ADE7753 response, and it all looks good. However, when I try this in real hardware, it still does not work. The responce from the ADE is always 255.

The following is my code,

Code:

#include <18F4550.h>

#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN,NOBROWNOUT,NOMCLR
#use delay(clock=48000000)

#define AD7758_CS      PIN_A0
#define ADE_DOUT       PIN_C7
#define ADE_DIN       PIN_B0
#define ADE_CLK       PIN_B1

#include "LCD420.c"

int test = 0, i, count;
int ADE_OUT_DATA = 63;   //chip version register from datasheet

void main()
   {
      lcd_init();
      printf(lcd_putc,"Ready");
      output_high(AD7758_CS);

      delay_ms(1000);

      while(1)
         {
            ADE_OUT_DATA = 63;
            output_low(AD7758_CS);
            delay_us(1);

            for(i=1;i<=8;++i)
               {
                  output_high(ADE_CLK);
                  delay_us(1);
                  output_bit(ADE_DOUT, shift_left(&ADE_OUT_DATA,1,0));
                  delay_us(1);
                  output_low(ADE_CLK);
                  delay_us(1);
               }
            
            output_low(ADE_DOUT);
            delay_us(4);

            for(i=1;i<=8;++i)
               {    
                  output_high(ADE_CLK);
                  delay_us(1);
                  shift_left(&test,1,input(ADE_DIN));
                  output_low(ADE_CLK);
                  delay_us(1);
               }
 
            output_high(AD7758_CS);
            
            lcd_gotoxy(1,1);                     //data returned from ADE7753
            printf(lcd_putc,"Data = %U",test);
               
            lcd_gotoxy(1,2);                     //Counter to show PIC is working                        
            printf(lcd_putc,"%U",count);

            delay_ms(500);
   
            count++;

         }
   }


Can anyone see any problems that I have missed??

Thanks

Mark

Added after 1 hours 15 minutes:

One other thing I have just noticed, If I remove the ADE7753, is still get 255 as the return. I dont have to pull the SPI Lines down, do I?

Thanks again,

Mark
Back to top
Google
AdSense
Google Adsense




Post22 Mar 2008 6:37   

Ads




Back to top
FvM



Joined: 22 Jan 2008
Posts: 5154
Helped: 766
Location: Bochum, Germany


Post22 Mar 2008 12:02   

ade7753 proteus


I think, the read operation is correct so far. This means, you most likely have a hardware problem (unconnects, shorts, mixed up signals). I repeat my suggestion to single step the code and check the signals at ADE7753 for each bit cycle. With ADE removed, you get the response from floating ADE_DIN. It should be 0 when pulling it down.

BTW.: You named your input signal ADE_DIN. But this line must be connected to ADE DOUT pin!
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Hobby Circuits and Small Projects Problems -> ADE7753
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
ADE7753 S/W driver (3)
ADE7753 grounding (4)
Beginner in ADE7753 (8)
help with ade7753 (18)
Help with ADE7753 (2)
ADE7753 with PIC layout (3)
PIC USB ADE7753 Ground Problems (1)
request to help for ADE7753 design (5)
ADE7753 Problem with zero crossing (3)
who has experienced in using ade7753 or 775x (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS