We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
I check in lpc17xx.h, it does contain the undefined parameters.
Sample of lpc17xx.h is below
/**************************************************************************//** * @file LPC17xx.h * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File for * NXP LPC17xx Device Series * @version: V1.08 * @date: 21. December 2009 * * @note * Copyright (C) 2009 ARM Limited. All rights reserved. * * @par * ARM Limited (ARM) is supplying this software for use with Cortex-M * processor based microcontrollers. This file can be freely distributed * within development tools that are supporting such ARM based processors. * * @par * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. * ******************************************************************************/ . . . #include "core_cm3.h" /* Cortex-M3 processor and core peripherals */ #include "system_LPC17xx.h" /* System Header */ . . . /*------------- General Purpose Input/Output (GPIO) --------------------------*/ /** @brief General Purpose Input/Output (GPIO) register structure definition */ typedef struct { union { __IO uint32_t FIODIR; struct { __IO uint16_t FIODIRL; __IO uint16_t FIODIRH; }; struct { __IO uint8_t FIODIR0; __IO uint8_t FIODIR1; __IO uint8_t FIODIR2; __IO uint8_t FIODIR3; }; }; uint32_t RESERVED0[3]; union { __IO uint32_t FIOMASK; struct { __IO uint16_t FIOMASKL; __IO uint16_t FIOMASKH; }; struct { __IO uint8_t FIOMASK0; __IO uint8_t FIOMASK1; __IO uint8_t FIOMASK2; __IO uint8_t FIOMASK3; }; }; union { __IO uint32_t FIOPIN; struct { __IO uint16_t FIOPINL; __IO uint16_t FIOPINH; }; struct { __IO uint8_t FIOPIN0; __IO uint8_t FIOPIN1; __IO uint8_t FIOPIN2; __IO uint8_t FIOPIN3; }; }; union { __IO uint32_t FIOSET; struct { __IO uint16_t FIOSETL; __IO uint16_t FIOSETH; }; struct { __IO uint8_t FIOSET0; __IO uint8_t FIOSET1; __IO uint8_t FIOSET2; __IO uint8_t FIOSET3; }; }; union { __O uint32_t FIOCLR; struct { __O uint16_t FIOCLRL; __O uint16_t FIOCLRH; }; struct { __O uint8_t FIOCLR0; __O uint8_t FIOCLR1; __O uint8_t FIOCLR2; __O uint8_t FIOCLR3; }; }; } LPC_GPIO_TypeDef;
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.
Mark thank you for the information, the problem is solved now,thanks to your direction and also other friends info.
Again thank you for everyones help Hopefully I can also help anytime soon