RX software
easyDSP uses the generated code from RX Smart Configurator. You can find the detailed process below based on RX Smart Configurator v1.40.
STEP 1 : Smart Configurator setting
Please add 'SCI Driver' component by cliking 'Add component' button in the 'Components' tab.
Then r_sci_rx and r_byteq components are created.
Since easyDSP uses SCI channel 1, 'r_sci_rx' components should be set accordingly. Please refer to the red line below.
The circular buffer is not required for easyDSP. TX and RX queue buffer size should be 12 and 2 respectively at its minimum.
TEI interrupt is not used.
The interrupt priority level of ERI and TEI should be the lowest, 1.
RXD1 and TXD1 pins of SCI1 should be enabled. The other pins of SCI1 are not used.
Now in the 'r_byteq' components. At least, two queue control blocks are required for easyDSP.
In case you don't use circular buffer in the 'r_sci_rx' component, set the 'Use disable interrupt to protect queue' as 'Unused'.
In case you use circular buffer, then set as 'Used'.
In the 'r_bsp' component, set 'Processor Mode' as 'Stay in Supervisor mode'.
RXD1 and TXD1 pins are allocated in the 'Pins' tab. Please set 'Assignment' column so that it matchs with the hardware setting . Please check the MCU datasheet to allocate 'Pin Number' column.
Finally generate code.
STEP 2 : Calling easyDSP_init()
Two files are provided for easyDSP communication (easyRX.h and easyRX.c). Please include them in your project. You can find them in the easyDSP installation folder (\source\RX).
First choose the baudrate of SCI communication to easyDSP. Also note it should be same to what you set in the easyDSP project setting.
Then please call the easyDSP_init() function in the main.c.
The priority level of SCI interrupt easyDSP uses is the lowest one (IPL[3:0] = 1). The priority level of the other user interrupt should be set higher than this.
STEP 3 : IDE setting
1. The output file easyDSP uses should have DWARF debugging information. Therefore when using CC-RX compiler, the output file with DWARF debugging information should be created in every compiling time. This is actually done as a default in e2 studio.
2. Hex file (Intel format) is used for flash programming. So it should be created in every compiling time in the same folder to output file with same file name. The hex file extension could be either 'hex' or 'ihex'. easyDSP first check if the hex file with extension 'hex' exists and use it for flash programming. If the hex file with extension 'hex' doesn't exist, easyDSP uses the hex file with extension 'ihex'. Please set your IDE accordingly to create hex file in every compilation.
For example, if you use e2 studio IDE with GCC :
Or if you use e2 studio with CC-RX :
3. For easyDSP to access the variable, the debug information should be included in the output file (ex, *.elf). And the option of assembler, compiler and linker should be set accordingly.
4. The declared but unused variables could be excluded from the debug information depending on compiler's optimization level and linker option. In this case, you can't monitor this variable with easyDSP. If necessary, you can set the linker option so that the unused variables are not excluded.
5. easyDSP supports the little endian mode only.
For example, if you use e2 studio with GCC :
Or, if you use e2 studio with CC-RX :