element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
microbit
  • Learn
  • Learning Center
  • STEM Academy
  • microbit
  • More
  • Cancel
microbit
microbit Forum Some garbled serial comms from Micro:bit
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join microbit to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 7 replies
  • Answers 1 answer
  • Subscribers 48 subscribers
  • Views 1990 views
  • Users 0 members are here
Related

Some garbled serial comms from Micro:bit

pmulvey
pmulvey over 1 year ago

My Serial writes are garbled when sent out to TeraTerm terminal program but Ok when viewed on the Serial monitor. Characters get dropped. This is quite useless as I want my class to receive the data in Python on the PC. I get this in both micro:bit Python editor and MS Makecode. I have used different micro:bits on different PCs, same result.

I tried Mu Editor and the micro:bit sends data across the serial port perfectly. I'm using V2. Is there an issue with the firmware used by MS Makecode and micro:bit Python editor?

I wrote a short Python program to read the serial port on the PC and I get the same results as with TeraTerm i.e. dropped characters, about 10% only, no major garbling.

 

  • Sign in to reply
  • Cancel

Top Replies

  • pmulvey
    pmulvey over 1 year ago +4 suggested
    Finally an answer: Thanks for contacting the Micro:bit Educational Foundation. When a WebUSB connection is used to send a program directly to micro:bit, MakeCode and the Python Editor stay connected…
  • Gough Lui
    Gough Lui over 1 year ago +2
    Are you sure you are matching the correct baud-rate, parity, bit-length and stop-bits? This needs to match what is used by the program running on the Micro:bit and should match whatever serial monitor…
  • pmulvey
    pmulvey over 1 year ago in reply to Gough Lui +1
    Later I will prepare a full report of what is happening and put code up here etc.
Parents
  • Gough Lui
    0 Gough Lui over 1 year ago

    Are you sure you are matching the correct baud-rate, parity, bit-length and stop-bits? This needs to match what is used by the program running on the Micro:bit and should match whatever serial monitor you were previously using. Common rates include 9600bps, 19200bps, 38400bps, 57600bps and 115200bps (this seems to be a Micro:bit default). Usually 8-bits, no parity, 1-stop-bit is customary.

    Have you ensured compatible flow-control is set? Usually, without dedicated handshaking lines, None should be used. If it is set to XON/XOFF, this could result in some unpredictable behaviour, while setting it to RTS/CTS without the lines connected could inhibit communications entirely.

    Are you only sending printable characters? As there are some escape sequences which can really "stuff up" terminals and cause them to change modes/display garbled data.

    - Gough

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • pmulvey
    0 pmulvey over 1 year ago in reply to Gough Lui

    I have used TeraTerm and Python as the receiver of serial data from ESP, Pi Pico and Arduino and I have seen the garbled output from unmatched serial settings. Interestingly this seems to be down to dropped characters or most likely characters not sent as I don't get hardly any wrong characters. When using the MU Editor and the firmaware that it loads on to the microbit everything is OK, all characters are transmitted fine. I have tried putting a 20mS pause between each character of a string but same result.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Gough Lui
    0 Gough Lui over 1 year ago in reply to pmulvey

    Can you attach example images, code, settings, results etc?

    We can't help you if you can't help us understand the issue you're facing in more detail. I'm not sure what you mean by dropped characters - if it's serial overflow, that is a possibility but still unlikely as serial is "slow" compared to the speed of modern computers.

    - Gough

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Gough Lui
    0 Gough Lui over 1 year ago in reply to pmulvey

    Can you attach example images, code, settings, results etc?

    We can't help you if you can't help us understand the issue you're facing in more detail. I'm not sure what you mean by dropped characters - if it's serial overflow, that is a possibility but still unlikely as serial is "slow" compared to the speed of modern computers.

    - Gough

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • pmulvey
    0 pmulvey over 1 year ago in reply to Gough Lui

    Later I will prepare a full report of what is happening and put code up here etc.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube