Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).
|
Hi, Well there is nothing more to it except that u have to alternately pick data, both codecs send data come from the same SPORTx on the EZKIT2189. you can do that by keeping a flag which toggles its value every interrupt. Secondly I dont understand what you exactly mean by LSB 8bit in control register. Is this SPORTx Control register or anyother. All the bit info is describe fully in the hardware manual of 218x and also there is a brief description in Appendix B titled " CONTROL/STATUS REGISTERS " which carries all the bit definitions of Memory Mapped as well as Non-memory mapped registers. moreover if u are asking if u want to have more bits per sample then all u have to do is alter the last four bits of SPORT Ctrl register this field is described as SLEN in manual and carries the one minus the number of bits that each serial word will carry. like for 8 bits it will be xxx7 for 16 it will be xxxF in the last four bits of SPORT Ctrl Register. Regards, Ali Irfan Ahmed. ----- Original Message ----- From: tylu To: Sent: Thursday, May 08, 2003 7:39 PM Subject: [adsp] AD73322 Dual AFE communicates with ADSP-2189m? I am using 2189m EZ-kit which has a dual Analog Front End AD73322. It is used as a 2 channel ADC and DAC. Does anyone has any experience handling the program that communicate between AD73322 and DSP through SPORT? I tried the Talkthrough.asm demo program but it was only for 1 channel. And I can't rewrite the program to 2 channel. And in datasheet, it only defined the LSB 8 bit in control register. So I am not sure what does every bit means.... thx~ _____________________________________ /groups.php3 |
|
|
|
Dear Sir Thanks for answering my question so fast! I understand the register settings in 218x. The problem is about the setting in AD73322. I can't figure out how to set up AD73322 for 2 separate channel interfacing with DSP. In other words, I can read the data correctly for only 1 channel input from analog end using codes similar to Talkthrough example, but not both channel. I think I must miss something about AD73322 but don't know where? Do you, sir, or anyone in this group happened to have some experience about it. thanks again! tylu --- In , "Ali Irfan Ahmed" <ali.irfan@a...> wrote: > Hi, > > Well there is nothing more to it except that u have to alternately pick data, both codecs send data come from the same SPORTx on the EZKIT2189. you can do that by keeping a flag which toggles its value every interrupt. Secondly I dont understand what you exactly mean by LSB 8bit in control register. Is this SPORTx Control register or anyother. All the bit info is describe fully in the hardware manual of 218x and also there is a brief description in Appendix B titled " CONTROL/STATUS REGISTERS " which carries all the bit definitions of Memory Mapped as well as Non-memory mapped registers. moreover if u are asking if u want to have more bits per sample then all u have to do is alter the last four bits of SPORT Ctrl register this field is described as SLEN in manual and carries the one minus the number of bits that each serial word will carry. like for 8 bits it will be xxx7 for 16 it will be xxxF in the last four bits of SPORT Ctrl Register. > > Regards, > Ali Irfan Ahmed. |
|
Hi,
AD73322 if set properly will always output words for both
codecs. If you look in the talkthrough program you will see an array of 16 command words. They
are actually 2 set of 8 command words, one set for each codec. Their description is given in
AD73322 datasheet. Logically 73322 is a cascade of two 73311s but with a few more features.
They are connected on the same SPORT and use device address to identify when the data is
intended for them and when to send data. I hope this would help but if you still have problem
post the asscocitaed code so that your problem could be analyzed in more detail.
Regards,
Ali Irfan Ahmed.
|
|
|
|
Thanks for taking your time answering my question! I know where the commands are, but the problems are the code. I think. Here are the codes from talkthrough demo: .VAR InitCommands[16] = b#1000100100001111, /* CRB1 */ b#1000000100001111, /* CRB0 */ /* |--- -- | |-- | | | | +---Sample rate | | +-----Serial Clock Divider | +-------Master Clock divider +----------Control Echo Cancel */ b#1000101001111001, /* CRC1 */ b#1000001001111001, /* CRC0 */ /* |||||||| |||||||+---Power-Up device ||||||+----Analog gain tap power |||||+-----Input amplifier power ||||+------ADC power |||+-------DAC power ||+--------REF power |+---------REFOUT use +----------1=Enable 5V 0=Disable 5V */ b#1000101100000101, /* CRD1 */ b#1000001100000101, /* CRD0 */ /* |---|--- | || | | || +----Input gain select 111 +38db | |+-------Reset ADC Modulator | +--------Output gain select 000 +6db +-----------Output mute */ b#1000110000000000, /* CRE1 */ b#1000010000000000, /* CRE0 */ /* |||----- ||| | ||| +----DAC Advance Settings 0-4 ||+---------IBYP Interpolator bypass |+----------Digitaly gain tap enable +-----------RESERVED (0) */ b#1000110100000000, /* CRF1 */ b#1000010100000000, /* CRF0 */ /* |||||||||||----- ||| | ||| +-----Analog Gain Tap Coefficient 0-4 ||+----------Single-ended |+-----------Input Invert +------------Analog loopback b#1000111111111111, /* CRG1 */ b#1000011111111111, /* CRG0 */ /* --------- +-----Digital Gain Tap 0-7 */ b#1000111011111111, /* CRH1 */ b#1000011011111111, /* CRH1 */ /* --------- +-----Digital Gain Tap 8-15 */ b#1000100000010001, /* CRA1 */ b#1000000000010001; /* CRA0 */ /* |---|||| | ||||+-----Data/Program operating mode | |||+------Mixed Mode | ||+-------Digital loopback | |+--------SPORT loopback mode | +---------Device count +------------Software Reset*/ Here are my questions: 1. The datasheet only defines the last 8 bit, what does the first 8 bit do? 2. In order to have 2 channel, I must make CRx0=CRx1 x=A,B...H and Device Count bit in CRA be 010, right? 3. I want to use timer interrupt to read data instead of polling, how do I correctly read the data from both channels? thanks again! I worked a week in the code but came out nothing... tylu --- In , "Ali Irfan Ahmed" <ali.irfan@a...> wrote: > Hi, > > AD73322 if set properly will always output words for both codecs. If you look in the talkthrough program you will see an array of 16 command words. They are actually 2 set of 8 command words, one set for each codec. Their description is given in AD73322 datasheet. Logically 73322 is a cascade of two 73311s but with a few more features. They are connected on the same SPORT and use device address to identify when the data is intended for them and when to send data. I hope this would help but if you still have problem post the asscocitaed code so that your problem could be analyzed in more detail. > > Regards, > Ali Irfan Ahmed. > ----- Original Message ----- > From: tylu > To: > Sent: Thursday, May 08, 2003 10:57 PM > Subject: Re: Fw: [adsp] AD73322 Dual AFE communicates with ADSP- 2189m? > Dear Sir > Thanks for answering my question so fast! > I understand the register settings in 218x. The problem is about the > setting in AD73322. I can't figure out how to set up AD73322 for 2 > separate channel interfacing with DSP. In other words, I can read the > data correctly for only 1 channel input from analog end using codes > similar to Talkthrough example, but not both channel. I think I must > miss something about AD73322 but don't know where? Do you, sir, or > anyone in this group happened to have some experience about it. > > thanks again! > > tylu > --- In , "Ali Irfan Ahmed" <ali.irfan@a...> wrote: > > Hi, > > > > Well there is nothing more to it except that u have to alternately > pick data, both codecs send data come from the same SPORTx on the > EZKIT2189. you can do that by keeping a flag which toggles its value > every interrupt. Secondly I dont understand what you exactly mean by > LSB 8bit in control register. Is this SPORTx Control register or > anyother. All the bit info is describe fully in the hardware manual > of 218x and also there is a brief description in Appendix B titled " > CONTROL/STATUS REGISTERS " which carries all the bit definitions of > Memory Mapped as well as Non-memory mapped registers. moreover if u > are asking if u want to have more bits per sample then all u have to > do is alter the last four bits of SPORT Ctrl register this field is > described as SLEN in manual and carries the one minus the number of > bits that each serial word will carry. like for 8 bits it will be > xxx7 for 16 it will be xxxF in the last four bits of SPORT Ctrl > Register. > > > > Regards, > > Ali Irfan Ahmed. > > _____________________________________ > /groups.php3 |
|
Tylu wrote: Here are the codes from talkthrough demo: .VAR InitCommands[16] = b#1000100100001111, /* CRB1 */ b#1000000100001111, /* CRB0 */ /* |--- -- | |-- | | | | +---Sample rate | | +-----Serial Clock Divider | +-------Master Clock divider +----------Control Echo Cancel */ *** you are using 64 KHz sample rate if you are using the EZ KIT. b#1000101001111001, /* CRC1 */ b#1000001001111001, /* CRC0 */ /* |||||||| |||||||+---Power-Up device ||||||+----Analog gain tap power |||||+-----Input amplifier power ||||+------ADC power |||+-------DAC power ||+--------REF power |+---------REFOUT use +----------1=Enable 5V 0=Disable 5V */ *** I re-aligned the "pointers" to the bits. b#1000101100000101, /* CRD1 */ b#1000001100000101, /* CRD0 */ /* |---|--- | || | | || +----Input gain select 111 +38db | |+-------Reset ADC Modulator | +--------Output gain select 000 +6db +-----------Output mute */ b#1000110000000000, /* CRE1 */ b#1000010000000000, /* CRE0 */ /* |||----- ||| | ||| +----DAC Advance Settings 0-4 ||+---------IBYP Interpolator bypass |+----------Digitaly gain tap enable +-----------RESERVED (0) */ b#1000110100000000, /* CRF1 */ b#1000010100000000, /* CRF0 */ /* |||----- ||| | ||| +-----Analog Gain Tap Coefficient 0-4 ||+----------Single-ended |+-----------Input Invert +------------Analog loopback b#1000111111111111, /* CRG1 */ b#1000011111111111, /* CRG0 */ /* --------- +-----Digital Gain Tap 0-7 */ b#1000111011111111, /* CRH1 */ b#1000011011111111, /* CRH1 */ /* --------- +-----Digital Gain Tap 8-15 */ b#1000100000010001, /* CRA1 */ b#1000000000010001; /* CRA0 */ /* |---|||| | ||||+-----Data/Program operating mode | |||+------Mixed Mode | ||+-------Digital loopback | |+--------SPORT loopback mode | +---------Device count +------------Software Reset*/ Here are my questions: 1. The datasheet only defines the last 8 bit, what does the first 8 bit do? without reading all 43 pages of the AD73322 data sheet, it looks like the 3 LSBs of the upper 8 correspond to the register name- 000= CRA, 001=CRB,... 111=CRH. The 4th bit seems to designate channel 1/2. I just left the higher 8 bits as they were in talkthrough. 2. In order to have 2 channel, I must make CRx0=CRx1 x=A,B...H and Device Count bit in CRA be 010, right? I have one AD73322, using both channels, Device Count =001. 3. I want to use timer interrupt to read data instead of polling, how do I correctly read the data from both channels? I haven't used the timer. I am using the interrupt provided by the AD73322. It sends one for every sample. The DSP loops while waiting. Hope this helps, Dave |
|
tylu wrote: >But if I input the voltage from power supply between 0.8V~1.6V >and use the codes like > AY1=RX0; >after checking the register AY1 the number is not right!!! Here are a few things to check: You would want to have a breakpoint or halt immediately after the AY1=RX0; line to preserve the data. I never tried to figure out what voltage = what in binary. I did do a bunch of experiments to get unity gain through the in - out, then add a multiply by 2 to see that yes, I get +6 dB. To get DC into the ADC, you have to use the line input setting on JP3. The mic setting is DC blocked, and has an analog gain stage as well. You have the input gain set to +26dB. This will effect the full scale voltage. b#1000101100000101, /* CRD1 */ b#1000001100000101, /* CRD0 */ /* |---|--- | || | | || +----Input gain select 111 +38db | |+-------Reset ADC Modulator | +--------Output gain select 000 +6db +-----------Output mute */ >By the way, during debug I can't go step-by-step because interrupt >may be missed or count wrong. Right? If you single step, you will miss *lots* of samples. The EZ-ICE Emulator will let you single step in interrupt routines, the EZ-KIT alone won't. Visual DSP also has a "simulator" mode, maybe that could help? Dave David Tiefenbrunn N1WWY Essential Telecommunications Corp. - http://www.essentialtel.com David Tiefenbrunn - http://users.abac.com/dandatief |