💬 MySensors RFM69W serial GW(ATMEGA328P)




  • Admin

    :thumbsup: Nice!


  • Hero Member

    The cp2102 is a good choice: you can upload at a faster speed than you can with an FTDI.


  • Hardware Contributor

    @NeverDie said:

    you can upload at a faster speed than you can with an FTDI.

    I studied this question and knew that FTDI is more faster than CP2102....
    0_1484941697457_Speed.jpg


  • Hardware Contributor

    I chosed CP2102 mainly for the low component count which is needed to create a simple usb to serial converter. The baudrate is sufficient enough for the most of the projects imho.


  • Hardware Contributor

    @mtiutiu said in 💬 MySensors RFM69W serial GW:

    I chosed CP2102 mainly for the low component count which is needed to create a simple usb to serial converter

    As for me, i chose CP2102 because he has On-chip voltage regulator 3.3V.


  • Hardware Contributor

    I won't rely on the integrated voltage regulator because usually it's not capable to supply high currents. As I've seen on other USB to serial converter chips the current capability of the integrated voltage regulator is about 50mA or so(maybe some can provide up to 100mA). Anyway if using NRF24l01 radios and small current LEDs then maybe it won't be an issue but I wouldn't count on it on the long term. Radio module + microcontroller + LEDs + other components can reach the 50mA limit especially when using RFM69W or HW variant. Now I know that the TX period may be short and only the average drawn current matters in the end but still I won't take it to the near limits. Just my 2 cents here.


  • Hero Member

    @mtiutiu
    I agree. According to the schematic, you do use the MCP1703A-3302 as a voltage regulator, which is rated to 250ma. It seems that many problems are easily avoided when there's a more than ample power source.

    Also, for whatever reason, the Arduino IDE doesn't seem to support the highest baud rate that's apparently possible with the FTDI. It does though with the CP2101.


  • Hardware Contributor

    Hi,

    Today I managed to finish this project: hardware assembly and initial serial gw sketch upload and I get I_GATEWAY_READY from serial console so everything seems to be in order. I need to perform some more tests though with some nodes attached and see the messages coming in and out but so far it seems very promising. I didnt' soldered the LEDs yet but that's not so important for now :simple_smile: .

    CP2102 usb to serial converter chip working(first line from usb devices listing):

    mtiutiu@mtiutiu-H67MA-USB3-B3 ~/Work/AVR_Playground/sensors_network/project/SerialGateway $ lsusb 
    Bus 002 Device 015: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
    Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 005: ID 045e:0779 Microsoft Corp. LifeCam HD-3000
    Bus 001 Device 004: ID 1bcf:0005 Sunplus Innovation Technology Inc. Optical Mouse
    Bus 001 Device 003: ID 046d:c31c Logitech, Inc. Keyboard K120
    Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    

    Code uploading using arduino serial bootloader POC:

    mtiutiu@mtiutiu-H67MA-USB3-B3 ~/Work/AVR_Playground/sensors_network/project/SerialGateway $ platformio run --target upload
    [Tue Feb 14 17:48:38 2017] Processing pro16MHzatmega328 (upload_protocol: arduino, build_flags: -I./lib/MySensors, lib_ignore: MySensors, board_f_cpu: 16000000UL, platform: atmelavr, board: pro16MHzatmega328, framework: arduino)
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Verbose mode can be enabled via `-v, --verbose` option
    Collected 69 compatible libraries
    Looking for dependencies...
    Library Dependency Graph
    |-- <SPI> v1.0
    Looking for upload port...
    Auto-detected: /dev/ttyUSB0
    Uploading .pioenvs/pro16MHzatmega328/firmware.hex
    
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude: Device signature = 0x1e950f (probably m328p)
    avrdude: reading input file ".pioenvs/pro16MHzatmega328/firmware.hex"
    avrdude: writing flash (13122 bytes):
    
    Writing | ################################################## | 100% 3.96s
    
    avrdude: 13122 bytes of flash written
    avrdude: verifying flash memory against .pioenvs/pro16MHzatmega328/firmware.hex:
    avrdude: load data flash data from input file .pioenvs/pro16MHzatmega328/firmware.hex:
    avrdude: input file .pioenvs/pro16MHzatmega328/firmware.hex contains 13122 bytes
    avrdude: reading on-chip flash data:
    
    Reading | ################################################## | 100% 3.00s
    
    avrdude: verifying ...
    avrdude: 13122 bytes of flash verified
    
    avrdude: safemode: Fuses OK (E:00, H:00, L:00)
    
    avrdude done.  Thank you
    

    MySController serial gw connection and startup ok message:

    0_1487087715787_MYSController_serial_gw.png


  • Hardware Contributor

    Serial gw is working. Tested with real MySensors nodes and it's working properly. Now regarding stability and such - well...that only time will tell us.


  • Hardware Contributor

    Hello, what is the goal of the TXB0104, it's the first time that i see him in a project ?


  • Hardware Contributor

    @tonnerre33

    It's a logic level voltage converter. The MCU runs at 5V so the logic level voltage that it uses on the SPI port which connects to the RFM69W use 5V too. But the RFM69W module runs at 3.3V and it's not 5V tolerant on its SPI port pins.

    The purpose of that IC is to convert voltage levels on the SPI lines forward and backward (from 5V to 3.3V and vice versa) in order to not damage the RFM69W chip.


  • Hardware Contributor

    @mtiutiu said in 💬 MySensors RFM69W serial GW(ATMEGA328P):

    Oh ok, and just for know, why we don't power the atmega with 3.3V ?


  • Hardware Contributor

    @tonnerre33
    Because at 3.3V the atmega328p mcu can run at max 8MHz as per datasheet. So I wanted it to run at double the speed and for that it needs 5V as per datasheet again. Why at 16MHz? Well because I want the gateway to be more faster in general and to quickly process the incoming messages from the entire radio network.


  • Hardware Contributor

    Thanks a lot, now i know why ;)


  • Hardware Contributor

    @tonnerre33

    And to use higher baudrates for the serial port on the mcu also. To achieve higher baudrates you need a higher mcu clock frequency too.



  • Does anyone have a BOM for this?


  • Hardware Contributor

    @shabba
    Sorry but I don't have one now. When I have time I will generate it. For now I'm busy with the Livolo stuff.


  • Hardware Contributor

    0_1494000655324_upload-1cfecb9c-1343-4411-a8c4-b4546cd9a63e

    A fast extraction without traitment if that can help ;)



  • I see C5 on the board has polarity. My ceramic caps seem to have no polarity (no markings on it - https://www.digikey.com/product-detail/en/murata-electronics-north-america/ZRB18AR61E106ME01L/490-10991-1-ND/5321192).
    I assume that this is ok and this does not need to be a tantalum cap?

    Thanks.


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.