HCS12 (MC9S12C32) Pin Output Voltage

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

HCS12 (MC9S12C32) Pin Output Voltage

4,344 Views
Deadstar
Contributor I
Hey guys,

I am working using the SCM-12C32 HCS12 module on a Freescale AXM-0392 development board.

I have found my output voltages on pins such as PORTA-0 and PORTB-4 are about 600mV P2P. According to the data sheet this figure should be about 4.2V.

The problem is I could do with this higher voltage and would like to avoid messing around with amplifiers etc.

Does anyone have any ideas why the output voltages are so low?

I have tried setting the RDRIV register to 0x00 incase that effected it but no luck.

Thanks again in advance,

Colin


Message Edited by Deadstar on 2008-02-25 04:43 PM
Labels (1)
0 Kudos
9 Replies

889 Views
colinh
Contributor I
The usual culprit is trying to drive too much current - what are the pins connected to? (although 600mV implies something approaching a dead short)

Are you measuring this voltage at the pin?  What frequency are you trying to switch at?  The reason I ask is that if you had a heavily capacitive load and you were trying to switch at a particularly high speed then you might just see the ramp up / ramp down as the capacitor charges/discharges

I dont think PORTA and PORTB support an open drain mode and if this is correct then assuming (a) they are configured as output, and (b) they are not over-loaded, then you should see pretty close to Vdd.

Cheers
Colin
0 Kudos

889 Views
Deadstar
Contributor I
Hey, thanks for the reply.
 
The voltage I mentioned is monitored with no load at the pins. When I try with a reasonably large resistor to ground I monitor the same voltage.
 
The signal is switching quite quickly (about 2MHz)  but when I monitor the voltage I see no traces of slow rising or falling edges implying a capacitive element.
 
The ports are configured as outputs but I am not sure what you mean by 'open drain mode'. Could you elaborate?
 
Colin
0 Kudos

889 Views
colinh
Contributor I
With respect to your question re open drain outputs: Some micros (and I'm not even sure that the S12 is one of them) support a mode where there is no P channel FET in the selected output circuits. It can pull down to GND but  cannot  source current  from the positive rail. Hypothetically if you had this type of output without any load connected (ie a pullup resistor) you would expect to see 0Vpp when you switched, but in practice you might see some small swing due to internal leakages etc.

As XBOT said - shoot us an extract of your code - it might shed some light...

0 Kudos

889 Views
Deadstar
Contributor I
Guys,

This is not the exact code I am using but it simplified down to the key part. This code gives a voltage of about 700mV p2p monitoring pin 0 of PORTA.

Code:
#include <hidef.h>      /* common defines and macros */#include <mc9s12c32.h>     /* derivative information */#pragma LINK_INFO DERIVATIVE "mc9s12c32"void main(void) {    DDRA = 0xFF;  PORTA = 0x00;  for(;;)   {    __asm    {      LDAA #$AA      STAA PORTA      LSR PORTA // Shift out data      LSR PORTA // scope used to view PORTA-0       LSR PORTA      LSR PORTA      LSR PORTA      LSR PORTA      LSR PORTA    }   }/* wait forever */}

As I said; very simple.

Let me know if you see anything strange. I am dusting off my amplifier textbook!
 

0 Kudos

889 Views
bigmac
Specialist III
Hello,
 
Run the following code, and then measure the DC voltage at each Port A pin.  Compare the oscilloscope calibration with the results from a DC voltmeter, just in case there is a probe problem.
 
void main(void)

  DDRA = 0xFF;
  PORTA = 0xFF;

  for( ; ; );
}
 
A consistent voltage of 0.6 to 0.7 volts suggests the forward voltage drop across a diode.
 
Regards,
Mac
 
0 Kudos

889 Views
Xbot
Contributor II
Code:
      LSR PORTA // Shift out data      LSR PORTA // scope used to view PORTA-0

 
I'm not sure with the comments "//" you placed inside the asm code...
0 Kudos

889 Views
Deadstar
Contributor I
Hey there,

Sorry I have been really busy recently.

I managed to get my hands on some different equipment and now everything works OK.

My guess it was the scope.

Thanks for the consideration though, I really appreciate the time and effort you guys put it.

Colin
0 Kudos

889 Views
Deadstar
Contributor I
Just to let you know,

I tried the above code on an MC9S12E128 and i monitored 800mV p2p on channel A output.

Not sure if that helps,

Colin
0 Kudos

889 Views
Xbot
Contributor II
maybe there is something wrong with your code. can you post it?
fyi to configure pin as output DDR is set to 1 and vice-versa.


Message Edited by Xbot on 2008-02-26 11:50 AM
0 Kudos