Git Product home page Git Product logo

Comments (5)

billroy avatar billroy commented on September 14, 2024

Thanks for your observation. I wouldn’t be at all surprised if the time it takes for digitalWrite has changed since I timed those out on my scope.

-br

On Jan 29, 2014, at 9:09 AM, Matthijs Kooijman [email protected] wrote:

When using the software serial support, using:

baud(2, 19200)
print #2, "abcd"
My USB TTL converter receives garbage. Running at 9600 works, but at higher speeds (I also tried 14400) it fails. When I raise the bitrate a bit (on the bitlash end), things start to work. Setting 20100 in bitlash and 19200 in my TTL adapter seems to work reliably.

This seems to suggest that the delay employed by the softwareserial is slightly too high (since a higher baudrate causes a lower delay). I guess the bittime calculation should account for more than 50 clockcycles overhead? 50 cycles of overhead seems a lot already, but I think that it's mainly the digitalWrite that takes a long time...

bittime[pin] = (1000000/baud) - clockCyclesToMicroseconds(50);
Note that I'm running on GCC 4.8, which might also cause differences in overhead...


Reply to this email directly or view it on GitHub.

from bitlash.

matthijskooijman avatar matthijskooijman commented on September 14, 2024

Yeah, likely. It's hard to do these things right unless you do handcoded ASM, but then you again lose the Arduino provided abstractions. Not a big deal though, I just wanted to report this now to prevent thinking later that the changes I'm working on broke this ;-p

from bitlash.

matthijskooijman avatar matthijskooijman commented on September 14, 2024

Here's my work so far: https://github.com/Pinoccio/library-bitlash/commits/printstream

In addition to using the Print and Stream classes, also some (seemingly) old stuff is removed and I touched some other things I came across. The second to last commit (Pinoccio@e91dd2a) is the most important one.

Right now, there is still a considerable size increase, with the bitlashdemo example on the Mega2560, the program size goes from 17,922 to 18,592 and the memory size from 5,839 to 5,870. I'm still looking as to where this increase comes from exactly to see if some of it might be avoided.

I have tested this on Arduino 1.5.5+ (git master), haven't tried 1.0.x yet (but I didn't want to keep you waiting for that :-D).

from bitlash.

billroy avatar billroy commented on September 14, 2024

I took a quick look. You’re certainly making fast work.

FYI, the Teensy and Avropendous defines will need to stay.

-br

On Jan 29, 2014, at 10:55 AM, Matthijs Kooijman [email protected] wrote:

Here's my work so far: https://github.com/Pinoccio/library-bitlash/commits/printstream

In addition to using the Print and Stream classes, also some (seemingly) old stuff is removed and I touched some other things I came across. The second to last commit (Pinoccio/library-bitlash@e91dd2a) is the most important one.

Right now, there is still a considerable size increase, with the bitlashdemo example on the Mega2560, the program size goes from 17,922 to 18,592 and the memory size from 5,839 to 5,870. I'm still looking as to where this increase comes from exactly to see if some of it might be avoided.

I have tested this on Arduino 1.5.5+ (git master), haven't tried 1.0.x yet (but I didn't want to keep you waiting for that :-D).


Reply to this email directly or view it on GitHub.

from bitlash.

matthijskooijman avatar matthijskooijman commented on September 14, 2024

W00ps, these comments ended up in the wrong issue. I'll copy them over to the right one, feel free to delete them from here afterwards.

from bitlash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.