Home  >  Support  >  Support Forum  >  problems with ad9833 and rabbit4000
Notice! We've recently migrated to using a new forum, we hope you enjoy it. If you are an existing member and this is your first time visiting our new forum, please reset your password to be able to sign in.
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

problems with ad9833 and rabbit4000

0 votes
Hello guys .
i am trying to make a triangular wave with the ad9833 and the rabbit 4000.
i am trying to make a triangular wave from 5 Khz till 2 Mhz . but it doesnt work.
what can be the reason that it doesnt work?


here is my code :

void SendInt(int x)
{
char bhigh,blow;
char value[2];
bhigh=(char)((x>>8)&0xff);
blow=(char)(x&0xff);
value[0]=bhigh;
value[1]=blow;
SPIWrite(&value[0],2);
}

void CreateWord(long num, unsigned int *highbyte, unsigned int *lowbyte)
{
(*highbyte)=num&0x3fff;
(*highbyte)|=0x4000;
num=num>>14;
(*lowbyte)=num&0x3fff;
(*lowbyte)|=0x4000;
}

void StartWaveGenerator(void)
{
unsigned int mbuf[3];
int i;
mbuf[0]=0x2002; // 2002 for triangle
CreateWord(SetFreq(7000) ,&mbuf[1],&mbuf[2]);
SendInt(mbuf[0]);
SendInt(mbuf[1]);
SendInt(mbuf[2]);
}


#define MCLK 20000000
#define REGSIZE 268435456 // 2^28
long SetFreq(long freqval)
{
long fregister;
fregister=freqval*(REGSIZE*1./MCLK);
return fregister;
}

void main()
{
StartWaveGenerator();
}
asked Mar 26 in Rabbit Software by reggie720 New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
Rabbit products use the 12 bit A/D converter ADS7870
answered Sep 15 by MargaretK Veteran of the Digi Community (457 points)
Contact a Digi expert and get started today! CONTACT US
...