Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MyCo_TPS++ #5

Open
juergen88 opened this issue Nov 2, 2021 · 4 comments
Open

MyCo_TPS++ #5

juergen88 opened this issue Nov 2, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Projects

Comments

@juergen88
Copy link

Some small additions to the existing TPS_MyCo software to give more options.

There are a few unused pins on the Arduino nano.

Would it be possible to add this into the TPS software as optional compiler switches - or a modified version on its own?
A change to the software should not be necessary, and the contents is shown in the Emulator already.

Add 2 additional PWM outputs which show the contents of register E and F to the outside world.
Adding 2 servos wth a scale would give additional 2 outputs to TPS_MyCo. on D12 and D13.
Could be used for 2 motors and leave the other 2 for additional use.

And on the analog pins there there are 4 still unused.
These could be showing the contents of register D to the outside world - 4 additional outputs.
Which pins are used I leave open to the implementer.
And if the pins are not connected externally to anything, there is no difference to the existing implementation.

@willie68 willie68 self-assigned this Nov 2, 2021
@willie68 willie68 added enhancement New feature or request good first issue Good for newcomers labels Nov 2, 2021
@willie68
Copy link
Owner

willie68 commented Nov 2, 2021

For clearification:
2 PWM with the content of E,F Register. Thats possible.
D12 and D13 as additional Servo Output (same as Register E,F) can be done, too.
More AnalogOutputs on the analog pins:
You mean to use the AN Pins as binary output of the D register. This is a bit dangerous because these pins are used as analog inputs in the Arduino environment. If a shield is stuck there and I apply a voltage to this output, I can damage the connected hardware.

@willie68 willie68 added this to ToDo in Arduino_TPS via automation Nov 2, 2021
@juergen88
Copy link
Author

Thanks. So 2 additional PWMs would be ok on 12 and 13.
The output on 13 would give a free test option using the on-board LED.

As I have understood, these Analog IOs can be used as digital IO if needed.
If this is not an automatic function, but the user has to enable this before compiling and the text comment says CAREFUL, THIS CAN BE DANGEROUS AS NORMAQLLY DIGITAL INPUT should be sufficient.

@willie68
Copy link
Owner

willie68 commented Nov 3, 2021

So, some further investigations:
A deeper look into the specs: pin 12 and 13 can't be used as PWM Output. :-(
Servo may be ok, but no hardware PWM. I have to look, if i can use SoftPWM lib. But the last time i used this lib, other libs stopped working.
specs: "Uno, Nano: PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function."
The other part is, pin12,13 are used for the TM1637 Display as there is the SPI Interface (MOSI and Clk), so if advance programming is activate, these pins are blocked, too.
For the servo part i will try to get this working with two new commands only for the 368 Based TPS's. Maybe commands F9 and FA are possible for Servo.3=A and Servo.4=A. BUt as already said: if advance programming is activate, these pins are blocked. No servos possible.

micro:bit wont work, because of reasons (have problems to add new features, because the sources are already to big for this muddy little cpu).
ESP32, RPI Pico : may be possible, but later...

For the additinal outputs: i would like to introduce another command for this, too. FB is than the new command.
DOUTB=A

Conclusion: no further PWM outputs, 2 additional servos, and with a big ATTENTION announcement: additional outputs on A3..A6

@juergen88
Copy link
Author

Please do not put too much effort into it.
It sounded good when I wrote it, but seems much effort for you - a lot more than I had expected.
I have some other ideas, but they need a bit more consideration.

A better use of your time might be to make TPS-MyCo to everybody in the world who has an Internet device
One option might be to have a quick look at easyForth in Javascript.
https://skilldrick.github.io/easyforth/
https://github.com/skilldrick/easyforth
throw the Forth part out and replace it with TPS_MyCo Code.
And add a serial Interface so you can drive some simple external hardwarevia via a USBtoTTL interface ...
Just an idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Development

No branches or pull requests

2 participants