This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to setand clear all bit P1.15-P1.23

Hellow,
I used LPC 1768 microcontroller interface with LCD module pin P1.16-P1.23.
The information is sent to the LCD module. The problem is I can not set up all the incoming data signals simultaneously. Please give instructions to send the information to me.

thank you

Parents
  • Here is the code that I wrote to their portfolio. However, because it makes the display slowly.
    I want to send command to port, all the bit at the same time.
    void sent_data(unsigned char data)
    { if(data & (1<<0)) LPC_GPIO1->FIOSET = (1<<16); else LPC_GPIO1->FIOCLR = (1<<16); if(data & (1<<1)) LPC_GPIO1->FIOSET = (1<<17); else LPC_GPIO1->FIOCLR = (1<<17); . . . LPC_GPIO1->FIOSET = (1<<23); else LPC_GPIO1->FIOCLR = (1<<23);

    }

    but the function not good because data transfer slowly.

Reply
  • Here is the code that I wrote to their portfolio. However, because it makes the display slowly.
    I want to send command to port, all the bit at the same time.
    void sent_data(unsigned char data)
    { if(data & (1<<0)) LPC_GPIO1->FIOSET = (1<<16); else LPC_GPIO1->FIOCLR = (1<<16); if(data & (1<<1)) LPC_GPIO1->FIOSET = (1<<17); else LPC_GPIO1->FIOCLR = (1<<17); . . . LPC_GPIO1->FIOSET = (1<<23); else LPC_GPIO1->FIOCLR = (1<<23);

    }

    but the function not good because data transfer slowly.

Children
  • So what you are saying is that you have _not_ read through the chapter about GPIO in the processur users manual. And you have also decided to ignore what I did write in my previous post and what I implied in my first post.

    Set and clear aren't the only operations supported by the GPIO of the LPC17xx processors. You can make a direct 8-bit assign to P1.16 .. P1.23 too. But you really do need to spend time reading the processor documentation. You will always fail to take advantage of the processor if you don't make sure you read through the user manual so you see what advanced features the processor has. There are no short cut available.