A two axis micro step software for microchip pic supporting LB1946 or LM18245, plus PWM and keysand one servo-motor controller.
C++ Assembly Makefile Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
PIC code


microstep-controller for Microchip PIC

The present project is a controller software for PIC 16F877(a) with support to:

  • two axis micro step (up to three axis, with minor changes)
  • PWM out signal (for use as main current control)
  • one typical PWM for servo motor pin
  • microsteps with speed control for final movement (based on the two axis)
  • 3 lines command buffer (expansible)

The input commands can be supplied in format of axis deltas and line lenght.

The software supports the follow microsteps chips

  • LB1946 allegro microstep chip (the ones present in Epson Stylus Color C60)
  • LM18245 national microstep driver
  • A2919SLB allegro microstep chip (not fully implemented)
  • you can implement another microstep tables

The maximiun step output is 7KHz for a 20MHz clock for LB1946 due serialization routines. The math routines also are a little slow, due lack of ADC (that receive carry) For non LB chips, the control could be faster.

The software utilizes fixed point math. The motion information is supplied in steps in XX:XX:XX:FF:FF:FF format where: XX are the integer part FF are the franctional part

A windows sample software is provided exampling the usage.

Use MPLAB X to compile and simulate this code. This repository contains also Microchip UART code, generated by Maestro. The rights for UART software are from Microchip.