Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: intermittent problem with Serial and Serial3 reads

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    1

    intermittent problem with Serial and Serial3 reads

    Hi -- I'm having an issue using teensy3.0 and teensyduino. The teensy is talking to a laptop using the named "Serial" port (connected via USB) and it also communicates with another peripheral over the Serial3 port. I've found that the teensy fails to read from the peripheral device -- it does not see anything in the Serial3 buffer. This happens if the laptop is attempting to send data to the teensy *or* if the peripheral sends more than ~9120 bps to the teensy. So I can seemingly fix the problem by eliminating the laptop -> teensy comms or by reducing the amount of data sent by the peripheral below ~9120 bps. Both Serial and Serial3 are operating at 57600 baud.

    I thought that Serial and Serial3 are running on (effectively) separate hardware, so there'd be no issue using both serial ports, is that correct? Could this be too much interrupt overhead? Too much processing occurring on the teensy? Is there a way to examine the CPU load on an ARM core like this? Appreciate any ideas or advice..thanks.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,174
    Quote Originally Posted by mattball2 View Post
    I thought that Serial and Serial3 are running on (effectively) separate hardware, so there'd be no issue using both serial ports, is that correct?
    Yes, both have on-chip hardware.

    Could this be too much interrupt overhead?
    Unlikely. 9120 bits/sec is very slow. Several people have managed 1 Mbit/sec speeds in real projects, so this is only 1% of the type of speeds that should be feasible.

    Too much processing occurring on the teensy?
    You didn't post any code or other details, so how could anyone know if you're doing too much processing?

    Please read these guidelines for posting tech questions on this forum.

    http://forum.pjrc.com/forums/3-Techn...-amp-Questions

    Is there a way to examine the CPU load on an ARM core like this?
    No, not easily. It is possible to put digitalWriteFast() calls in the interrupt routines and watch the pulses on an oscilloscope or fast logic analyzer. You can also do similar things in the main program, like setting a pin low while you're calling Serial3.avaialble(), and high when it returns non-zero, then low again after moving the data.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •