AD1445 multipurpose pins driven by control port
Hi,
On AD1445, we want to use some of the multipurpose pins as digital output pins, and we want them driven by the control port, i.e. the I2C interface. To control those outputs, the datasheet says (Rev A, page 67) we can read/write the addresses listed in Table 64, but what's confusing me is Table 64 is just a list of control registers used for pin modes selection. Also, those registers are 16-bit, you can't read/write 5.23 formatted data from/to them as mentioned in the datasheet. I guess it's referring to some other addresses, but where? Thank you.
Regards,
Rong
Hello Rong,
The documentation for this function was updated in the Rev. B version of the datasheet, which is available on the web now. However, even on that revision, there was an error in the addresses listed. We discovered this documentation error a few weeks ago but have not yet been able to publish an update or anomaly list on the web.
Datasheet Rev.B page 68 Table 66:
Addresses of Multipurpose Pin Value Registers
Addresses are incorrect.
The correct addresses are as follows:
Pin Dec Hex
MP0 4672 1240
MP1 4673 1241
MP2 4674 1242
MP3 4675 1243
MP4 4676 1244
MP5 4677 1245
MP6 4678 1246
MP7 4679 1247
MP8 4680 1248
MP9 4681 1249
MP10 4682 124A
MP11 4683 124B
I hope to get this documentation error cleared up ASAP. Unfortunately it will take a bit of time for the updates to make it through the publication pipeline.
Thanks for the reply. Where can I find the Rev. B? The ADAU1445 product page still points to the Rev. A: http://www.analog.com/en/audiovideo-products/audio-signal-processors/adau1445/products/product.html
cheers,
Rong
Hello Rong,
I made a mistake. The versioning goes like this:
ADAU1446 initial release: Rev.0
ADAU1445/ADAU1446 update: Rev.A
ADAU1442/ADAU1445/ADAU1446: Rev.B (this will release in a few weeks)
The incorrect addressing typo was discovered after the Rev.B version was published (closed for edits), so the addresses will be updated to the correct values in a minor revision called Rev.C.
For now, here is an updated description:
>>START OF DESCRIPTION<<
The ADAU1442/ADAU1445/ADAU1446 each include 12 multipurpose pins that can be used either as digital general-purpose inputs/outputs (GPIOs) or as inputs to the 4-channel auxiliary ADC.
Each of the 12 multipurpose pins is controlled by a 4-bit mode. Pins can be configured as digital inputs, digital outputs, or, when applicable, as an analog input to the auxiliary ADC. A debounce circuit is included for use with digital inputs, and it has a range of selectable time constants between 0.3 μs and 40 μs.
When the inputs or outputs are driven by the control port, the value can be directly read or controlled by reading or writing the addresses listed in Table 64.
Each of these registers is four bytes long and is in 5.23 format. To write a Logic 1, the bytes written should be 0x00, 0x80, 0x00, and 0x00. To write a Logic 0, the bytes written should be 0x00, 0x00, 0x00, and 0x00.
When the outputs are driven by the core, they are represented as MP outputs in the SigmaStudio programming tool and are driven directly from the DSP program in 5.23 format.
In addition, there are 12 multipurpose pin value registers that allow the input/output data to be written to or read directly from the control port. The corresponding addresses are listed in Table 66. Each value register contains four bytes and can only store one of two values: logic high or logic low. Logic high is stored as 0x00, 0x80, 0x00, 0x00. Logic low is stored as 0x00, 0x00, 0x00, 0x00. More information about the multipurpose pins can be found in the AN-951 Application Note, Using Hardware Controls with SigmaDSP GPIO Pins.
Multipurpose Pin Value Registers (Address 0x129A to Address 0x12A5)
Table 66. Addresses of Multipurpose Pin Value Registers
Address Register
Dec,Hex
4672 1240 MP0
4673 1241 MP1
4674 1242 MP2
4675 1243 MP3
4676 1244 MP4
4677 1245 MP5
4678 1246 MP6
4679 1247 MP7
4680 1248 MP8
4681 1249 MP9
4682 124A MP10
4683 124B MP11
>>END OF DESCRIPTION<<
Here's a good test example. You should see the output toggle by doing this write sequence:
(Set MP0 to "Output driven by control port with pull-up)
Block Write
Param Address: 57860
Bytes: 2
Param Data: 0x00, 0x09
(Check status of MP value register)
Read Request
Param Address: 4672
Bytes: 4
Read Result
Param Address: 4672
Bytes: 4
Param Data: 0x00, 0x80, 0x00, 0x00
(Write 0 to MP value register)
Block Write
Param Address: 4672
Bytes: 4
Param Data: 0x00, 0x00, 0x00, 0x00
(Check status of MP value register)
Read Request
Param Address: 4672
Bytes: 4
Read Result
Param Address: 4672
Bytes: 4
Param Data: 0x00, 0x00, 0x00, 0x00
Hi,
Thanks for the reply. In that snipped description, it seems paragraph 3 and 6 are talking about the same thing, but one mentions table 64 and the other table 66. It's even more confusing when you look at the description on top of Table 66, where it says "Pin Value Registers (Address 0x129A to Address 0x12A5)", while the table gives addresses 0x1240 - 0x124B. By reading your test example, it seems the pin mode register you are using is 0xE204, which doesn't match neither of these two address ranges. Can you please give a better clarification on this issue? Thanks.
Regards,
Rong
Hi Rong,
Thanks for continuing to point out my typos! Here's a (hopefully) definitive answer. I read this over twice before posting, so I hope I didn't (yet again) make a mistake!
The MP pins are configured to a certain operational mode using bits [3:0] at the following addresses:
MP Pin Mode Registers
MP0 Mode - 57860 - 0xE204
MP1 Mode - 57861 - 0xE205
MP2 Mode - 57862 - 0xE206
MP3 Mode - 57863 - 0xE207
MP4 Mode - 57864 - 0xE208
MP5 Mode - 57865 - 0xE209
MP6 Mode - 57866 - 0xE20A
MP7 Mode - 57867 - 0xE20B
MP8 Mode - 57868 - 0xE20C
MP9 Mode - 57869 - 0xE20D
MP10 Mode - 57870 - 0xE20E
MP11 Mode - 57871 - 0xE20F
Possible settings for bits [3:0] are:
0000 = input without a debounce
0001 = input with a debounce of 0.3 ms
0010 = input with a debounce of 0.6 ms
0011 = input with a debounce of 0.9 ms
0100 = input with a debounce of 5 ms
0101 = input with a debounce of 10 ms
0110 = input with a debounce of 20 ms
0111 = input with a debounce of 40 ms
1000 = input driven by control port
1001 = output driven by control port with pull-up
1010 = output driven by control port without pull-up
1011 = output driven by core with pull-up
1100 = output driven by core without pull-up
1101 = input auxiliary ADC (MP0 to MP3 only)
1110 = output CRC error sticky
1111 = output watchdog error sticky
If any these pins are set to input/output set by control port (1000, 1001, or 1010), the corresponding 5.23 value can be read/written at the following addresses:
MP Pin Value Registers
MP0 Value - 4672 - 0x1240
MP1 Value - 4673 - 0x1241
MP2 Value - 4674 - 0x1242
MP3 Value - 4675 - 0x1243
MP4 Value - 4676 - 0x1244
MP5 Value - 4677 - 0x1245
MP6 Value - 4678 - 0x1246
MP7 Value - 4679 - 0x1247
MP8 Value - 4680 - 0x1248
MP9 Value - 4681 - 0x1249
MP10 Value - 4682 - 0x124A
MP11 Value - 4683 - 0x124B
A value of logic high is stored as 0x00, 0x80, 0x00, 0x00
A value of logic low is stored as 0x00, 0x00, 0x00, 0x00
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
Please log in to reply.