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

Porting MCB2300 examples to MCB1700

Dear all,

I am using Keil MDK 4.12, and MCB1700 board.

I managed to port simple program examples from MCB2300 to MCB1700, but when I try to port more complex program (RL-TCPNet) I found problems with compiling.

Kindly help me to point me to help file or website that have similar sample case, I have search the forum and knowledge base, but no result.

Thank you in advance for your kind help and attention

Ojahan

Parents
  • You have incorrect usage.

    You use FIODIR2 - probably assuming it controls the direction for port 2.

    But note in the header file. FIODIR2 is a field in a union, inside a structure named LPC_GPIO_TypeDef.

    You need to look up the variable of type LPC_GPIO_TypeDef that relates to the port you want to control. Then you need to access the relevant fields for that variable.

    And FIODIR0, FIODIR1, FIODIR2, FIODIR3 are there if you want to just perform an 8-bit operation to update the port direction for a group of 8 I/O pins of a port.

    You seem to want to perform an assign of a 32-bit value - this would correspond with the union field <port-variable_name>.FIODIR. Or you only want to change the low byte, in which case you should use <port-variable_name>.FIODIR0.

    If the variable is instead a pointer, you have to use <port-variable_name>->FIODIR.

Reply
  • You have incorrect usage.

    You use FIODIR2 - probably assuming it controls the direction for port 2.

    But note in the header file. FIODIR2 is a field in a union, inside a structure named LPC_GPIO_TypeDef.

    You need to look up the variable of type LPC_GPIO_TypeDef that relates to the port you want to control. Then you need to access the relevant fields for that variable.

    And FIODIR0, FIODIR1, FIODIR2, FIODIR3 are there if you want to just perform an 8-bit operation to update the port direction for a group of 8 I/O pins of a port.

    You seem to want to perform an assign of a 32-bit value - this would correspond with the union field <port-variable_name>.FIODIR. Or you only want to change the low byte, in which case you should use <port-variable_name>.FIODIR0.

    If the variable is instead a pointer, you have to use <port-variable_name>->FIODIR.

Children