Using EMIF expansion port as digital output

David Valencia October 27, 20107 comments Coded in C for the TI C67x

This is a simple example of how to use the EMIF expansion (labeled as Memory Expansion on the board) as a 32-bit wide parallel digital output.

Here is a picture of the board:

dsk

IMPORTANT DISCLAIMER:

The usage of this port as an output port is not originally supported, as it is designed to be used with a specially designed daughterboard. These pins MUST be connected to 3.3V digital buffers, like the 74HC245 or similar buffer.

/*      David Valencia at DSPRelated.com

        This example shows how to use the External Memory Interface
        expansion port of Spectrum Digital DSK6713 card as
        a set of digital imputs
        The use of buffer ICs is mandatory, as these pins can't deliver
        too much current        */

#define OUTPUT 0xA0000000  // EMIF ADDRESS (updated 3/11/2010)

int *output = (int*)OUTPUT; // Declare a pointer to EMIF's address

void main()
{
        // To see how the value is written to the EMIF pins,
        // you may prefer to run the program step-by-step

        // Write a 32-bit digital value to the pins
        *output = 0x48120A00; // Test value
}

Comments:

wave
Said:
Dear David Valencia, I 've mailed hundereds of inquiries in dsprelated c6x group about this "EMIF as an output" application of EMIF which is an exercise in Rulph Chassing book , but no one could help me with that. It's been a year that I 'm working on this project but I still couldn't run this program truly. I also implemented this hardware via 74hC244 as mentioned in chassing's book. but I need your "output.h" and your whole project for this code please. so please help me we this, I'll sincerely appreciate that. pleaseeeee... Best Regards, rafi3e@ieee.org
9 years ago
0
Reply
Sorry, you need javascript enabled to post any comments.
David VP
Said:
@wave Actually, the only definition that output.h makes is: #define OUTPUT 0xA0000000 I'll add it to the code here, so output.h is no longer neccesary. Regards - David Valencia
9 years ago
0
Reply
Sorry, you need javascript enabled to post any comments.
wave
Said:
Dear David Valencia, Thanks a lot. You're the best :) It really helped. Eventually, it occurred to me that my code must be true and sufficient; my hardware was authentic as well, so I just found out that I should check only CE1, CE2, CE3 and other read/write/output pins of my DSK. I've all EMIF manuals of TI Inc, and I've tested about 4-5 hundreds of lines for configuring EMIF registers, but I wasn't right ! Anyway, I've tested my whole interfaced board and my connections, my whole design, from software to hardware, then I found out it will work just by pulling down (connect the pin to GND) the Pin-75 of (peripheral expansion interface)PCI (NOT EMIF) connector. then both of my hardwares (the one with 74ls244 and LEDs, and the one with microcontroller directly interfaced to EMIF without any buffer or latch) will work perfectly. And of course If do not put your main function in an infinite loop, you should hold the data by a latch or flip-flop. To sum up, I should state that you do not need any gel file (except the default one for startup) or CSL function or ... to config EMIF registers individually. The headers I've included are enough for a complete signal processing project using codec (for analog inputs and outputs), EMIF expansion (as digital output), etc. So notice that this code is very short but much more clever than what brilliant minds might think ! Best Regards, rafi3e@ieee.org This code is 100 % demonstrated and is an adequetly tested code on C6713 Spectrum Digital DSK : // main.c ******************* rafi3e@ieee.org #include "dsk6713.h" #include "DSK6713_AIC23.h" //codec-DSK support file Uint32 fs=DSK6713_AIC23_FREQ_48KHZ; //set sampling rate #define DSK6713_AIC23_INPUT_MIC 0x0015 #define DSK6713_AIC23_INPUT_LINE 0x0011 Uint16 inputsource=DSK6713_AIC23_INPUT_MIC; #include #include #include #include #include #define OUTPUT 0xA0000000 // EMIF ADDRESS for CE2 which will be enabled by pin 78 of EMIF connector int *output = (int*)OUTPUT; // Declare a pointer to EMIF's address void main() { while (1) { // Write a 32-bit digital value to the pins *output = 0xF001100F; // Test value } } //*************************************************** for further info, you may follow here : http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/p/74705/271855.aspx#271855
9 years ago
0
Reply
Sorry, you need javascript enabled to post any comments.
wave
Said:
Sorry, these headers were missed. #include #include #include #include #include
9 years ago
0
Reply
Sorry, you need javascript enabled to post any comments.
wave
Said:
stdio.h , string.h , stdlib.h, math.h , time.h
9 years ago
0
Reply
Sorry, you need javascript enabled to post any comments.
rsdio
Said:
Most TMS320 chips require that the EMIF port be configured before it will work properly. The CSL (Chip Support Library) from Texas Instruments has routines for initializing the EMIF. I think that your GND connection on the PCI connector is telling the DSP to boot from EMIF, in which case the ROM will set up the EMIF for you. If you call the EMIF initialization code, then you won't even need to GND that pin. I have designed my own PCB using the TMS320VC5506 with 16-bit EMIF, and I briefly made the same mistake when changing boot modes during early development. At first, I did not realize that my firmware was relying upon the ROM initialization until I changed things such that the ROM no longer handled that. Once I discovered my omission, my EMIF output was restored to working status by calling EMIF_Config() with the proper struct.
8 years ago
0
Reply
Sorry, you need javascript enabled to post any comments.
avais03
Said:
There is sdram MT48LC4M32B2 available on DSK card, connected to CE0. When i try to access this sdram it works perfectly. The same configuration of EMIF registers, with modification in MTYPE field, column size, row size and bank size field, i am trying to access sdram MT48LC8M16A2 sdram, that i have connected to emif expansion connector but it is not working. I have not connected any additional buffers because there are already buffers connected to emif signals before expansion connector on DSK. I have checked all signals coming to SDRAM, that is connected to expansion connector. They are exactly same as signals reaching CE0 SDRAM (only there is slight overshoot in signals while transitioning from 1 logic level to other). Can any body suggest something. Can there any issues with PCB as SDRAM operates on MHz clock
7 years ago
0
Reply
Sorry, you need javascript enabled to post any comments.
Sorry, you need javascript enabled to post any comments.