얕고 넓게

[3DP] MKS TFT32 만들기 본문

IT/3D Printer, CNC

[3DP] MKS TFT32 만들기

블랙오닉스 2024. 6. 10. 21:50

2024.06.10

TFT35 (TS35?) 를 LCD + Arduino로 만드는 것을 다시 생각.

copilot에게 interface 물어 봤더니 링크를 알려준다.

GitHub - makerbase-mks/MKS-TFT: MKS TFT touch screen includes TFT24/28/32/35/70, which can be connected to the motherboard for control via AUX-1. Support Simplified Chinese, Traditional Chinese, English, Russian, Spanish and more than 5 languages, and support online language switching ...

 

GitHub - makerbase-mks/MKS-TFT: MKS TFT touch screen includes TFT24/28/32/35/70, which can be connected to the motherboard for c

MKS TFT touch screen includes TFT24/28/32/35/70, which can be connected to the motherboard for control via AUX-1. Support Simplified Chinese, Traditional Chinese, English, Russian, Spanish and more...

github.com

Firmware가 있다.

STM32 기반이다.

집에 있는 ESP32로 가능할 것 같기도 한데.


일단 펌웨어 분석

 

#3은 HW UART?

    gCfgItems.baud = 4;
    MX_USART3_UART_Init(gCfgItems.baud);
void MX_USART3_UART_Init(int readId)
{

  huart3.Instance = USART3;
  if(readId==1){
    huart3.Init.BaudRate = 9600;
  }
  else if(readId==2){
    huart3.Init.BaudRate = 57600;
  }
  else if(readId==3){
    huart3.Init.BaudRate = 115200;
  }
  else{
    huart3.Init.BaudRate = 250000;
  }

#1은 WiFi 같음

   MX_USART1_UART_Init(5);
void MX_USART1_UART_Init(int readId_1)
{

  huart1.Instance = USART1;
  switch(readId_1)
  {
    case 1:huart1.Init.BaudRate = 9600;break;
    case 2:huart1.Init.BaudRate = 57600;break;
    case 3:huart1.Init.BaudRate = 115200;break;
    case 4:huart1.Init.BaudRate = 250000;break;
    case 5:huart1.Init.BaudRate = 1958400;break;
    default:huart1.Init.BaudRate = 115200;break;      
  }

 

#2는 SW UART?

mksUsart2Init();
void mksUsart2Init(void)
{
        firmwareType = marlin;
        wait_cnt = 0;

        usart2Data.rxP = &usart2Data.usart2Rxbuf[0];
        usart2Data.txP = &usart2Data.usart2Txbuf[0];
        usart2Data.txBase = usart2Data.txP;
        usart2Data.printer = printer_idle;
        usart2Data.timer = timer_stop;
        usart2Data.prWaitStatus = pr_wait_idle;
        USART2_SR &= 0xffbf;        //����жϱ�־λ
        USART2_SR &= 0xffdf;
        USART2_CR1 |= 0x40;         //��������ж�����
        USART2_SR &= 0xffbf;        //����жϱ�־λ

 

M81(Power Off)를 UART2에 전송하는 것으로 보아 Marlin과 통신은 #2로

void Btn_putdown_close_machine()
{
    //**initFIFO(&gcodeCmdTxFIFO);
    //**pushFIFO(&gcodeCmdTxFIFO, (unsigned char *)"M81\n");
    memset(usart2Data.usart2Txbuf,0,sizeof(usart2Data.usart2Txbuf));
    usart2Data.usart2Txbuf[0]='M';usart2Data.usart2Txbuf[1]='8';usart2Data.usart2Txbuf[2]='1';usart2Data.usart2Txbuf[3]='\n';  
    usart2TxStart();        
}

지난번 확인한 대로 Marlin <- UART -> TFT35로 연결되어 GCode를 UART로 통신