AnsweredAssumed Answered

Basic question about GPIO usage in Kinetis devices

Question asked by juanm on Mar 23, 2015
Latest reply on Mar 24, 2015 by Mark Butcher

Hi! I have a very basic question about the use of the GPIO ports in Kinetis devices (I'm using FRDM-KL25Z and CW v10.6).

I have been using a library for an LCD 16x2 display with the HCS08 family, but now I wanted to port it to the KL25Z.

My question is with the following function:


void LCD_send_byte(char address, char data)
  unsigned int temp;
  PTBD_PTBD0 = address;               // config the R/S line
  LCD_ENABLE = 0;                 // set LCD enable line to 0
  LCD_send_nibble(data >> 4);     // send the higher nibble
  LCD_send_nibble(data & 0x0f);   // send the lower nibble
  for (temp=1000; temp; temp--);


With this line: PTBD_PTBD0 = address; I assign the value of "address" to PTB0, but the question is, how can I implement that line in Kinetis? I tried the following:

GPIOB_PDOR = (address<<0); but that didn't work.

That's it, and sorry if this is a simple question.