MCF52233 Problem to control one of the pins in PORTTC

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

MCF52233 Problem to control one of the pins in PORTTC

Jump to solution
2,198 Views
Olga
Contributor II

I have  a "mystery" problem.

All my registers for the TC port are set properly:

 

MCF_GPIO_PTCPAR=0x00;

MCF_GPIO_DDRTC=0x0F;
 

I have no problems to trigger PTC[1], PTC[2] or PTC[3],

but I can not drive PTC[0], pin does not go high when I set

MCF_GPIO_PORTTC=0x01;

or

MCF_GPIO_SETTC=0x01;

 

I have verified the status of both control registers they are set tot he values I specified for them.

Would could cause this problem?

Labels (1)
0 Kudos
1 Solution
619 Views
Olga
Contributor II

Rich,

 

Thank you very much for your help.

It appears to be the hardware problem, IC driver on this pin of MP must have been damaged.

When I installed new MCF52233 on the the board this issue have been resolved.

 

Best regards,

Olga

View solution in original post

0 Kudos
9 Replies
619 Views
Olga
Contributor II

I have disconnected everything from this pin. Nothing is driven by it.
I tried to put a pull-up resistor (10k to +3.3V) on it, but with the pull-up resistor I can not pull this pin low.

It behaves like it is an input. Though I have configured MCF_GPIO_PTCPAR and MCF_GPIO_DDRTC.

My code is based on ColdFire_Lite7x.

 

Message Edited by Olga on 2009-05-31 09:56 PM
0 Kudos
619 Views
RichTestardi
Senior Contributor II

Have you examined the DDR and PAR register, using the debugger, at runtime, to be sure someone has not changed them after you set them, via:

 

  View -> Registers -> General Purpose I/O Port TC Registers

 

-- Rich

 

0 Kudos
619 Views
Olga
Contributor II

CodeWarrior  does not allow me to view these registers. The only visibility I have is following:

Thread 0X0 (which includes general purpose registers Dn and An) and generic supervisor registers (CACR, ACR0, ACR1, VBR, MBAR, RAMBAR).

 

I have been using a workaround to verify the status of the registers by introducing an external variable vunit8 temp, and assigning it value of the registers

temp=MCF_GPIO_DDRTC;

and

temp=MCF_GPIO_PTCPAR;

 

 Values that returned are the ones expected.

Message Edited by Olga on 2009-05-31 10:48 PM
0 Kudos
619 Views
RichTestardi
Senior Contributor II

If you go to your project settings and set:

 

  Debugger -> CF Debugger Settings -> Target Processor

 

to 52233, then the debugger should be able to display all the processor registers for you.

 

It makes debugging much easier.

 

Since that value may be set wrong, it may be good to double check also the processor under:

 

  Language Settings -> ColdFire Assembler -> Processor

  Code Generation -> ColdFire Processor -> Target Family

 

-- Rich

 

 

0 Kudos
619 Views
Olga
Contributor II

Thank you very much for your help. It is much easier to debug this way! :smileyvery-happy:

 

I have verified status of the registers, they are

MCF_GPIO_PTCPAR=0x00

MCF_GPIO_DDRTC=0x0F

correct.

 

0 Kudos
619 Views
Olga
Contributor II

Even though everything looks great, the pin still does not work.

Any ideas?

0 Kudos
619 Views
RichTestardi
Senior Contributor II
It might be worth just loading StickOS onto the MCU to test the pin interactively, by hand...  It should load up and run without any trouble (assuming you have a 25MHz crystal) -- just select the S19 file from http://www.cpustick.com/downloads/StickOS.MCF5223x.v1.60e.elf.S19 in the flash programmer and see the instructions above...  I use the dtin0 pin all the time, and it just works for me, so I don't think there is any magic you are missing.  Are you using an EVB or DEMO board, or a homebrew board?  Have you tried multiple boards to rule out a zapped output driver on the MCU?  I assume you're measuring the voltage at the pin, not relying on a LED on a DEMO board (I've had at least one LED that had a cold solder joint, and of course, there are the LED jumpers to double check).
0 Kudos
620 Views
Olga
Contributor II

Rich,

 

Thank you very much for your help.

It appears to be the hardware problem, IC driver on this pin of MP must have been damaged.

When I installed new MCF52233 on the the board this issue have been resolved.

 

Best regards,

Olga

0 Kudos
619 Views
RichTestardi
Senior Contributor II

Is it possible external circuitry is driving the pin?

 

If you want to verify the HW is connected properly, you could, as a shot in the dark, load StickOS onto the 52233 (from http://www.cpustick.com/downloads.htm) and then use a terminal emulator to connect to (raw) port 1234 of the DHCP IP address assigned to the board...  You can then examine and manipulate pins interactively with commands like:

 

dim x as pin dtin0 for digital output

let x=1

let x=0

 

There's full documentation for StickOS on that page, as well -- it was designed as an interactive rapid prototyping and education environment.  You can see the 52233 Ethernet transport section here: http://www.cpustick.com/stickos.htm#_Toc226454853

 

-- Rich

0 Kudos