SPI-3 wires
miki Wed May 18, 2016 10:30 pm
Hi,
I need some help.I want to use 3 wire spi comm with a rf module.
I need to use MOSI pin, bidirectional for write and read .How can I do it ?I want to use HW spi .bitbaging I know to do it.
I have a mini maple board.
Replies
zmemw16 Wed May 18, 2016 11:00 pm
which rf module?
if you don’t supply the info to allow an answer, we can’t.
at a first guess, try google with arduino + <module> + library e.g. arduino + nRF24L01 + library
also for 3 wire spi and arduino
stephen
WereCatf Wed May 18, 2016 11:29 pm
zmemw16 wrote:at a first guess, try google with arduino + <module> + library e.g. arduino + nRF24L01 + library
also for 3 wire spi and arduino
zmemw16 Thu May 19, 2016 12:19 am
ok second guess
does st.com spi hardware support it?
which module ? sort of major unknown. bit like asking a builder for a fixed price?
stephen with a leaky roof
mrburnette Thu May 19, 2016 1:08 am
This AppNote may be helpful
https://www.maximintegrated.com/en/app- … mvp/id/169
Seems if you aregoing to bit-bang anyway, it should be do-able.
This suggests a real-world use with Arduino
Ray
WereCatf Thu May 19, 2016 1:26 am
zmemw16 wrote:does st.com spi hardware support it?
GrumpyOldPizza Thu May 19, 2016 4:07 am
WereCatf wrote:zmemw16 wrote:does st.com spi hardware support it?
miki Thu May 19, 2016 6:48 am
The RF module is not relevant for this discussion but it is not a secret.The 2.4Ghz A7105 uses 3wires spi ,SDIO pin is bidirectional.
There is some examples but use different STM32 chip with standard STM32 periph. library.I want to use with arduino with an STM32F103
http://www.ba0sh1.com/2014/05/31/howto- … plex-mode/
void SPI_BiDirectionalLineConfig(SPI_TypeDef* SPIx, uint16_t SPI_Direction)
{
/* Check the parameters */
assert_param(IS_SPI_ALL_PERIPH(SPIx));
assert_param(IS_SPI_DIRECTION(SPI_Direction));
if (SPI_Direction == SPI_Direction_Tx)
{
/* Set the Tx only mode */
SPIx->CR1 |= SPI_Direction_Tx;
}
else
{
/* Set the Rx only mode */
SPIx->CR1 &= SPI_Direction_Rx;
}
}
racemaniac Thu May 19, 2016 8:31 am
Well, now you start reading the STM32F103 reference manual to understand how the spi port works, what its registers do. Then you start looking into the libmaplecode/the library the spi library, and learn where you will have to make the changes to do the half duplex communication, and then you implement it, and share it with the rest of us

.
miki Thu May 19, 2016 9:54 am
So you don’t know how to do it.
Anyway thanks.
zmemw16 Thu May 19, 2016 10:28 am
you have a roadmap, the route is up to you.
learn by doing, not by rote. that methodology applies in many areas.
one of my fellow students i still remember started every problem with the basic equations and demonstrated the
adage that the engineer knows both how and why it works.
horses and water thoughts also pop up.
stephen
miki Thu May 19, 2016 10:52 am
Arduino was invented to be easy to use and faster coding not wasting valuable time.
The STM32 standary library is too low level to start aligning sheets of code only for initialize and toggle one single pin,For this reason the Arduino was perfect choice imo . But it is not useful to tell every Arduino user that he should looking in arduino core or arduino library and see what you can do over there.It looses the argument of using Arduino in the first place.
The thread here is related with code snippets so I think I was ontopic asking for a hint maybe some code than looking in maple library and see what you can find over there.
If you/anybody doesn’t know how what to do it or where to look, is not a shame.Of course Instead of continuing my project in arduino I need so check hot to modify maple library.
As I said before ,…thanks anyway.
WereCatf Thu May 19, 2016 11:03 am
miki wrote:Arduino was invented to be easy to use and faster coding not wasting valuable time.
The STM32 standary library is too low level to start aligning sheets of code only for initialize and toggle one single pin,For this reason the Arduino was perfect choice imo . But it is not useful to tell every Arduino user that he should looking in arduino core or arduino library and see what you can do over there.It looses the argument of using Arduino in the first place.
The thread here is related with code snippets so I think I was ontopic asking for a hint maybe some code than looking in maple library and see what you can find over there.
If you/anybody doesn’t know how what to do it or where to look, is not a shame.Of course Instead of continuing my project in arduino I need so check hot to modify maple library.
As I said before ,…thanks anyway.
GrumpyOldPizza Thu May 19, 2016 11:46 am
miki wrote:The RF module is not relevant for this discussion but it is not a secret.The 2.4Ghz A7105 uses 3wires spi ,SDIO pin is bidirectional.
There is some examples but use different STM32 chip with standard STM32 periph. library.I want to use with arduino with an STM32F103
http://www.ba0sh1.com/2014/05/31/howto- … plex-mode/
racemaniac Thu May 19, 2016 12:02 pm
miki wrote:So you don’t know how to do it.
Anyway thanks.
miki Thu May 19, 2016 12:11 pm
I know that but GIO1 and GIO2 pin are busy with control PA/LNA so they are not available.
Thanks.
And It is not doing for me it is doing for us all Improving arduino spi code with half duplex bidirectional feature from the people who knows best the maple library and STSM32 “nuts and bolts”.
@WereCatf
If you don’t want(not payed,sick with your life whatever)or Arduino is not complete say you can’t , no need to offend me.I’m not a kid.I have a bigger arduino project in avr and I want to port it in STM32,I don’t want to use make file with STM32 standard libraries and a wrapper for Arduino files I have.If possible ok if not, it is my problem.
@racemaniac
I will do some tests when I get home. Thanks.
GrumpyOldPizza wrote:miki wrote:The RF module is not relevant for this discussion but it is not a secret.The 2.4Ghz A7105 uses 3wires spi ,SDIO pin is bidirectional.
There is some examples but use different STM32 chip with standard STM32 periph. library.I want to use with arduino with an STM32F103
http://www.ba0sh1.com/2014/05/31/howto- … plex-mode/
GrumpyOldPizza Thu May 19, 2016 12:22 pm
miki wrote:I know that but GIO1 and GIO2 pin are busy with control PA/LNA so they are not available.
miki Thu May 19, 2016 12:30 pm
Yes that half true but you forget the second part,
I think in the end I will stick with bitbanging.
GrumpyOldPizza Thu May 19, 2016 12:33 pm
miki wrote:Yes that half true but you forget the second part,
I think in the end I will stick with bitbanging.
miki Thu May 19, 2016 12:41 pm
First half and second half
miki wrote:
And It is not doing for me it is doing for us all Improving arduino spi code with half duplex bidirectional feature ……from the people who knows best the maple library and STSM32 “nuts and bolts”.
mrburnette Thu May 19, 2016 1:16 pm
miki wrote:The RF module is not relevant for this discussion but it is not a secret.The 2.4Ghz A7105 uses 3wires spi ,SDIO pin is bidirectional.
There is some examples but use different STM32 chip with standard STM32 periph. library.I want to use with arduino with an STM32F103
http://www.ba0sh1.com/2014/05/31/howto- … plex-mode/
<…>
How can be implemented this one if possible. Bitbanging is the last option.
Sign in to reply