This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

looking for example code using SPI on 2812

Other Parts Discussed in Thread: SPRC097

I've been looking around for example code and/or documentation for the SPI on the 2812 using interrupts. I already downloaded the SPRU059 SPI reference guide. It has all of the facts about the SPI but seems sort of sparce about describing how is the best way to create a driver for the SPI. It seems like there should be more about the mechanism that disables the SPISTE line and what makes the clock continue until all of the message is received from a slave device, stuff like that. I also downloaded the SPRC097.zip V111 example code but the loopback examples do not really show elegant solutions. I might be dense but I always have this probelm with TI documentation; when I use other devices like Analog Devices I do not spend as much time stumbling around. Also should mention I am using the DSP/BIOS but for the SPI this probably doesn't make a lot of difference.

I've got the SPI working OK but I feel like the way I wrote it is not the best way.  Looking for more example code I can play around with and to see what others did in the interrupts and how they launched the transmitter isr.

 

 

  • Check out sprc183, the package includes a driver for interfacing the SPI with an external EEPROM (spise2p) using F2810/2812, maybe it will help answer your questions. It comes with the software and some documentation.

  • Hi BigDeal,

    If you will consider a new, 21st century way of programming, I can recommend an easy way to get interrupt driven, software queued SPI programming: use VisSim/ECD.

    It is a block diagram language for model based embedded development with full support for TI C2000 processors and on-chip peripherals.

     

    << Here is the config for the SPI unit on F2812 (and F280x series too).

     

    Below is a VisSim program to read from the ADC unit and write to a SPI queue:

    The control rate is set in the VisSim properties dialog. You can also have condition execution of subystems, custom rate background tasking, and block level interrupt handling. Most users do all programming (motor control + I2C + CAN + SCI + SPI supervisory tasking) in VisSim.

    Benchmarking has shown VisSim generated code to be within 5% of hand coded assembler.

    You can download a 2 month free trial here.

     

    Regards,

    Pete

  • Hi michaelwei,

    I am also looking for SPI driver for my DSP, F2812. The link that you posted is not working. Could you please help me out to find some SPI driver or example codes.

    Kind Regards,

    Qaisar