ΣSigmaStudio Ask AI Русский Log in

Format For Data In 1772 Registers

SigmaDSP & SigmaStudio Christopher Aug 1, 2013 00:00 6 replies Original on forum ↗
Subscribe
Christopher Question
Aug 1, 2013 00:00

Good day,

I am trying to read data from a ADAU 1772's registers' through a C.O.M interface. I a mostly a high - level software person and am unfimilar

with the kind of data I that was presented (a binary/decimal (decimal number that could be equated to a binary which was the data that was suppose to be read) representation of a float (it may be a fixed point, I am still not sure, the poeple at work say it is a Q 5. 27 if it is a fixed point)). I asked some people at work about it who have had some experiance with the 1772 and they told me that

the data was being modified (other than converted to binary) before I got it through C.O.M. I had limited success with decrypting this data using the equations:

(For 1 Byte):

Positive Numbers:

DATA / 8

Negitive Numbers (data with a value above 120):

30 + ( ( -( DATA - 16 ) ) / 8 )

(For 4 Bytes):

Positive Numbers:

DATA / ( 8 ^ 9 )

Negitive Numbers (Integers):

( DATA / ( .5 * 8 ) ) / 2

Negitive Numbers (Rationals, Limited Success/Accuracy):

( DATA / ( 8 ^ 9 ) ) / 2

Some strange things I noticed were:
A: All odd 4 byte numbers come out to be the same value (-8^9)

B: Seemingly random 4 byte numbers are negitive

(what made some people at my work place say the data is being modified before it comes through C.O.M).

Does anyone know what format this data I am getting is in. I am going through a Genreal 2nd Order filter in SigmaStudio 3.8 to get it to the chip.

ADIApproved Reply
Aug 1, 2013 00:00

Hello,

This FAQ should answer your questions: https://ez.analog.com/docs/DOC-3168

The data is 28-bit fixed point 5.23 format. The top 4 bits are basically ignored by the chip, but they are included in order to make the data width a full 4 bytes (32 bits) instead of 3 bytes and a nibble (28 bits).

Thanks,

Brett

ADIApproved Reply
Aug 1, 2013 00:00

My apologies. The ADAU1772 actually does have 5.27 format. I will amend the FAQ.

Christopher Reply
Aug 1, 2013 00:00

Thank you!

However, I am confused on somthing, I am only getting 25 bits back: (data: -29991863, translation according to MATLAB: 1110010011010001110110111). If I add a couple 0's onto the end I can get an approximate translation of (test value): -6.223456789124 to -6.3457,

is this the inteneded accuracy? Also, do you happen to know why all odd numbers come out to be -8^9 when reading from the registers?

ADIApproved Reply
Aug 1, 2013 00:00

I'm seeing predictable results... Here are some examples of test writes I'm doing with SigmaStudio.

Block Write

Time: 15:35:57 - 475ms

IC: IC 1

Cell Name: Gen Filter1

Param Name: FilterDouble10B1

Param Address: 0x0180

Param Value: 0

Bytes: 4

Param Data:

b00000000 00000000 00000000 00000000

Block Write

Time: 15:36:16 - 994ms

IC: IC 1

Cell Name: Gen Filter1

Param Name: FilterDouble10B1

Param Address: 0x00E0

Param Value: 1

Bytes: 4

Param Data:

b00001000 00000000 00000000 00000000

Block Write

Time: 15:36:26 - 849ms

IC: IC 1

Cell Name: Gen Filter1

Param Name: FilterDouble10B1

Param Address: 0x0180

Param Value: 2

Bytes: 4

Param Data:

b00010000 00000000 00000000 00000000

Block Write

Time: 15:36:35 - 144ms

IC: IC 1

Cell Name: Gen Filter1

Param Name: FilterDouble10B1

Param Address: 0x00E0

Param Value: 3

Bytes: 4

Param Data:

b00011000 00000000 00000000 00000000

Block Write

Time: 15:36:43 - 824ms

IC: IC 1

Cell Name: Gen Filter1

Param Name: FilterDouble10B1

Param Address: 0x0180

Param Value: -3

Bytes: 4

Param Data:

b11101000 00000000 00000000 00000000

Block Write

Time: 15:36:52 - 920ms

IC: IC 1

Cell Name: Gen Filter1

Param Name: FilterDouble10B1

Param Address: 0x00E0

Param Value: -12

Bytes: 4

Param Data:

b10100000 00000000 00000000 00000000

Block Write
Time: 15:37:4 - 809ms
IC: IC 1
Cell Name: Gen Filter1
Param Name: FilterDouble10B1
Param Address: 0x0180
Param Value: -16
Bytes: 4
Param Data:
b10000000 00000000 00000000 00000000

Note that you can't read back from parameter memory, only from the control registers. The control registers don't have any number format (they're just a series of bits) so there's no need to translate there.

Are you using SigmaStudio to program the chip?

Christopher Reply
Aug 1, 2013 00:00

Thanks for the reply!

I am using SimgaStudio (3.8) to program the chip. (When I say this: please keep in mind I am a high - level developer XD) When you say "parameter memory", does that include the registers which the coefficients are written to? The method I am using is ISigmaStudio.REGISTER_READ() (exact code:

registerData = comInterface.REGISTER_READ( 'IC 1', cell2num( addresses( i, j ) ), 4 );

-----Update-----:

I figured out MATLAB's prefrences changed the accuracy of the numbers I saw. They are still a bit inaccurate and dont return the digit. But its progress! I still have not figured out why all odd numbers are -8^9 though.

-----Update-----:

I tried doing a parameter read and noticied that x, 27 always returns the same, somwhat accurate value. Here are the values I am testing/having trouble with:

-6.223456789124, -4.645654654656.

EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin