Hey Thomas, The lpc2129 User Manual contains all the info u need on GPIO manipulation. Just note the following whenever you're manipulating Port0. - You 'only' can read current GPIO pin states by reading the IO0PIN register. Variable = IO0PIN; - The User Manual defines IO0PIN to be a read-only register. IO0PIN = 0x0000 C700; // invalid statement (according to IAR compiler) - IO0CLR,IO0SET writes is the only way of changing output pin states. - Writing 1's to the bits of IO0SET will make the corresponding pins High. - Writing 1's to the bits of IO0CLR will make the corresponding pins Low. So with the statements u have: IO0SET = 0x0000 C700 IO0CLR = 0x0000 3800 //theres no need for this. Also note that: - Writing 0's to IO0CLR/IO0SET has no effect on Port0. Using the IO0CLR/IO0SET registers facilitates a more disciplined approach towards output control.
Message
Re: congratulations
2005-01-15 by Leighton Rowe
Attachments
- No local attachments were found for this message.