picnc to stm32f progress.
- mhel
- Offline
- Senior Member
-
Less
More
- Posts: 47
- Thank you received: 6
05 Sep 2020 23:26 - 05 Sep 2020 23:31 #180873
by mhel
picnc to stm32f progress. was created by mhel
'just wanted to post my progress on porting of picnc to stm32f4. (currently on a f407 but plan to use f405...because price
)
...and some query
I did a hack job with the spi
in the hal module, I'm using spidev
as it's the easiest to search on google
to find help.
I'm getting odd result if I commanded a 0 position.
I could issue a command greater than or less than 0,
e.g. -0.0005 0.0625 and it's ok, but with 0,
I get result like this:
ibb.co/fdyp0DP
Anyone uses/used the picnc and encounter(ed) the same?
I'm using the exact same code from picnc v2 (aka copy paste
)
except for the spi communication.
This is running on a tinkerboard, will try rpi3/4 whenever I get my hands on them.

https://streamable.com/k1ksfg
https://streamable.com/dl61rh
...and some query
I did a hack job with the spi
in the hal module, I'm using spidev
as it's the easiest to search on google
to find help.
I'm getting odd result if I commanded a 0 position.
I could issue a command greater than or less than 0,
e.g. -0.0005 0.0625 and it's ok, but with 0,
I get result like this:
ibb.co/fdyp0DP
Anyone uses/used the picnc and encounter(ed) the same?
I'm using the exact same code from picnc v2 (aka copy paste

except for the spi communication.
This is running on a tinkerboard, will try rpi3/4 whenever I get my hands on them.
Last edit: 05 Sep 2020 23:31 by mhel. Reason: Forgotten the actual question :)
Please Log in or Create an account to join the conversation.
- twoflowers
-
- Visitor
-
03 Oct 2020 15:16 #184694
by twoflowers
Replied by twoflowers on topic picnc to stm32f progress.
Do you have the code somewhere? I have here a nucleo64 with 446RE what would like to be a test candidate.
Please Log in or Create an account to join the conversation.
- mhel
- Offline
- Senior Member
-
Less
More
- Posts: 47
- Thank you received: 6
03 Oct 2020 22:05 #184740
by mhel
Replied by mhel on topic picnc to stm32f progress.
I'm using this library github.com/andysworkshop/stm32plus
unfortunately it doesn't have support for the 446RE., because of older std pheriperal library.
I'm a C++ newbie but I find it a very good library with lots of examples.
Testing is on pause I got distracted trying to make GUI on a weston wayland, but I think I"m way over my head on that one, not enough skill.
If you are still interested let me know.
unfortunately it doesn't have support for the 446RE., because of older std pheriperal library.
I'm a C++ newbie but I find it a very good library with lots of examples.
Testing is on pause I got distracted trying to make GUI on a weston wayland, but I think I"m way over my head on that one, not enough skill.
If you are still interested let me know.
Please Log in or Create an account to join the conversation.
- twoflowers
-
- Visitor
-
04 Oct 2020 09:04 #184788
by twoflowers
Replied by twoflowers on topic picnc to stm32f progress.
Still interested, but I'm wondering if it would not be easier to use the STM32 arduino core for migration.
Please Log in or Create an account to join the conversation.
- mhel
- Offline
- Senior Member
-
Less
More
- Posts: 47
- Thank you received: 6
04 Oct 2020 19:07 - 05 Oct 2020 13:33 #184865
by mhel
Replied by mhel on topic picnc to stm32f progress.
Whew, it took time to create the repo, but I learnt some git.
here it is, I hope you find it useful.
github.com/mhelmarc/stcnc
It would probably be easier with Arduino, but it's been a long time
since I tried to use it. I think the stm32plus is more complete, but
then again the Arduino has more contributor.
here it is, I hope you find it useful.
github.com/mhelmarc/stcnc
It would probably be easier with Arduino, but it's been a long time
since I tried to use it. I think the stm32plus is more complete, but
then again the Arduino has more contributor.
Last edit: 05 Oct 2020 13:33 by mhel.
Please Log in or Create an account to join the conversation.
- BeagleBrainz
-
- Visitor
-
04 Oct 2020 21:43 #184876
by BeagleBrainz
Replied by BeagleBrainz on topic picnc to stm32f progress.
Have seen these fixes:
github.com/kinsamanka/PICnc-V2/commit/14...edc057c0c606e0f8ae47
github.com/kinsamanka/PICnc-V2/commit/14...edc057c0c606e0f8ae47
Please Log in or Create an account to join the conversation.
- twoflowers
-
- Visitor
-
05 Oct 2020 10:04 #184954
by twoflowers
Replied by twoflowers on topic picnc to stm32f progress.
Thank you for uploading the code.
debounce(int32_t A) { ... } : This works wit notmally-closed-switches. If jitter is on the line, it might be that a LOW is detected. So it uses 3 samples and only whwn all 3 are LOW (==OPEN), then the resolt is OPEN, otherwise it's CLOSED
debounce(int32_t A) { ... } : This works wit notmally-closed-switches. If jitter is on the line, it might be that a LOW is detected. So it uses 3 samples and only whwn all 3 are LOW (==OPEN), then the resolt is OPEN, otherwise it's CLOSED
Please Log in or Create an account to join the conversation.
- mhel
- Offline
- Senior Member
-
Less
More
- Posts: 47
- Thank you received: 6
05 Oct 2020 13:33 #184965
by mhel
Replied by mhel on topic picnc to stm32f progress.
@BeagleBrainz
Thanks, I have just tried that change in stcnc.c and I'm still getting
error when commanding a zero value.
@twoflowers
Now I get it, thanks.
Thanks, I have just tried that change in stcnc.c and I'm still getting
error when commanding a zero value.
@twoflowers
Now I get it, thanks.
Please Log in or Create an account to join the conversation.
- mhel
- Offline
- Senior Member
-
Less
More
- Posts: 47
- Thank you received: 6
15 Jul 2021 23:32 #214947
by mhel
Replied by mhel on topic picnc to stm32f progress.
just to close this. I have a better port here github.com/mhelmarc/Remora-STM32, I've learnt a few tricks on the way there.
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.096 seconds