Enabling and configuring USER LED'S in MCF52233DEMO KIT

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Enabling and configuring USER LED'S in MCF52233DEMO KIT

1,373 Views
Damein
Contributor I
Hi everyone, our professor has given us the mcf52233demo board and we have to use it work on our project. The first stage is to be able to configure the user led's in the board. So i would like to know the c code to be used in the code warrior for the same. i have a basic knowledge of c so i can tweak it later on for other applications! and if you could teach how to read the schematics and write programs would also be of great help to me and for those new to the embedded scene! Thanking you, Regards, Rohit.
Labels (1)
0 Kudos
3 Replies

345 Views
mjbcswitzerland
Specialist V

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

 

www.uTasker.com

 

0 Kudos

345 Views
Damein
Contributor I

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.

0 Kudos

345 Views
mjbcswitzerland
Specialist V

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

 

0 Kudos