• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

CNC control in C

yass7

New Member
Hello everyone,

here I made a 3-axis CNC with 3 stepper motors (Nema17) .. I control it with an arduino UNO (library GRBL) but I would like to replace the Arduino by a microcontroller 8051, more exactly a P89LPC952 / P89LPC954. So, I would like to control my CNC with the programming language in C.

Can someone please help me or if someone already has a C program to control a 3-axis CNC? : D

For you to have a little more information on my CNC. It is a CNC mainly designed to engrave PCBs. In addition, I use UGS (Universal Gcode Sender) to control my machine in G-code. here I think you have all the necessary information in any case!


thank you !
 

sagor1

Active Member
thank you !
you know how to do it for me? I'm not very good at programming
First of all, I don't have any 8051 type of compilers, so can't help there. (I'm not good at C either)
Also, if you are planning top replace a Arduino with a 8051 family of chips , you have to know programming yourself, as there may be lots of debugging involved. No one can simply "do it" for you. Why change something that already works??? Just use an Arduino and Grbl code, it does work from what I see...
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
No one can simply "do it" for you. Why change something that already works??? Just use an Arduino and Grbl code, it does work from what I see...
Totally agree.. But if you MUST use outdated tech download MCU8051IDE.. Free and you can add SDCC onto it.. It compiles for virtually any 8051 variant.. The IDE also has an assembler..
 

Cicero

Active Member
No, just don't do it.

Leave the old 8051 to continue its retirement gracefully never to be seen again.
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
Hello everyone, the 8051 is imposed on me at school
Yes I believe it is still very popular in eastern area's, But Belgium!! I'd have thought you'd be on M3 cortex processors...
 

yass7

New Member
exactly, I live in Belgium and actually it's still popular. That's why I use it for my CNC.

so, if you know how to help me please .. it would be really nice
 

Nigel Goodwin

Super Moderator
Most Helpful Member
exactly, I live in Belgium and actually it's still popular. That's why I use it for my CNC.

so, if you know how to help me please .. it would be really nice
If it's a school project, then YOU need to do it - although I'm as bewildered as everyone else why Belgium would still be using antique low specification processors?. I can only imagine that it's actually some kind of 8051 development board that the school bought way back last century?.

But assuming you do want to, then simply download the C++ Arduino code, and convert it to C and to run on your processor - assuming your 8051 can meet the requirements?.
 

yass7

New Member
justly, it's my teacher who asked me to get a program from a forum. it's just to learn a new μP.

"But assuming you do want to, then simply download the C++ Arduino code, and convert it to C and to run on your processor - assuming your 8051 can meet the requirements?. "

HOW CAN I DO THAT ? do you know how to explain it to me?

thank you !
 

Pommie

Well-Known Member
Most Helpful Member
What kind of teachers tells a student to get a program from a forum? IMHO, a very bad one.

Mike.
 

yass7

New Member
yes I know, but he is very weird. I made him the remark but he told me that the goal was to understand the program and not learn to program
 

Pommie

Well-Known Member
Most Helpful Member
yes I know, but he is very weird. I made him the remark but he told me that the goal was to understand the program and not learn to program
It's impossible to understand a program if you don't know how to program. It reminds me of the time when people thought they could program a computer because they could use word.

Mike.
Also, C is C, no matter what processor it's on. Why insist on using a relic.
 

yass7

New Member
it's the teacher's pedagogy unfortunately :/

So, you know, help me or not at all? you are really my only hope!

cordially
 

Pommie

Well-Known Member
Most Helpful Member
How will someone else doing your work help you? You're supposed to be learning.

Mike.
 

yass7

New Member
but the problem is that the project I have to make it for the end of May, so I do not have time to learn to program.
 

Pommie

Well-Known Member
Most Helpful Member
Then you will fail and so you should. Being able to complete a programming course without being able to program is fraud. How is an employer supposed to know you can't program when you have passed a programming course. My advice, stop whinging and start studying. Even if you have to resit the subject you will end up a better engineer.

Mike.
 

yass7

New Member
OK no worries but the only one I want to know is this : "But assuming you do want to, then simply download the C++ Arduino code, and convert it to C and to run on your processor - assuming your 8051 can meet the requirements?. "
 

Latest threads

EE World Online Articles

Loading

 
Top