Hi all,
I have to update an old project made with HEW (High-performance Embedded Workshop).
The micro is from the RX631 family (R5F5631BDDFB).
I have to implement an SPI peripheral in master mode (SPI7 on pins P90, P91, P92, P93). I have never implemented SPI before.
I would like to keep the project in HEW.
Could you tell me if there are any application notes or portions of code to understand how to implement it?
I would need to know how to configure the registers, the functions for reading-writing etc..
thanks
Stefano
Apologies - can you remind me which compiler version is used with HEW, or for your project?
Off-hand I was thinking it was CC-RX v1.x, which should not be a whole lot different in terms of code compatibility with more recent CC-RX versions, which would mean you could use the Smart Configurator to generate SPI code, if even for a different RX device variant that could be used in your project.
Hi Jim,
thanks for the reply.
The compiler version is RX C/C++ Compiler 1.02.00
Do you think I can use the Smart Configurator? I've never used it.
Normally in old projects I configured everything manually but it was very complicated.
I believe you could use the Smart Configurator to generate RSPI driver code for RX671 if you use the document:
Differences Between the RX671 Group and the RX63N Group
to be mindful of the added functionality for RX671 that is not present in RX63 devices. Differences are highlighted, e.g.
I am wondering if there would be an older version of SC that would directly support the older devices such as RX63, maybe a Renesas rep could comment on this possibility and whether a link to download such an older version could be made available.
Thanks for the help.
I'll try to do as you suggested.It would be nice to have an old version of the smart configurator for RX63
The Applilet4 preceded the Smart Configurator tool and I don't see support for RX63 devices with it, unfortunately. I guess the RX63 was effectively obsoleted by the time these code generating tools became available.
Unless someone from Renesas has a better suggestion or can dig up some sample code, I believe your best approach would be to try using the code generated from the Smart Config tool as previously mentioned as a starting point.
That's right, Rx63 devices are older than applilet.If there is no sample code available I will do as you suggested.
I happened to stumble upon a RX63N sample project that includes RSPI driver for RX compiler v1.02:
RX600 Series Hardware Data Collection and Filtering using the RX63N
Look in the folder "Workspace\rx_hw_datacollection\r_rspi_rx".
Fullscreen readme.txt Download PLEASE REFER TO THE APPLICATION NOTE FOR THIS MIDDLEWARE FOR MORE INFORMATION RX RSPI Driver ============== Document Number --------------- N/A Version ------- v1.40 Overview -------- Basic RSPI Master Mode driver. Features -------- * Functions to init, read, and write the RSPI channels * Ability to lock channels to a task to ensure no other tasks try to use peripheral while it is already being used. Supported MCUs -------------- * RX621, RX62N Group * RX630 Group * RX631, RX63N Group Boards Tested On ---------------- * RSK+RX62N * RDKRX62N * RSKRX63N * RDKRX63N Limitations ----------- * This code is not re-entrant but does protect against multiple concurrent function calls. Peripherals Used Directly ------------------------- * RSPI0 * RSPI1 * RSPI2 Required Packages ----------------- * none How to add to your project -------------------------- * Add src\r_rspi_rx.c to your project. * Add an include path to the 'r_rspi_rx' directory. * Add an include path to the 'r_rspi_rx\src' directory. * Configure middleware through r_rspi_rx_config.h. * Add a #include for r_rspi_rx_if.h to files that need to use this package. Toolchain(s) Used ----------------- * Renesas RX v1.02 File Structure: --------------- r_rspi_rx | readme.txt | r_rspi_rx_config.h | r_rspi_rx_if.h | \---src r_rspi_rx.c
PLEASE REFER TO THE APPLICATION NOTE FOR THIS MIDDLEWARE FOR MORE INFORMATION RX RSPI Driver ============== Document Number --------------- N/A Version ------- v1.40 Overview -------- Basic RSPI Master Mode driver. Features -------- * Functions to init, read, and write the RSPI channels * Ability to lock channels to a task to ensure no other tasks try to use peripheral while it is already being used. Supported MCUs -------------- * RX621, RX62N Group * RX630 Group * RX631, RX63N Group Boards Tested On ---------------- * RSK+RX62N * RDKRX62N * RSKRX63N * RDKRX63N Limitations ----------- * This code is not re-entrant but does protect against multiple concurrent function calls. Peripherals Used Directly ------------------------- * RSPI0 * RSPI1 * RSPI2 Required Packages ----------------- * none How to add to your project -------------------------- * Add src\r_rspi_rx.c to your project. * Add an include path to the 'r_rspi_rx' directory. * Add an include path to the 'r_rspi_rx\src' directory. * Configure middleware through r_rspi_rx_config.h. * Add a #include for r_rspi_rx_if.h to files that need to use this package. Toolchain(s) Used ----------------- * Renesas RX v1.02 File Structure: --------------- r_rspi_rx | readme.txt | r_rspi_rx_config.h | r_rspi_rx_if.h | \---src r_rspi_rx.c
Hi Jim, thanks again for the support! I'll try your suggestions
Hi Jim,I did it.I didn't use "RX600 Series Hardware Data Collection and Filtering using the RX63N" because the project contains a RSPI, while I use a standard SPI (SCI7).I used Smart Configurator for RX671 and adapted the code to the old HEW environment.Thanks again!
Good deal, glad to hear it.