Software emulated serial using hardware timers for improved compatibility

Overview

AltSoftSerial Library

Improved software emulated serial, using hardware timers for precise signal timing and availability of CPU time for other libraries to respond to interrupts during data AltSoftSerial data transmission and reception.

http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html

AltSoftSerial on Teensy 2.0

If you need very low baud rates, check out SlowSoftSerial by Paul Williamson.

Comments
  • Add Support for STM32F1, STM32F4, please

    Add Support for STM32F1, STM32F4, please

    Description

    STM32F1 and STM32F4 series are not supported

    Steps To Reproduce Problem

    n/a

    Hardware & Software

    Board: BluePill based on STM32F103; BlackPill based on STM32F401/STM32F411 Shields / modules used: BluePill , BlackPill Arduino IDE version: 1.8.19

    Version info & package name (from Tools > Boards > Board Manager): STM32 MCU based boards by STMicroelectronics v2.3.0 Operating system & version WIN10

    Thank you!

    opened by ShaggyDog18 0
  • Add Support for ATMEGA328PB Please

    Add Support for ATMEGA328PB Please

    Description

    Describe your problem.

    Does not appear to have support for ATMEGA328PB.

    Steps To Reproduce Problem

    Please give detailed instructions needed for anyone to attempt to reproduce the problem.

    Just try compiling for ATMEGA328PB

    Hardware & Software

    ATMEGA328PB

    Errors or Incorrect Output

    Error while detecting libraries included by C:\Users\maeso\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp

    opened by maesoph 0
  • Support Request for Arduino Portenta

    Support Request for Arduino Portenta

    Support Request for Arduino Portenta

    The new Arduino Portenta has several UART's if using the Breakout Board but by itself it only has SerialUSB and Serial1 at D13, D14, which would be fine if it were single core but it is a dual core board. Any chance of getting AltSoftSerial working on this board. I would test any changes you suggest.

    I tried #define ARDUINO_AVR_SODAQ_MBILI which would use pins 5, 6 but it errored on #define ALTSS_BASE_FREQ F_CPU

    I will search a bit about that. Any opinions on if this could get running?

    opened by hpssjellis 1
  • Implement Inverse flag to invert sense of RX and TX like SoftwareSerial

    Implement Inverse flag to invert sense of RX and TX like SoftwareSerial

    As a user I need to reverse the sense of the RX and TX lines to communicate with a particular piece of hardware as in SoftwareSerial, but I also need the full-duplex communication support of AltSoftSerial.

    Description

    Please see Pull Request #59

    New feature. Add the Inverse flag to AltSoftSerial Library with appropriate constructors. In the Transmission and Reception code, invert the outputs with the flag is true. When the flag is the default value of false, the code functions exactly as before. The original constructors are unchanged.

    Steps To Reproduce Problem

    New Feature.

    Hardware & Software

    Tested with an Sparkfun RedBoard Arduino Arduino IDE version 1.18.10 Teensyduino version (if using Teensy) 1802 Membership Card running MCSMP20J ROM (with inverse logic on the RX and TX lines) and for regression testing 1802 Membership Card running MCPSMP20A ROM (with positive logic on RX and TX lines)

    Arduino Sketch

    // Change the code below by your sketch (please try to give the smallest code which demonstrates the problem)
    #include <Arduino.h>
    /*
      Serial Connections for 1802 Membership Card MCSMP20J
    
      Arduino Pin     MCard1802
        9 (TX)        /EF3 (RX)   P1 - 27 
        8 (RX)          Q  (TX)   P1 - 12
        GND             GND       P1 -  1 (or P1 - 30)
    */
    
    //Note: SoftwareSerial is *NOT* Full-duplex and won't work here.
    #include <AltSoftSerial.h>
    
    //RX pin 8, TX pin 9, with RX and TX inversion
    AltSoftSerial altSerial(true);
    
    void setup() {
     //Initialize serial for input and debugging
      Serial.begin(115200);
     //Initialize AltSoftSerial for communication to 1802
      altSerial.begin(1200);
      Serial.println("Ready!");
      //Establish communication with <CR>
      altSerial.write('\r'); 
    }
    
    void loop() {
      // If anything comes from Arduino IDE
      if (Serial.available()) {      
        // get the new byte:
        char nextChar = (char)Serial.read();            
        altSerial.write(nextChar);     
       //wait a bit for 1802 to process character sent
       delay(20);
      }
      if (altSerial.available()) {
        // get the new byte:
        char inChar = (char) altSerial.read();
    
        //Mask off high bit
        inChar = (inChar & 0x7F);
       //Write to Arduino Serial Monitor
       Serial.write(inChar);
      } // if altSerial.available
    }
    

    I have submitted pull request #59 to add the support for the inverse argument to the AltSoftSerial library. Merging Pull Request #59 will close this issue.

    opened by fourstix 2
  • Implement Inverse flag to invert sense of RX and TX like SoftwareSerial

    Implement Inverse flag to invert sense of RX and TX like SoftwareSerial

    This pull request implements the inverse flag so that AltSoftSerial inverts the sense of RX and TX similar to the inverse flag in SoftwareSerial library.

    Unlike the earlier pull request from @BikeMike, the inverse flag affects the sense of both the RX and TX pins. The earlier request only inverted the sense of one line, so it was a partial implementation. This pull request is a full implementation.

    This code has been tested with an inverse serial line device, and a device running with the normal sense of the lines. Code that ran fine with AltSoftSerial runs fine with this change.

    I implemented this change because I needed to reverse the sense of the lines to communicate with a particular piece of hardware, but I also need full-duplex communication.

    This change allows me to run AltSoftSerial to achieve those goals.

    opened by fourstix 1
Releases(1.4)
Owner
Paul Stoffregen
Entrepreneur & electrical engineer with 29 years of professional experience and life-long passion for overly ambitious projects
Paul Stoffregen
Unified interface for selecting hardware or software SPI implementations on Arduino platforms

AceSPI Unified interface for selecting hardware or software SPI implementations on Arduino platforms. The code was initially part of the AceSegment li

Brian Park 1 Oct 22, 2021
Minimal bit-bang send serial 38400/115200 baud for 1MHz or 115200/230400 baud for 8 or 16MHz ATtiny clock

Attiny Serial Out Available as Arduino library "ATtinySerialOut" Version 2.0.1 - work in progress Minimal bit-bang send serial 115200 baud for 1/8/16

Armin 35 Jan 4, 2023
An Arduino library with additions to vanilla Serial.print(). Chainable methods and verbosity levels. Suitable for debug messages.

advancedSerial This library provides some additions to vanilla Serial.print(): 1. Chainable print() and println() methods: // you can chain print() a

Vasily Klenov 17 Dec 13, 2022
Easily and asynchronously interact with a serial device requiring call-and-response style commands.

Arduino Managed Serial Device Note This library was formerly less-descriptively named "Arduino Async Duplex" This library allows you to asynchronously

Adam Coddington 20 Nov 20, 2022
Easily and asynchronously interact with a serial device requiring call-and-response style commands.

Arduino Managed Serial Device Note This library was formerly less-descriptively named "Arduino Async Duplex" This library allows you to asynchronously

Adam Coddington 20 Nov 20, 2022
Arduino client for the Serial To TCP Bridge Protocol PC side service

Arduino Serial to TCP Bridge Client Arduino client for the Serial To TCP Bridge Protocol gateway service. Open a TCP connection to a server from the A

Roan Brand 13 Apr 12, 2022
Arduino software emulation of a real-time clock based on the milliseconds timer of the CPU

Clock-Library Arduino software emulation of a real-time clock based on the milliseconds timer of the CPU. The clock works with a resolution of one min

Dirk Ohme 4 Jun 25, 2022
Framework for create a AIO module on NODEMCU using Arduino IDE

AIO MODULE Install Add library Best thing is to use the Arduino Library Manager. Go to Sketch > Include Library > Manage Libraries. Install WebSockets

AIO Robot 3 Mar 29, 2022
ESP32 Temp Alarm using DS18B20, wifi manager, Email alert Threshold

ESP32-Freezer-Alarm ESP32 Temp Alarm using DS18B20, wifi manager, Email alert Threshold. I made this alarm using several tutorials from https://random

null 5 Oct 7, 2022
Arduino library for making an IHC in or output module using an Arduino

Introduction This is an Arduino library for making an IHC in or output module using an Arduino. (IHC controller is a home automation controller made b

Jens Østergaard Nielsen 2 Mar 26, 2020
A simple two-axis gimbal built using two servo motors, an mpu6050 gyro and accelerometer sensor, and an Arduino (Uno)

Makeshift Gimbal Project A simple two-axis gimbal built using two servo motors, an mpu6050 gyro and accelerometer sensor, and an Arduino (Uno). A shor

Sukritee Sharma 2 Jun 17, 2022
Converting CASIO MA-150 as a USB MIDI Input using Arduino uno

Arduino USB MIDI CASIO MA-150 Converting CASIO MA-150 as a USB MIDI Input using Arduino uno Use 74HC595 shift register with arduino uno to accommodate

Shamila Wijekoon 3 Jul 2, 2022
CS202 (2022 Winter) Project: Interacting with "emulated" hardware accelerators

CS202 (2022 Winter) Project: Interacting with "emulated" hardware accelerators Overview Hardware accelerators that implement specialized circuits for

Hung-Wei Tseng 5 Nov 19, 2022
A software serial driver package by using the hardware timer capture / comparison functionality.

Soft serial 1.简介 Soft serial 是利用硬件定时器捕获/比较功能实现软件模拟串口的软件包。 1.1目录结构 Soft serial 软件包目录结构如下所示: soft_serial ├───inc // 头文件目录 │

齐永忠 2 Jul 14, 2022
Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactively receive/edit/monitor data and send commands to an embedded system via the serial bus

See wiki for full documentation Serial Data Monitor Description Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactivel

monnoliv 4 Oct 29, 2021
The function is based on MQTT. When the original serial of ESP8266/ESP32 cannot be used, it can replace serial print.

MqttPrint and MqttMonitor The function is based on MQTT. When the original serial of ESP8266/ESP32 cannot be used, it can replace serial print. MqttPr

fw-box 4 Sep 28, 2022
John Walker 24 Dec 15, 2022
VGG Runtime for loading design and running emulated apps.

VGG Runtime A design engine capable of loading design drafts as well as running design as an emulated app. Features Game-engine-like ECS architecture

Very Good Graphics 21 Nov 24, 2022
Modern concurrency for C++. Tasks, executors, timers and C++20 coroutines to rule them all

concurrencpp, the C++ concurrency library concurrencpp is a tasking library for C++ allowing developers to write highly concurrent applications easily

David Haim 1.2k Jan 3, 2023
timers and timeline

⏱ Timer and Timeline Utils for C This library provides an easy way to set timers and timeouts. As initial version all timers run in single runloop at

Recep Aslantas 34 Aug 3, 2022