Page 1 of 1

Teensy and Modbus

PostPosted: Tue Jul 17, 2018 10:53 pm
by limited660
Has anyone been able to get the code from http://www.machsupport.com/forum/index. ... 105.0.html working on a Teensy? I've set it up on an Uno and anything set as an input shows up as a 1 on the variables table and I'm able to toggle them to 0 by grounding that input but when I load the code on the Teensy, none of the variables toggle or start as a 1. I've tried changing Freq to match the 48MHz of the Teensy and still nothing.

Re: Teensy and Modbus

PostPosted: Wed Jul 18, 2018 3:09 pm
by Robertspark
Which Teensy? There are a few of them?
Also are you installed the Teensyduino addon: https://www.pjrc.com/teensy/teensyduino.html

This is the point that I say that I don't use the arduino IDE any more as you can do things much faster without any syntax errors by graphically programming arduino type boards using Visuino. and if you install Visuino Pro (no extra cost) you can use modbus functionality.
https://www.visuino.com/

Visuino Pro is installed from the Google+ Community

There are a few detailed Visuino + Modbus youtube clips here:
https://www.google.co.uk/search?q=modbu ... 23&bih=408


Visuino costs ~USD $10 which includes 3 months of updates, if you pay another £10, you'll get an additional 12 months of updates, hence the annual cost is ~$10
Visuino Pro will cost more at some point in the future, but at present it is "free" with a standard Visuino licence. (There was talk of a lot of other pro features being added before a separate price is added for the Pro version {such as CANBUS and other features}

You can use Visuino free for a month too.... that should be long enough for you to programme 1 board as an modbus slave.

If you need help let me know and I'll try to help with it.

Re: Teensy and Modbus

PostPosted: Wed Jul 18, 2018 7:35 pm
by limited660
I've been trying on the Teensy LC, it compiles and installs fine and I can see register 50 which is the timer updating but none of the inputs appear to work. When I do the same thing with the Uno, all of the inputs show up as 1 and then change to a 0 when grounded. I've tried tying the input to ground and 3.3v on the Teensy and still nothing, I'm sure its something in the code not recognizing the pins correctly and setting them but I don't really understand how it works yet. I'll give Visuino a try to see if I can get that working. I would like to stay with actual code so I can eventually merge it with my THC - https://www.cnczone.com/forums/general- ... ntrol.html

Re: Teensy and Modbus

PostPosted: Wed Jul 18, 2018 7:42 pm
by Robertspark
Thanks for the link to the thread, looks very interesting

Re: Teensy and Modbus

PostPosted: Wed Aug 08, 2018 8:58 am
by Battwell
im using the basis of that code (slightly modified) running 2 arduinos (megas) it works perfectly on those.
im adding a button control panel to my machine- and using the arduino for all the button/led confirmation i/o
i got it all going over a year ago. one of the arduinos has been communicating with my office pc and uccnc since then- and never failed.
sorry- not tried the teensy.
https://www.youtube.com/watch?v=7-T4hNrYVa4

Re: Teensy and Modbus

PostPosted: Tue Jan 07, 2020 9:34 pm
by thesleepydog
im using the basis of that code (slightly modified) running 2 arduinos (megas) it works perfectly on those.


Hi Battwell,

Not sure if you are still active in the forum, I have seen your youtube implementation and it looks great. I am new to RS485 and only a novice in Arduino
Would you be able to please share your code that you have working? It would be a great place to start knowing that someone has it working already (..hopefully not out of my depth for too much longer...)

Thanks

Dave
"nanos gigantum humeris insidentes"