I will use Communication of TWI with ADSP21489 between MCU
I trying to setting Slave Module of ADSP21489
Could Someone point me to a C code example demonstrating an I2C Slave Module for the ADSP 21489
I have a working assembly code for TWI Slave RX which I have attached here . But presently I do not have a C code.
Also there is an example C code in VDSP installation folder (..\Analog Devices\VisualDSP 5.0\214xx\Examples\ADSP-21489 EZ-Board\Power_On_Self_Test\ temp_sensor_test.c ) which demonstrates the Sharc interfaced to a Temperature sensor using a TWI interface(master). You can go through the same for your reference.
I am currently struggling to bring I2C slave running on EZ lite 21489. I already implemented it on a EzLite SC589 in C and I am trying to port it to the 21489 ezboard. My code does not answer to I2C requests so I tried the above sample code.
I copied the above sample code and changed the lines. Instead of bin PB01 and 02 I have to use 07 and 08.
SRU(LOW,DPI_PB07_I); // PB01 beforeSRU(TWI_DATA_PBEN_O,DPI_PBEN07_I);SRU(DPI_PB07_O, TWI_DATA_I); SRU(LOW,DPI_PBEN08_I); // PB02 beforeSRU2(DPI_PB08_O,TWI_CLK_I) ;
Is there anything else to do? I am not so experienced in asm so far.
Do I need to change the interrupt mapping because of changed pins? It is not clear to me how the interrupt mapping works. I see the ISR in the table called from __P0I but how is the peripheral boound to P0I?
In CCES I get:
A non-recoverable error or exception has occurred. Description: No dispatched handler available for the specified interrupt code. General Type: RunTimeError Specific Type: NoDispatchedHandler Error Message: Enabled interrupt with ID (IID) 0x0b000008 raised when it has no handler registered. Error PC: 0x0012435d
Hmm. Interrupt mapping seems to be wrong? I did not change the interrupt table from above source.
I am accessing the I2C with an external I2C interface and looking on the bus with a scope looks like everything is electrically fine. T
Retrieving data ...