This is one of my CNC motion control revisions and it is currently an work in progress.

CNC Buffer Board (Rev. A)

Table of Contents

Introduction

The goal of the CNC buffer board is to provide a serial to parallel interface for driving a CNC with a parallel port interface. The CNC machine can have up to 4 axes (X, Y, Z, and A) where each axis has a step and direction line. The serial interface is RS-232. If you only have a USB interface, a USB to serial converter is required. There is enough on board buffering to deal with a host operating system that does not have any real time guarantees (e.g. Window 2K, Windows XP, Linux, MaxOS, etc.) All of the tight real time timing is done by the buffer board.

Hardware

The hardware is divided into the schematics and the printed circuit board.

Schematics

The buffer parts list is kept in separate file.

Microcontroller

The buffer is designed around a PIC16F777 microcontroller running at 20MHz. The reason why a PIC16F777 (40 pins) is used instead of a PIC16F767 (28 pins) is because the internal firmware needs an 8-bit port dedicated to the parallel port and a separate 8-bit port dedicated to the memory subsystem. On the PIC16F767, port C has two of its pins used by the UART, which can not be relocated off port C; thub port C is not available as a full 8-bit port.

Controller Schmatic
Port B is reserved exclusively for the parallel output port. Port A is used for the high 7 bits of the memory address and Port D is used for the remaining 16 bits of the address bus and and 8-bits of data.

Memory

The microcontroller uses port A for A<22:16> of the memory chip and port D for A<15:0> and DQ<7:0> of the memroy chip.

The code to write a byte into memory looks like:

    # For a write:
    port_a := memory_address_high
    port_d := memory_address_middle
    addrm := 0
    addrm := 1
    port_d := memory_address_low
    addrl := 0
    addrl := 1
    port_d := data_byte
    we := 0
    we := 1
								
The code to read a byte from the memory chip looks like:
    # For read:
    port_a := memory_address_high
    port_d := memory_address_middle
    addrm := 0
    addrm := 1
    port_d := memory_address_low
    addrl := 0
    addrl := 1
    tris_d := 0xff
    oe := 0
    data_byte := port_d
    oe := 1
    tris_d := 0
								

The table below shows the various possible static RAM chips that can be plugged into the PCB. static RAM chips come in three DIP packages -- DIP28, DIP32, and DIP36. All chips put Vss (ground) on the lower left pin and Vcc (+5V) on the upper right pin. By looking at the pin assignments in the table below, it is pretty clear that a single 36-pin socket is capable of allowing all package sizes.

DIP28
Pin
32K×8 DIP32
Pin
128K×8 256K×8 512K×8 DIP36
Pin
1M×8 2M×8
1 NC NC
2 NC A20
1 NC NC A18 3 A18 A18
2 A16 A16 A16 4 A16 A16
1 A14 3 A14 A14 A14 5 A14 A14
2 A12 4 A12 A12 A12 6 A12 A12
3 A7 5 A7 A7 A7 7 A7 A7
4 A6 6 A6 A6 A6 8 A6 A6
5 A5 7 A5 A5 A5 9 A5 A5
6 A4 8 A4 A4 A4 10 A4 A4
7 A3 9 A3 A3 A3 11 A3 A3
8 A2 10 A2 A2 A2 12 A2 A2
9 A1 11 A1 A1 A1 13 A1 A1
10 A0 12 A0 A0 A0 14 A0 A0
11 DQ0 13 DQ0 DQ0 DQ0 15 DQ0 DQ0
12 DQ1 14 DQ1 DQ1 DQ1 16 DQ1 DQ1
13 DQ2 15 DQ2 DQ2 DQ2 17 DQ2 DQ2
14 Vss 16 Vss Vss Vss 18 Vss Vss
15 DQ3 17 DQ3 DQ3 DQ3 19 DQ3 DQ3
16 DQ4 18 DQ4 DQ4 DQ4 20 DQ4 DQ4
17 DQ5 19 DQ5 DQ5 DQ5 21 DQ5 DQ5
18 DQ6 20 DQ6 DQ6 DQ6 22 DQ6 DQ6
19 DQ7 21 DQ7 DQ7 DQ7 23 DQ7 DQ7
20 CE 22 CE CE CE 24 CE CE
21 A10 23 A10 A10 A10 25 A10 A10
22 OE 24 OE OE OE 26 OE OE
23 A11 25 A11 A11 A11 27 A11 A11
24 A9 26 A9 A9 A9 28 A9 A9
25 A8 27 A8 A8 A8 29 A8 A8
26 A13 28 A13 A13 A13 30 A13 A13
27 WE 29 WE WE WE 31 WE WE
28 Vcc 30 NC(CS2) A17 A17 32 A17 A17
31 A15 A15 A15 33 A15 A15
32 Vcc Vcc Vcc 34 NC NC
35 A19 A19
36 Vcc Vcc

The schematic consists of 16 bits of address latch register and a static RAM chip. In addition, the current largest static memory (in a DIP package) can only use 21 address bits (2Mb x 8); thus, A21 and A22 are speculative.

Memory Schematic
The pin outs for the memory module are for a 36-pin DIP. Since 36-pin DIP's are not readily available, a 40-pin dip is used instead. Lastly, the user is permitted to plug in either a 28-pin, 32-pin, or 36-pin static RAM chip, thus, the need for J1 and J2 reroute power for those chips.

Parallel Port

The parallel port can be connected with either a a 25-pin D-connector (N1) or a 2&time;13 ribbon cable (N2). The 24-pin connector is female so that it can conceptually be plugged directly into the corresponding motion board.

Parallel Port Schematic

Serial Port

There are a plethora of serial ports options. There is a 9-pin D-sub connector on the left (N3) along with a corresponding 2×13 ribbon cable connector (N5) and another 9-pin D-sub connector on the right (N4) and another corresponding 2×13 ribbon cable connector (N6). Obviously, only one of the the four connectors needs to be installed.

Serial Port Schematic
In general, a stand-alone buffer board installed into a box will use N4, since it is on the same side of the box as N1.

Power Supply

If the buffer board is going to be used in a stand alone configuration, power can be supplied by a 6 VDC wall wart. A panel mount adaptor is routed to N7. If 5 volts are available, just run them to N7 and replace VR1 with a jumper wire between pins 1 and 3.

Power Supply Schematic

Printed Circuit Board

The following printed circuit board files are available:

buffer_back.png
The solder side layer.
buffer_front.png
The component side layer.
buffer_artwork.png
The artwork layer.
buffer.gbl
The RS-274X "Gerber" back (solder) layer.
buffer.gtl
The RS-274X "Gerber" front (component) layer.
buffer.gal
The RS-274X "Gerber" artwork (solder) layer.
buffer.gml
The RS-274X "Gerber" mask (solder) layer.
buffer.drl
The "Excellon" NC drill file.
buffer.tol
The tool rack file.

Software

The software is still pending.

Assembly

The assembly pictures are in an assembly sub-directory.

Issues

Any issues that come need will be discussed here:


Copyright (c) 2005 by Wayne C. Gramlich. All rights reserved.