Help Solar Explorer Kit

Hello, I'm working with (TMDSSOLARPEXPKIT), Piccolo F28035 kit. The kit have two microcontrollers the F28035 and f28027 this (to simulate the solar panel). Can you help me in establishing communication between the f28035 and f28027 by SPI in Vissim 8.0.

Register - code composer f28027 (Slave)

void SPI_init() { // Initialize SPI FIFO registers SpiaRegs.SPICCR.bit.SPISWRESET=0; // Reset SPI SpiaRegs.SPICCR.bit.SPILBK=0; // No Loopback mode SpiaRegs.SPICCR.bit.SPICHAR=0xF; // 16 bit SPI word SpiaRegs.SPICTL.bit.OVERRUNINTENA=0; SpiaRegs.SPICTL.bit.CLK_PHASE=0; SpiaRegs.SPICTL.bit.MASTER_SLAVE=0; // configure as a slave SpiaRegs.SPICTL.bit.SPIINTENA=0; SpiaRegs.SPISTS.all=0x0000; SpiaRegs.SPIBRR=0x0063; // Baud rate SpiaRegs.SPIRXBUF=0x0; SpiaRegs.SPITXBUF=0x0; SpiaRegs.SPIFFTX.all=0xC022; // Enable FIFO's, set TX FIFO level to 4 SpiaRegs.SPIFFRX.all=0x0022; // Set RX FIFO level to 4 SpiaRegs.SPIFFCT.all=0x00; SpiaRegs.SPIPRI.all=0x0010; SpiaRegs.SPICCR.bit.SPISWRESET=1; // Enable SPI SpiaRegs.SPIFFTX.bit.TXFIFO=1; SpiaRegs.SPIFFRX.bit.RXFIFORESET=1; SpiaRegs.SPIPRI.bit.FREE=1; }

Register - code composer f28035 (Master)

void SPI_init() { // Initialize SPI FIFO registers SpibRegs.SPICCR.bit.SPISWRESET=0; // Reset SPI SpibRegs.SPICCR.bit.SPILBK=0; // No Loopback mode SpibRegs.SPICCR.bit.SPICHAR=0xF; // 16 bit SPI word SpibRegs.SPICTL.bit.OVERRUNINTENA=0; SpibRegs.SPICTL.bit.CLK_PHASE=0; SpibRegs.SPICTL.bit.MASTER_SLAVE=1; // configure as a master SpibRegs.SPICTL.bit.SPIINTENA=0; SpibRegs.SPICTL.bit.TALK=1; SpibRegs.SPISTS.all=0x0000; SpibRegs.SPIBRR=0x0063; // Baud rate SpibRegs.SPIRXBUF=0x0; SpibRegs.SPITXBUF=0x0; SpibRegs.SPIFFTX.all=0xC022; // Enable FIFO's, set TX FIFO level to 4 SpibRegs.SPIFFRX.all=0x0022; // Set RX FIFO level to 4 SpibRegs.SPIFFCT.all=0x00; SpibRegs.SPIPRI.all=0x0010; SpibRegs.SPICCR.bit.SPISWRESET=1; // Enable SPI SpibRegs.SPIFFTX.bit.TXFIFO=1; SpibRegs.SPIFFRX.bit.RXFIFORESET=1; SpibRegs.SPIPRI.bit.FREE=1; }

Attached are two example

Attached are two example diagrams that run on the Piccolo Launchpad (F28027). One produces a .5 Hz triangle wave and sends the values out as SPI master. The other acts as SPI slave and reads the values and applies them to a PWM tied to an LED. When the two launchpads are connected, the slave LED will modulate brightness at .5 Hz. You can use these diagrams to set up SPI on your solar kit.
You must be signed in to this site to see and download the attached files.