This is an old revision of the document!


Table of Contents

MegaPi

Pinout

CH340 Tx -> Rx0 PE0
CH340 Rx <- Tx0 PE1

RPi   Tx -> Rx2 PH0
RPi   Rx <- Tx2 PH1

BT    Tx -> Rx3 PJ0
BT    Rx <- Tx3 PJ1

LED PB7
Rx1 PD2
Tx1 PD3

NB Disable system login console on Pi to enable AVR UART2 comms.

Motor I/O

GPIO

       1    2    3    4
ENABLE PC2  PC1  PL7  PF5
MS1    PC3  PC0  PL6  PF4
MS2    PC4  PG1  PL2  PF3
MS3    PC5  PG0  PL1  PF2
RESET  PC6  PD7  PL0  PF1
SLEEP  PD3  PD2  PE5  PE4
STEP   PB6  PH5  PH6  PE3
DIR    PB5  PH4  PH3  PG5

TIMER

MOTOR TIMER STEP
1     OC1B  PB6
2     OC4C  PH5
3     OC2B  PH6
4     OC3A  PE3

Motor wiring

NEMA

Left to right (socket pointing upward)

This may actually be reversed or just wrong.

1 PHASE 2 START   GREEN/WHITE   B+   B2
2
3 PHASE 2 FINISH  GREEN         B-   B1
4 PHASE 1 FINISH  RED/WHITE     A-   A1
5
6 PHASE 1 START   RED           A+   A2

MOTOR

A `generic' cable from eBay (these vary)

A+ RED
A- GREEN
B- BLUE
B+ BLACK

My generic cable has the two centre pins twisted.

PORT

Left to right (from above)

B+ B- A- A+

Wiring as per above will result in correct shaft direction. Reverse wiring or swap one pair of wires to rectify incorrect direction.

Resources

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies