Main Menu

search

You are here

FONA-3 project

[last updated: 2020-02-04]
go to: FONA-2 project page
go to: FONA home page
-----

  • This project uses the Adafruit 808 breakout (PID: 2542) with two Arduino Teensy's, one for the FONA interface, and one for the "basement monitor" interface to sensors.
  • First attempt to breadboard:
    FONA Teensy loaded with TeensyFONA-01.ino
  • First power on, Teensy "does not find FONA."
    • PJRC site recommends to NOT use SoftwareSerial, but to use the Teensy UART instead.
      It says the UART is completely separate from and can be used at the same time as the USB port
    • However if you are going to use SoftwareSerial, (link to:) here are PJRC suggestions to make it work.
  • Possible Problem: FONA module uses 5v. But Teensy inputs only accept 3.3v. It may be that I risk or have already damaged the Teensy Rx and/or Tx pins 10 & 11 by direct connecting to FONA.
      Searching documentation, I discovered that connecting a 3v reference voltage to the FONA Vio pin will convert its Tx & Rx levels to 3v, so I did that, however it still didn't work. Don't know at this time if/how I will check the Teensy I/O pins to see if I've damaged them...
  • Using Teensy hardware serial ports:
    • (link to:) PJRC instructions
    • from forum tips: (link to:) pjrc forum
      • "Serial1 and Serial2 have hardware FIFO queues that help reduce the requirements that the Teensy be ready to accept an interrupt when a character is available. If you expect to receive a lot of input, you want to use those two serial ports. The other 4 serial ports do not have the FIFOs, and so won't be able to receive input as fast.
      • In addition, if the hardware you are connecting to the Teensy supports RTS (request to send) and CTS (clear to send), you want to use that. Transmit enable, RTS, and CTS are hardware flow control bits that control the flow of data if the Teensy cannot process it fast enough. Note, Serial4 does not support using CTS.
      • For each serial device the pins for receive, transmit, and CTS are fixed. RTS and transmit enable can be any digital pin. Serial1 can have alternate pins for receive, transmit, and CTS (but these pins are fixed also). You can get more information from this page: (link to:) pjrc.com
    • from forum: (link to:) pjrc forum
      • For reliable high speed serial (not USB) between boards, the 2 keys to success are RTS/CTS flow control and FIFOs.
      • On Teensy 3.6, only Serial1 & Serial2 have FIFOs. All the serial ports on Teensy 4.0 have FIFOs.
      • Only some ports have CTS pins available. Also, I'm not sure of the status of RTS/CTS flow control on Teensy 4.0. Kurt wrote that code and I recall there was a caveat about flow control. I have not yet tested it.
      • Without RTS/CTS flow control, you have to be extremely careful about the timing your code uses to read the incoming data. While that is theoretically possible, in practice it's so incredibly difficult and so prone to breakage if you later modify your code that I would not recommend attempting fast baud rates (over ~500 kbits/sec) without RTS/CTS flow control.
      • Of course, good quality wires are required between. For high speeds, it's best to use CAT5 or CAT6 cable, where each twisted pair has a single signal and ground. That works out nicely, because you get 4 pairs in those cables and you need 4 signals when RTS & CTS are added. Many people who've run into problems neglected ground wires. The faster you run, the more important good ground wires are.
      • On Teensy 4.0, max baud rate is 6 Mbit/sec. All 7 serial ports are identical hardware on Teensy 4.0. But if you value your sanity, I'd highly recommend setting the baud rate on both sides to something fairly slow, like 250000 or 500000, as you work on getting everything else running properly. Then later try increasing the speed, when you know your code is correct and your hardware is wired properly. Pushing the speed limits while you're still troubleshooting everything else is a sure recipe for frustration.
      • The Teensy does not actually become a serial device until your sketch is running, so you must select the serial port (Tools -> Serial Port menu) after your sketch begins.

.

.

.

eof