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.
Thank you for your quick reply.
The reference to ra-book is appreciated. I had actually stumbled on it the other day. I'll be reading through it.
I tried your GPIO settings and the code is still not working. but I could not change the mode Dropdown because it only contain a Peripheral selection? So I had to disable P103 first in the pins grid, in order to set the Mode to your suggestion. then I was able to change the mode.
I used the code as you suggested
#define RELAY1 BSP_IO_PORT_01_PIN_03.
// Toggle Relay //R_BSP_PinWrite(RELAY1, pin_level); R_IOPORT_PinWrite(&g_ioport_ctrl, RELAY1, pin_level);
/* Protect PFS registers */ R_BSP_PinAccessDisable();
At this point I'm assuming it's not working because GPIO is not Capable on this pin, because it is not listed in the "Port Capabilities" list?
I will start to experiment with the SPI interface, since the connector table specifies
CS (SPI Chip Select)
and P103 has SSLA0 as a capability?
Thanks for your help