Hello guys, i search suggestions for my project.
My intentions are make a board with a PIC32MZ series for to pair with TinyG board. This is for to avoid the use a PC and make a stand-alone CNC machine.
The PIC32 board manages a 7″ TFT touch display, a little keyboard, and a SDcard holder.
Simply the user open a file in the SDcard with G-Code text, and sends this at TinyG board.
The communication is made with a complete UART protocol.
TX
RX
RTS
CTS
Code abstraction: (in short)
#define RTS LATBbits.LATB1 // definitions PORTB1 and PORTB2 output pin
#define CTS LATBbits.LATB2
RTS = 1; // The PIC wont start a serial communication with TinyG
while (!CTS); // wait for signal ok from TinyG serial –> CTS = 1 (Buffer empty)
for (i = 0; i= numline; i++) // numline = number of lines in G-code file
{
read.Line(file, line); // reading of one line in the file on SDcard
serial.Print(line); // send line to TinyG
line++; // next line
if(CTS == 0) // check buffer
{
RTS = 0; // if CTS signal = 0 (Buffer almost full),
break; // reset the RTS signal, then exit
}
}
while(!CTS) { // wait for emptying of buffer…
continue….
———————-
Do you have suggestions?
-
This topic was modified 9 years, 11 months ago by Ultron.