Comments (14)
I tested this today, but could not reproduce the problem. Since I don't have your serial keyboard, I used Serial1 to transmit to AltSoftSerial. I just put a Teensy 3.2 on a breadboard and connected a wire from pin 1 to pin 20.
Here's the code I tested.
#include <AltSoftSerial.h>
AltSoftSerial keyin;
void setup() {
keyin.begin (9600); // Keyboard Console Serial Receive (Pin 20)
Serial.begin(9600);
Serial1.begin(9600); // connect wire from pin 1 (TX1) to pin 20 (AltSoftSerial RX)
}
elapsedMillis msec = 0;
void loop() {
if (msec > 1000) {
msec = 0;
Serial1.write(127);
}
if (keyin.available() > 0) {
byte keyinData = keyin.read();
Serial.println(keyinData);
}
}
Can you please verify you're using the latest AltSoftSerial version?
The ZIP file on the web page was an old, out of date version. I've removed it. The copy in Teensyduino 1.26 and here on github is the latest code.
from altsoftserial.
Dear Paul,
I have tested your code with the latest teensy-software, the latest altsoft-version and 4 different teensy 3.2s. Your code works fine.
But...
..as soon as I change the value "127" to "129" the chaos begins. The first reading in the serial monitor is the correct "129" and then it goes on with "224" (in my case here).
Alternatively I have tested your code with Serial3 (instead of altsoft) and values above "128" and here it works great.
Thank you,
Alexander
PS.: I really appreciate the things you are doing. Thank you for that!
from altsoftserial.
Hi Paul,
I wonder if you could reproduce the issue with your teensies when sending values above 129?
Thank´s
Alexander
from altsoftserial.
Before I look at this again, I want you to verify a few things on your end.
First, make sure you are using the latest Arduino 1.6.7 and Teensyduino 1.27-beta1. Use Help > About to check which version you are running. Please do not report issues here with anything other than the very latest version. Testing with old versions only risks reporting previously-fixed issues, which is just a waste of everyone's time.
Next, use File > Preferences to turn on verbose info while compiling. Then click Verify. A lot of info will print. Scroll up. You'll see a summary that shows the full pathname for the AltSoftSerial library Arduino actually compiled. You must check to make sure it's really using the latest copy. If place a copy in Documents/Arduino/libraries, it will override the one from Teensyduino. Before you ask me to do anything more, check that you're truly using the copy from Teensyduino 1.27-beta1. If you previously installed this into your libraries folder, you may be using the same old copy with issues that were fixed long ago.
With those checked, use the exact code I posted above. Click "Verify", and then tell me the exact summary which prints (the amount of memory used). I also need to know which operating system you're using.
Please do these steps before asking me to look at this yet again!
from altsoftserial.
Hi Paul,
sorry if I only said that I used the latest software. To be more precise I use:
Arduino: 1.6.7
AltSoftSerial: 1.3.0 (yes, it´s used if I look at "verbose")
Teensy SW: 1.27 beta 1 (tried it at 1.26, too - same effect)
Teensy 3.2; on all CPU speeds
Microsoft XP SP3
The summery is:
Sketch uses 17,932 bytes (6%) of program storage space. Maximum is 262,144 bytes.
Global variables use 4,816 bytes (7%) of dynamic memory, leaving 60,720 bytes for local variables. Maximum is 65,536 bytes.
I can confirm your code works great.
BUT: It does not work as soon as the sent value is changed from 127 to 129 and above. That is the issue. I need to receive values up to 180.
I am happy to get your advice.
Thank you for your time,
Alexander
from altsoftserial.
I can confirm this.
It is indepenend from the Baudrate, as soon as Bit 7 (the first) is set, it does not work.
But transfering 0 does not work too (output is 255). Tested with your (Paul's) Sketch from above. An issue with the first databit-edge(?)
from altsoftserial.
sorry, NOT independend. 1200 BAUD : Output 255 for a sent 0, 9600 Baud: the firstreceived Byte is 1, all following 192.
from altsoftserial.
0 works for 14400 and above, values >127 still not.
from altsoftserial.
One Bug is: for slow baudrates we have overflows on the 16 Bits values. Fix: Use a prescaler. This fixes the "0"-receiving problem. However, the problem when bit 7=1 still exists.
A prescaler value of 32 is good for 1200..200,000 Baud. So it could be fixed to 32 for Teensy 3.x with if #idef..
from altsoftserial.
Frank, thank you for your confirmation. At least I am not the only one and I appreciate all your guys´ help.
Cheers,
Alexander
from altsoftserial.
I'm digging into this today. The problem with values > 128 on Teensy 3.x seems to be a bug in setting compare B. The ISR(COMPARE_B_INTERRUPT) isn't happening at the right time, or at all. Still not sure why.....
from altsoftserial.
I've fixed several subtle bugs and added support for slower baud rates.
Please give the latest code a try and let me know if it resolves this issue for you?
from altsoftserial.
Great - thank you for your time, work and expertise. I am sorry that due an extended business trip I am not able to test it now. I´ll come back to you ASAP then.
from altsoftserial.
I'm pretty sure the recent fixes solve this problem, so I'm closing this issue.
If there's still a problem, please open a new issue. Remember to always post code & hardware details necessary to reproduce the problem.
from altsoftserial.
Related Issues (20)
- Arduino Robot HOT 5
- Problems with Arduino Nano HOT 1
- Bump version number
- Replacing Softwareserial by Altsoftserial HOT 1
- Lost answers UART HOT 4
- Elimininate 'unused parameter' warnings HOT 5
- Conflict with Servo: Multiple definitions HOT 6
- RX Buffer max size is 500byte? HOT 5
- The last two bytes reappear after flushing
- incompatible with nrf52 architecture Adafruit Feather nRF52 Bluefruit LE - nRF52832 HOT 1
- Support Arduino Nano Every HOT 3
- Support for Teensy 4.0 HOT 2
- Implement Inverse flag to invert sense of RX and TX like SoftwareSerial HOT 2
- Couldnt transmit correct data using AltSoftSerial HOT 3
- Support Request for Arduino Portenta HOT 1
- Can we use it on NodeMCU? HOT 1
- Add Support for ATMEGA328PB Please HOT 2
- Add Support for STM32F1, STM32F4, please
- Support for .findMulti();
- Add support for renesas_uno architecture HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from altsoftserial.