Forum: Digitale Signalverarbeitung / DSP / Machine Learning Probleme mit 9833


von Stein (Gast)


Lesenswert?

hallo leute, ich habe probleme mit dem 9833.
Ich bekommen KEIN Signal angezeigt.
kann mir jmd. weiterhelfen?
prog im anhang...

mfg








#include <avr/io.h>
#include <stdlib.h>



#include <util/delay_basic.h>


unsigned char x;




void warte(unsigned char zahl)            //warteschleife. warte ist 
100µsek. * zahl

{


  do
  {
    _delay_loop_1(0x00AA);
     --zahl;                  //1 von der Variable Zahl abziehen...





  }
   while (zahl >0);              // solange zahl > 0

}






int main(void)
{
  DDRD = 0xff;
  DDRB = 0xff;
  DDRA = 0x00;
  PORTD |= (1<<PD7) ; // FSYNC HIGH
  while(1)
  {

    while (PINA & (1<<PA1));
    {
      while (!(PINA  &(1<<PA1))) ;
      {

////////////////////////////CONFIG////////////////////////////////////// 
//////
        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 0
        warte(30);
        PORTD &=~(1<<PD7); // FSYNC LOW
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 1
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 2
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 3
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 4
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 5
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 6
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 7
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  8
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 9
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 10
        warte(30);
        PORTD &=~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 11
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN  12
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 13
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 14
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 15
        warte(30);
        PORTD &= ~(1<<PD6);
        warte(10);
        PORTD |= (1<<PD7) ; // FSYNC HIGH


///////////////////////////FREQUENZ-0/////////////////////////////////// 
///////////

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 0
        PORTD &=~(1<<PD7); // FSYNC LOW
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  1
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 2
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN   3
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN   4
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  5
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  6
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  7
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  8
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  9
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  10
        warte(30);
        PORTD &=~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  11
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  12
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  13
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN  14
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 15
        warte(30);
        PORTD &= ~(1<<PD6);
        warte(10);
        PORTD |= (1<<PD7) ; // FSYNC HIGH

/////////////////////////////CONFIC///////////////////////////////////// 
//

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 0
        warte(30);
        PORTD &=~(1<<PD7); // FSYNC LOW
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 1
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 2
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 3
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 4
        warte(30);
        PORTD &= ~(1<<PD6);




        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 5
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 6
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 7
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 8
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 9
        warte(30);
        PORTD &= ~(1<<PD6);



        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 10
        warte(30);
        PORTD &=~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 11
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN  12
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 13
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 14
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 15
        warte(30);
        PORTD &= ~(1<<PD6);
        warte(10);
        PORTD |= (1<<PD7) ; // FSYNC HIGH

///////////////////////////PHASE-0////////////////////////////////////// 
//

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 0
        warte(30);
        PORTD &=~(1<<PD7); // FSYNC LOW
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 1
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 2
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 3
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 4
        warte(30);
        PORTD &= ~(1<<PD6);




        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 5
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 6
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 7
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 8
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 9
        warte(30);
        PORTD &= ~(1<<PD6);



        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 10
        warte(30);
        PORTD &=~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 11
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5);   // ZU ÜBERTRAGENDES BIT EINGEBEN  12
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 13
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 14
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD |= (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 15
        warte(30);
        PORTD &= ~(1<<PD6);
        warte(10);
        PORTD |= (1<<PD7) ; // FSYNC HIGH




        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 0
        warte(30);
        PORTD &=~(1<<PD7); // FSYNC LOW
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 1
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 2
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 3
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 4
        warte(30);
        PORTD &= ~(1<<PD6);




        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 5
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 6
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 7
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 8
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 9
        warte(30);
        PORTD &= ~(1<<PD6);



        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 10
        warte(30);
        PORTD &=~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5); // ZU ÜBERTRAGENDES BIT EINGEBEN 11
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN  12
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 13
        warte(30);
        PORTD &= ~(1<<PD6);

        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 14
        warte(30);
        PORTD &= ~(1<<PD6);


        warte(30);
        PORTD |= (1<<PD6);
        warte(30);
        PORTD &=~ (1<<PD5);  // ZU ÜBERTRAGENDES BIT EINGEBEN 15
        warte(30);
        PORTD &= ~(1<<PD6);
        warte(10);
        PORTD |= (1<<PD7) ; // FSYNC HIGH



      }
    }
  }
}

von Michael (Gast)


Lesenswert?

Was ist ein 9833??

Meinst Du einen ADI Chip AD9833? Oder worum geht es?

von Stein (Gast)


Lesenswert?

jap genau

von Klaus S. (skibby)


Lesenswert?

Wieso benutzt Du den SPI nicht ?
Welche Portpins sind denn an die Pins des AD9833 angeschlossen ?
Welchen Controller benutzt Du ?

von Stein (Gast)


Lesenswert?

ich benutze den Atmega 8535
mit spi hat ich da probleme, weil der ad ja kein signal zurücksendet, 
und das bei spi doch erforderlich ist oder?

von Klaus S. (skibby)


Lesenswert?

Nö, der MISO-Pin kann unbeschaltet bleiben.
Viele A/D-Wandler zum Beispiel liefern auch kein Rücksignal.

Ich kann Dir mal Code zuschicken den ich im Rahmen eines Projektes
mit dem Mega8 erstellt habe. Die Anpassung an den 8535 sollte dann kein
Problem sein.

von Stein (Gast)


Lesenswert?

ja das wär nett,wenn du den mal schicken könntest.

von Klaus S. (skibby)


Lesenswert?

gerne, wenn Du mir Deine Mail-Adresse nennst ...

von Stein (Gast)


Lesenswert?

c-steinmann@gmx.de

(dachte du stellst den hier ins forum)

von Klaus S. (skibby)


Angehängte Dateien:

Lesenswert?

klar kann ich den Code auch hier reinstellen.
Hab ich gar nicht dran gedacht. Der Code ist so wie er ist aus dem 
Gesamtprojekt kopiert und leider nicht dokumentiert. (Wie so oft
musste schnell was zusammengezimmert werden :-)

von Stein (Gast)


Lesenswert?

danke für den code, hat mir weitergeholfen!

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.