Level Shifter for RFM69
I've stumbled about the level shifters recommended here: https://www.mysensors.org/build/connect_radio
I've ordered ones that are similar to these and tried to get some details. I suppose they are a clones of these boards : https://www.adafruit.com/products/757
With a BSS138 chip?!
In the description I found:
While we designed it for use with I2C, this works as well for TTL Serial, slow <2MHz SPI, ...
A look in the MySensors library shows:
So the SPI on a 16 MHz Arduino is running with 4 MHz and above what the level shifter is capable to do.
Anybody thought about that? I suppose it is working?!
@TimO You have got a good point there. It will probably work but the potential for problems is there. Most of these boards have 10Kohm resistors (large RC) and therefore not suited for high speeds. Better to avoid... but it seems to work for most..
on my side doing this in the opposite way when i can, : 3v because most of the sensors are using 3v, also the radio, mcu consumes less etc... and if i need something higher voltage (adc, relays etc..u i use an additional power supply, and level shift what needed. I'm saying this because I'm using rfm69, not 5v tolerant, so if i begin to levelshift the radio, 3v sensors on i2c etc for only one 5v peripheral, then pain begin etc.. it depends of the application sure. If it's not related to clock, and it's something like i want to use a nano instead of a mini, perhaps not the best choice.
That's personal opinion of course!
@scalz Good idea, but building a RFM69 gateway is more complicated this way:
- Serial Gateway: Nano/Uno + RFM69 needs a level shifter
- Ethernet Gateway: Arduino Pro Mini (8 MHz) + W5100 + RFM69 would all work fine with 3.3 V, but soft spi is not available yet
So, do I build a selfmade 8 MHz serial gateway or do I try to implement soft spi? If I want to use out of the box arduinos (Uno, Nano ..) for a serial gateway I have to go with the level shifter.
I suppose this only is a theoretical problem because there are users with a working setup!
When the level shifters arrive from china I will give them a try and maybe reduce the spi clock speed to see if there is a change in the behaviour.
@TimO I have 3 nodes (incl. gateway) with this level shifters running and don't see any problems so far. I recently switched all of my nodes from nrf's to rfm69's and had to make 'adaptor' pcb's to connect rfm's, for 3v nodes this 'adaptor' is trivial and for 5v nodes it uses 4ch level shifter from aliexpress. MISO, MOSI, SCK and NSS goes through shifter and D2(IRQ) pin connected directly
A good reason to dust of my scope and do some testing. Not a perfect setup but enough to come to the conclusion that the level shifters can be used up to 8 MHz..
This one is a cheap generic china mosfet converter with 10K resistors. The yellow is on SCK on the "high" side blue is converted to "low". No signs of signal deterioration. (The overshoot is mainly caused by long cables and connectors). So, no worries..
Amazing! Thank you @AWI!