i would like to use ADSP21489 processor for our project, can you pl. provide the schematic. how to use DPI or DAI as GPIO?
Please find the UserManual for ADSP-21489 in the following link. You should find the schematic in that document.
As for using the DAI/DPI as GPIO, please find below,
// make the pin input or output
SRU(HIGH,PBEN05_I); // made an output
SRU(LOW,DAI_PB05_I); // make the pin value high or low
SRU(LOW,PBEN05_I); // made an output
SRU(LOW,DAI_PB05_I); // if you want to explicitly set a value for the input. Otherwise you will connect the source to this pin.
you may also connect the flags as input the DPI pins. you can set or clear the flags in the code which will be routed to the DPI pins. This is a preferred way.
// connect flags to DPI pins (FLags are only routed to only DPI and not DAI pins)
// make the pin output
// flag 15 is connected to DPI 8
SRU(HIGH, DPI_PBEN08_I);SRU(FLAG15_O, DPI_PB08_I);
in the code t
bit set FLAGS FLG15O; // make the flag as output
bit clr FLAGS FLG15; //you may set/clr/tgl the flag in the code and that is routed through the DPI pin.
Message was edited by: AndyR - Added link to SHARC manuals page.
Can u specify on these two lines of code, because when i compile i get these errors r
bit set FLAGS FLG15O;
bit clr FLAGS FLG15;
line 15: cc0020: error: identifier "bit" is undefined
bit set FLAGS FLG15O;
line 15: cc0065: error: expected a ";"
line 17: cc0020: error: identifier "bit" is undefined
bit clr FLG15;
line 17: cc0079: error: expected a type specifier
Please let me know on whether you are testing this code in C or assembly language. Can you share the file you are using?
I am using C and all i am trying to do i so toggle a pin
The instructions you have shown are assembly instructions. They need to be placed on asm file. In C code you need to use them as inline assembly code. Please check the compiler manual for more details.
You need to use them as below:
asm("bit set FLAGS FLG15O;");
asm("bit clr FLG15;");
Thanks I fixed it and how it`s running, but i have another question
using this two lines i am routing FLAG15O to DPI pin8 and enabling DPI pin 8 as output
when i toggle FLAG15 in the flag register it is toggling but the pin it is not,
DPI pin buffer enable register is showing that pin 8 is enabled, but the pin is not changing; am i missing something ?
Please let me know on whether you are testing this code on the EZ-KIT. In case of EZ-KIT, please make sure that the switch settings for the DPI 8 is off and then you probe the signal at the header.
Can you also share your code?
Retrieving data ...