I need second and maybe even third uart modules (for rs232). Is there any sample code like in Arduino (Software uart)?
I need second and maybe even third uart modules (for rs232). Is there any sample code like in Arduino (Software uart)?
if you're using the softdevice then bitbanging anything which requires accurate timing like UART just doesn't work. This is why little or no sample code exists for that, you just can't really do it.
I'm with RK, if you ever use radio (and if not then it's question why using nRF5x at all;) then look for external RS232 multiplexor attached over SPI or I2C or something similar. Bitbanging anything in SW is dead-end (it might work outside BLE connection but once you have link established it will go down soon).
The main reason why I use nrf52832 is to have ability to do OTA DFU. Because I sell my devices that can be far away from me more than 1000km. I understand use software uart for nrf52 is not good idea, so I think it's ok to use multiplexers. I've found max14830 it can work via spi or i2c and extend to 4 additional uart. But the price more in 10 times than for example very popular stm32f103 that has 3 uart and a lot of other additional futures.So my question now. Is it good decision to use other cheap mc for extend abilities of main chip(nrf52832). And one more question, can I in that case update both of my mc over air? I know most Chip's booloader support DFU via uart, but will I be able do it via i2c or spi.
Well the rule says: as long as there is a wire and chip supports any form of FW update then you can do it. Most of these extenders don't support anything like that (why would you do it if it has fixed functionality in ROM) but if it can do it then you can always implement the protocol over BLE and then over UART/SPI/I2C/whatever. But if you expect this being written for you then I'm afraid you will be disappointed, this is job to be done;)
if the only thing you're using Bluetooth for is OTA update and you're not using Bluetooth in your application, then you may well be able to bitbang a UART. You turn BLE on only for OTA (and don't run peripherals) and when you're running in the 'normal' state, you don't even enable the softdevice.
So one question is why you need more than one UART. What are you interfacing to? UART interface tend to be used just with a USB/UART chip for a simple console out for debugging, most other peripherals people generally want to connect to have other, better, interfaces.