Hi
To configure LED0 port as output on your board use:
#define LED0 0x01
DDRTC |= (LED0);
The following will set the output to '1', then clear it to '0', then toggle it three times:
PORTIN_SETTC = (LED0);
CLEARTC = ~(LED0);
PORTTC ^= (PORT_TC_BIT0);
PORTTC ^= (PORT_TC_BIT0);
PORTTC ^= (PORT_TC_BIT0);
See the user's manual for the port definitions.
You can also use the uTasker project for educational work (it will allow you to start with complete working projects for Codewarrior and also simulate the chip without HW). You can also get detailed support at the uTasker forum: www.uTasker.com/forum/
However I thnk that it is your professor's job to teach you how to read the circuit diagrams and writing basic programs - I don't think people have the time to do this via a forum.
Regards
Mark
Hi,
Thanks for your reply, but we seem to be have certain errors as follows
1)undefined identified DDRTC
2)undefined identified 'PORTIN_SETTC'
I think we are missing a header file. Or if anything else please do let us know.
thank you.
regards.
Hi
The port definitions are from the uTasker project and may not match headers that you have.
They are however (to a high degree) the same names as used by the registers in the M52233. Therefore please do the following:
1) Open the M52235 user's manual and read chapter 14. This explains the details about the GPIOs.
2) Search through any headers that you already have to find the equivalent defines, which can can then used instead.
3) If you prefer the complete project (including full driver, TCP/IP and SD card FAT support for your board) you can get this from here http://www.utasker.com/Licensing/request.html
Regards
Mark