Will the PIC18F14K50 perform well as a CNC machine micro-processor

cpueepromflashmicrocontrolleruart

The data sheet can be found here.

I'm trying to select a micro-controller which will eventually run a Wireless 2D Laser Engraver/3D Printer/CNC Machine.

I have very little experience in selecting micro-controllers, and only a rudimentary understanding of the terminology. The micro-controller would need to fit the following requirements:

  1. Run on 5V
  2. Have at Least One Digital Input (I understand that this is called a
    UART port.)which will be used to interpret the output signal from a
    FM wireless receiver outputting digital data.
  3. Have at Least 13 I/O pins. 1 to run the object on/off (I.E. CNC bit,
    Plastic Extruder, Laser.) And 4 pins for each h-bridge which will
    run stepper motors running the x-y-z axis.
  4. Be able to house an approx. 16KB C++ program for interpreting the
    digital data sent by the radio receiver, and the ability to edit the
    on-board program.
  5. Occupy the smallest amount of board-space by having only the
    required pins.

I believe that the PIC18F14K50 meets these requirements because the datasheet shows (in the order above):

  1. Runs on 1.8V to 5.5V.
  2. Has an Enhanced Universal Synchronous Asynchronous Receiver
  3. Transmitter pin. Has 14 I/O Pins.
  4. Can house a 16KB program which is flash memory, I.E. I can rewrite
    code at will. (I'm not worried about RAM, as I don't store many variables. The program is almost real-time.)
  5. Has the minimum amount of pins/board-space to fulfill my needs. (20
    Pins.)

I believe I have all the terminology correctly assessed, but I'm not sure enough to order the part without some more experienced input.

A few things I noted were included on the data-sheet and I'm unclear on how to assess my needs for:

  • CPU Speed
  • EEPROM (I believe this is the precurssor to flash memory…why would
    I need both?) Comperators
  • 8-Bit Architecture

EDIT

It's also worth mentioning that I will need to be sending output to all 13 of those parallel ports every 500ms or so, if that effects the specs I would need I would love an explanation as to how it does.

Best Answer

This is a broad question, but yes, it seems you found a minimum micro that still does what you specified.

However, that may not be a good idea unless this is a volume product. Stuff happens, and unforseen things come up. You may very well wish you had a few more pins or a little more processing power as you get into the project.

I'll assume this is a personal one-off project (I told you in your meta question that this sort of thing is important context). I'd get a 33F with lots of ROM and RAM for the main controller, and separate micros for each of the stepper motors. It takes more than a single H bridge to control a stepper.

For firmware simplicity, get the same PIC for all four roles. These things are cheap, but having to handle only one motor per PIC will make things easier. The three motor driver PICs would run the same code. They can receive commands from the main controller via a on-board IIC or CAN or something.

The 33F series runs on 3.3 V, but the newer ones also have a lot of 5V-tolerant inputs. The things you control inside your own hardware will be fine with 3.3 V. The few things you need to control externally may be OK with 0 to 3.3 V levels. Lots of things use "TTL compatible" input thresholds. If not, add a 3.3 V to 5 V converter chip for the few signals that really require 4 V for a logic high.

500 ms makes no sense for stepper motor control. You will probably re-evaluate the PWM outputs driving the stepper at 10 kHz or more, with PWM frequency at least 25 kHz. That may sound fast, but 100 µs (1/10 kHz) is actually a long time for such a micro to compute what duty cycle to emit next. I'd probably aim for re-computing what to do to a stepper each PWM pulse running at 100 kHz or so.