Force enabling of usart on MDBT42Q breakout?

Posted on
  • I have a project where the MDBT42Q module will listen to a serial port and parse the data, due to this the state of the RX pin can be either gnd or 3v3 depending on whats on the line when starting. There is no way to make sure that the pin is high when the MDBT42Q module starts.
    So is there a way to change this behaviour?
    Can it be done from the JS code?
    Or can it be done by doing a new FW where this test is removed?

  • Both ways are possible, I tried both of them. just run Serial1.setup(9600,{rx:D8,tx:D6}); yourself at startup to always enable it. Right rx,tx pins are mentioned e.g. here

    Removing that test shrinks firmware a bit and makes it more deterministic so that may make sense too. Also when it gets detected automatically the Serial1 object is missing ._options like when you run .setup() so you don't know the speed or that it is in fact enabled so that's another reason to setup it yourself so you know its state later in the code (e.g if you want to turn it off to save power and then back on when connection or traffic is detected like done here)

  • Adding the Serial1.setup to the init section seam to work. Thank you

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Force enabling of usart on MDBT42Q breakout?

Posted by Avatar for JohanWinas @JohanWinas

Actions