I'm new to the toolchains on FSP.
what I need to do is toogle the CS pin on the mikroE connector to High and Low. the CS pin on the on the relay click board is relay2.
I did this for the NXP board by toggling the Port/PIN.
I'm reviewing the EK-rA2L1 on element14.com and my notes on what I have done so far to try and get this working is defined here at Appendix C -- Pin access on the MikroE connector
Basically I read the resource material and tried to figure out How to access the The CS pin on the MickroE BUS connector in the "System Central & Ecosystem Access" section of the board..
I'm stuck at this point and need to answer some questions..
I started looking for other examples that refer to some pins in the
I used a Multimeter to work out which pin CS on the MikroBUS was.
Hi Steve K-
Thanx for all your work on your review and sharing the issues you ran into. This will help us improve our products and documentation. I read over your review and it is very, very detailed.…
Wow! Thank you Warren for reading and commenting on my element14 review. I’m having fun with the kit.
When I get some time, I plan on doing a blog here on the kit and the mikroE connector.
The RA book is a good resource for new users to the RA devices and the FSP :-
When a pin is configured as a peripheral pin :-
then the peripheral it is connected to controls the pin (it is not a GPIO). In the case of P1_03 above, it is configured as an SPI pin, so the SPI peripheral controls the pin. The driver for the SPI peripheral is "SPI Driver on r_spi".
There are a number of example projects available for the FSP :-
The r_spi example project for the EK-RA2L1 board is :-
though the example spi project for the EK-RA2L1 does not use the SPI on the MikroBUS connector.
To control the pin as a GPIO, it needs to be configured in either Input or Output mode :-
and since by default, PFS protection is enabled in the BSP tab of the configurator :-
you would need to use the code :-
#define RELAY1 BSP_IO_PORT_01_PIN_03 bsp_io_level_t pin_level = BSP_IO_LEVEL_LOW; R_BSP_PinAccessEnable(); R_IOPORT_PinWrite(&g_ioport_ctrl, RELAY1, pin_level); R_BSP_PinAccessDisable();
to toggle a GPIO that is set as an output.
OK , I've loaded in the spi driver. and I understand what your describing.
But all I need to do for the relay to work is toggle the CS pin ON High or OFF Low. the SPI module look more complex and is sending and reading bytes,
Is there a way to toggle the CS Pin with the SPI module?
I tried GPIO but it's not capable on this pin? I used GPIO on another board using the same Relay Click. so i assumed I could use GPIO
Here are the 2 references to the CS pin in the EK-Ra2L1 doc and the Mikroe doc.
here is the relay click board in the MikroE spec showing the relay2 on the CS pin
This is a link to my review in which I'm currently trying to get the MikroeE relay board to work on the EK-RA2L1.
This is the board review that worked with GPIO
I appreciate any direction you can give me. I'll continue to work on find a solution
There appears to be an error in the schematics and documentation for the EK-RA2L1 board, from tests it would appear that CS of the MikroBUS connector is connected to P1_04 of the RA2L1, not P1_03.
The attached project will toggle the CS pin (P1_04) of the MikroBUS connector as a GPIO pin. P1_04 is also SSLA1 for SPI channel 0.
I have just realised I have an Engineering Sample board, there is an ES sticker on the back side of the board. The issue with the MikroBUS connector CS pin was fixed for the Mass Production boards.
Which sort of EK-RA2L1 board do you have?
II have an ES sticker on the back of the board also.
If you check out my review at RA2L1 EVK(Ultra-Low Power 48MHz Arm® Cortex®-M23) - Review it has all the pictures and the information on the board I'm reviewing for Renesas on the element14.com blog.
I'll check out your code and try using your recommended P1_04 .
Your correct Jeremy, I finally got this to work!!
The documentation is incorrect in the manual, EK-RA2L1 v1 – User's Manual
In section 5.3.5 the CS connector is described as connected to P!03 SSLA0
The CS pin is for Relay2 (It's a dual relay click) as described in the MikroE I not sure about Relay1 which is on pin PWM and described a pin/bus P400 (GTIOC6A) , P400 seems to work as defined using the BSP function.
It should be P!04 (SSLA1). for SPI channel 0.
I'm using FSP 3.3 and when I create a project and use the project Template "Bare Metal - Blinky"
P104 is marked "Not Assigned" and the Mode is marked "Disabled" and the "Symbolic Name" value is blank.
But No problem.. I change the value In Mode to "Output Mode (initial High)", the P104 changes to GPIO..
When I change my code to use P104 the RELAY2 works fine on the MikroeE click board
NOTE: RELAY2 is defined in the FSP configurator for P104 in the value for the "Symbolic name".
I you use the BSP function R_BSP_PinWrite() the first arg is defined locally.
Thanks for your help
Good to hear you have been successful. Out of interest, where did you get you EK-RA2L1 board from?
Again, thanks for all your help in diagnosing the problem. It took a lot of my time, which I'll never get back!. I guess I never questioned the documentation. I assume you tested the circuit with a Multimeter? I'd be interested in how you determined the correct pin assignment for CS?
I have another MikroE click board that I'll try out soon. Hopefully all the pins will be described correctly. I lost some confidence in the docs after this experiences.
I belong to an excellent Embedded Electronics blog called element14.com. They have Design Challenges, Webinars, Roadtest Reviews, Projects etc. They are affiliated with hackster.io under the Advent community umbrella.
I received the free EKRA2L1 board, because I was selected as one of the four road testers for
RA2L1 EVK(Ultra-Low Power 48MHz Arm® Cortex®-M23) on the element14.com blog. The Vendor supplied the kits through Newark.
I've completed my review at
My RA2L1 EVK - Review
Check it out, when you have time it's free to become a member. It's a great blog for me to gain experience with embedded Software Development and be able to get free stuff!
Check it out and let me know what you think.
Thanx for all your work on your review and sharing the issues you ran into. This will help us improve our products and documentation. I read over your review and it is very, very detailed. Everything from unboxing photos, to registering on the web site, to logging a ticket on the support portal, to doing the Blinky tutorial, to getting your project working. WoW!
I'm sharing your work with our marketing team so they can address the areas for improvement you identified. Thanx!