I'm interested in some reasonable options for using RF to communicate with an MCU. This is something that might become a project of some sort.
We have
are there others? The WiFi is not too complex but might have more overheads, like not idea for "real time" with sockets and so on to deal with. The nRF might have less overheads (software stack, power consumption, I don't know) and might be better for a more "real time" kind of mechanism.
There are some articles about using nRF2401 with STM32 all over the place, this seems good for example:
https://embeddedexpert.io/?p=870
But are there other options too? other devices? other RF bands?
A little about the overall objective, this is just an idea something I may or may not actually try to do.
Devise a system of hardware/software that can run on on an STM32 board and which enables a remote station (i.e. my desktop PC) to manipulate the boards peripherals remotely.
Like have abstractions on the desktop PC (probably developed in .Net/C#) that allows a desktop app to setup, configure and use peripherals on the STM32 board as if they were local.
In other words program the board by running remote code that manipulates the board at a low level.
This is just a very vague outline, clearly we can't expect code running on the desktop to perform as well as code running locally, it is just an idea at this point.
In principle setting up and reading data on the STM32 via an A/D converter, could be done remotely, if there was a messaging system setup so that the remote PC could - in effect - setup board peripherals via messages, e.g. we could have a message that represents actions like:
So the remote PC could send a set of messages (or some single message that combines several actions) that when received by the board cause it to execute such statements as
This could all be encapsulated in a short message, every setting could be contained in the message so one message results in the board doing that setup step.
This is purely something I see a technical experiment, not advocating it as a serious or generally useful thing, but a pet project that might be fun to play around with.
Are there other options for the comms besides nRF or WiFI?
Here's one I just stumbled upon:
https://www.st.com/resource/en/user...radio-for-stm32-nucleo-stmicroelectronics.pdf
We have
- WiFi
- nRF24L01
are there others? The WiFi is not too complex but might have more overheads, like not idea for "real time" with sockets and so on to deal with. The nRF might have less overheads (software stack, power consumption, I don't know) and might be better for a more "real time" kind of mechanism.
There are some articles about using nRF2401 with STM32 all over the place, this seems good for example:
https://embeddedexpert.io/?p=870
But are there other options too? other devices? other RF bands?
A little about the overall objective, this is just an idea something I may or may not actually try to do.
Devise a system of hardware/software that can run on on an STM32 board and which enables a remote station (i.e. my desktop PC) to manipulate the boards peripherals remotely.
Like have abstractions on the desktop PC (probably developed in .Net/C#) that allows a desktop app to setup, configure and use peripherals on the STM32 board as if they were local.
In other words program the board by running remote code that manipulates the board at a low level.
This is just a very vague outline, clearly we can't expect code running on the desktop to perform as well as code running locally, it is just an idea at this point.
In principle setting up and reading data on the STM32 via an A/D converter, could be done remotely, if there was a messaging system setup so that the remote PC could - in effect - setup board peripherals via messages, e.g. we could have a message that represents actions like:
Code:
__GPIOC_CLK_ENABLE();
__ADC1_CLK_ENABLE();
gpioInit.Pin = GPIO_PIN_1;
gpioInit.Mode = GPIO_MODE_ANALOG;
gpioInit.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOC, &gpioInit);
HAL_NVIC_SetPriority(ADC_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(ADC_IRQn);
ADC_ChannelConfTypeDef adcChannel;
g_AdcHandle.Instance = ADC1;
g_AdcHandle.Init.ClockPrescaler = ADC_CLOCKPRESCALER_PCLK_DIV2;
g_AdcHandle.Init.Resolution = ADC_RESOLUTION_12B;
g_AdcHandle.Init.ScanConvMode = DISABLE;
g_AdcHandle.Init.ContinuousConvMode = ENABLE;
g_AdcHandle.Init.DiscontinuousConvMode = DISABLE;
g_AdcHandle.Init.NbrOfDiscConversion = 0;
g_AdcHandle.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
g_AdcHandle.Init.ExternalTrigConv = ADC_EXTERNALTRIGCONV_T1_CC1;
g_AdcHandle.Init.DataAlign = ADC_DATAALIGN_RIGHT;
g_AdcHandle.Init.NbrOfConversion = 1;
g_AdcHandle.Init.DMAContinuousRequests = ENABLE;
g_AdcHandle.Init.EOCSelection = DISABLE;
HAL_ADC_Init(&g_AdcHandle);
Code:
g_AdcHandle.Instance = ADC1;
g_AdcHandle.Init.ClockPrescaler = ADC_CLOCKPRESCALER_PCLK_DIV2;
g_AdcHandle.Init.Resolution = ADC_RESOLUTION_12B;
g_AdcHandle.Init.ScanConvMode = DISABLE;
g_AdcHandle.Init.ContinuousConvMode = ENABLE;
g_AdcHandle.Init.DiscontinuousConvMode = DISABLE;
g_AdcHandle.Init.NbrOfDiscConversion = 0;
g_AdcHandle.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
g_AdcHandle.Init.ExternalTrigConv = ADC_EXTERNALTRIGCONV_T1_CC1;
g_AdcHandle.Init.DataAlign = ADC_DATAALIGN_RIGHT;
g_AdcHandle.Init.NbrOfConversion = 1;
g_AdcHandle.Init.DMAContinuousRequests = ENABLE;
g_AdcHandle.Init.EOCSelection = DISABLE;
HAL_ADC_Init(&g_AdcHandle);
This is purely something I see a technical experiment, not advocating it as a serious or generally useful thing, but a pet project that might be fun to play around with.
Are there other options for the comms besides nRF or WiFI?
Here's one I just stumbled upon:
https://www.st.com/resource/en/user...radio-for-stm32-nucleo-stmicroelectronics.pdf