AnsweredAssumed Answered

Need to Send DATA to Port in Twr-K60 tower module to GLCD (NT7108C driver) in MQX

Question asked by Abhishek Inamdar on Nov 12, 2015
Latest reply on Nov 13, 2015 by Abhishek Inamdar

     Need to Send DATA to PortB in Twr-K60 tower module to GLCD (NT7108C driver) in MQX programming, please go the following code do suggest appropriate API to send 8 bit data to the PortB in TWR‐K60D100M Tower Module. As in this tower the Port-B pin 2 and 3 are used for the capacitive touch input input, to send the 8 bit data to the port I need to mask the pin 2 & 3 and remaining pin (10 to 31) on the Port B and use 0 - 1, 4 - 9 (8 Pin) for parallel data transfer to the GLCD.

 

     Please go through below example code to send data to Port-B and suggest the appropriate API to do this particular task.

 

void LCD_Display() {

 

  uint8_t PORTB;                    //Please suggest appropriate API to Initialize the Port B for 8 bit DATA transfer

 

  lwgpio_init(&GLCD_CS1, LWGPIO_PORT_A | LWGPIO_PIN12, LWGPIO_DIR_OUTPUT, LWGPIO_VALUE_HIGH);

  lwgpio_init(&GLCD_CS2, LWGPIO_PORT_A | LWGPIO_PIN13, LWGPIO_DIR_OUTPUT, LWGPIO_VALUE_LOW);

  lwgpio_init(&GLCD_RS, LWGPIO_PORT_A | LWGPIO_PIN14, LWGPIO_DIR_OUTPUT, LWGPIO_VALUE_HIGH);

  lwgpio_init(&GLCD_RW, LWGPIO_PORT_A | LWGPIO_PIN15, LWGPIO_DIR_OUTPUT, LWGPIO_VALUE_HIGH);

  lwgpio_init(&GLCD_RST, LWGPIO_PORT_A | LWGPIO_PIN6, LWGPIO_DIR_OUTPUT, LWGPIO_VALUE_LOW);

  lwgpio_init(&GLCD_EN, LWGPIO_PORT_A | LWGPIO_PIN17, LWGPIO_DIR_OUTPUT, LWGPIO_VALUE_HIGH);

 

 

  lwgpio_set_functionality(&GLCD_CS1, LWGPIO_MUX_A12_GPIO);

  lwgpio_set_functionality(&GLCD_CS2, LWGPIO_MUX_A13_GPIO);

  lwgpio_set_functionality(&GLCD_RS, LWGPIO_MUX_A14_GPIO);

  lwgpio_set_functionality(&GLCD_RW, LWGPIO_MUX_A15_GPIO);

  lwgpio_set_functionality(&GLCD_RST, LWGPIO_MUX_A16_GPIO);

  lwgpio_set_functionality(&GLCD_EN, LWGPIO_MUX_A17_GPIO);

 

  //Other Codes..

}

 

void GLCD_ON()

{

    //Activate both chips

    lwgpio_set_value(&GLCD_CS1, LWGPIO_VALUE_LOW);               //set the Chip select CS1 to low

    lwgpio_set_value(&GLCD_CS2, LWGPIO_VALUE_LOW);               //set the Chip select CS2 to low

    lwgpio_set_value(&GLCD_RS, LWGPIO_VALUE_LOW);                 //set the DATA or Instruction

    lwgpio_set_value(&GLCD_RW, LWGPIO_VALUE_LOW);                //set to Read or Write to the DATA line

    GLCD_Data = 0x3F;                                                                           //Send the 8 bit Data to the 32bit Port-B masking the Port Pin(2-3,10-31) 0xFFFFFFFF

    Enable_Pulse();

}

 

Regards

Abhi

Outcomes