Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC

Ads

Discussion Groups

Discussion Groups | 68HC12 | Re: Re: Use PORTT as input/output and timer

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

Use PORTT as input/output and timer - Pascal - Aug 7 9:08:00 2004

Hello,

I want to know if it is possible to use the portt (for example PT0) as a simple port (input/output) and in the same time use the timer C0I?

Thank you very much

Regards

[Non-text portions of this message have been removed]





(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )


Re: Use PORTT as input/output and timer - Pascal - Aug 9 4:09:00 2004

Hi

Is anybody could help me (the question is below)?

Thank you very much
----- Original Message -----
From: Pascal
To:
Sent: Saturday, August 07, 2004 4:08 PM
Subject: [68HC12] Use PORTT as input/output and timer Hello,

I want to know if it is possible to use the portt (for example PT0) as a simple port (input/output) and in the same time use the timer C0I?

Thank you very much

Regards

[Non-text portions of this message have been removed] Yahoo! Groups Sponsor
ADVERTISEMENT ------------------------------------------------------------------------------
Yahoo! Groups Links

a.. To
[Non-text portions of this message have been removed]





(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Use PORTT as input/output and timer - Peter Lissenburg - Aug 9 4:14:00 2004

Hi Pascal,
I think the answer is generally yes, but I'm not sure if that
covers all versions of the chip. There is a register that associates the
pin to the timer channel. Check the docs for the chip you intend to use.
PL At 11:09 AM 9/08/2004 +0200, you wrote:
>Hi
>
>Is anybody could help me (the question is below)?
>
>Thank you very much
> ----- Original Message -----
> From: Pascal
> To:
> Sent: Saturday, August 07, 2004 4:08 PM
> Subject: [68HC12] Use PORTT as input/output and timer > Hello,
>
> I want to know if it is possible to use the portt (for example PT0) as
> a simple port (input/output) and in the same time use the timer C0I?
>
> Thank you very much
>
> Regards
>
> [Non-text portions of this message have been removed] > Yahoo! Groups Sponsor
> ADVERTISEMENT >------------------------------------------------------------------------------
> Yahoo! Groups Links
>
> a.. To >
>[Non-text portions of this message have been removed] >Yahoo! Groups Links




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Use PORTT as input/output and timer - ctrobot28 - Aug 9 23:22:00 2004

--- In , "Pascal" <pascal.derex@l...> wrote:
> Hi
>
> Is anybody could help me (the question is below)?
>
> Thank you very much
> ----- Original Message -----
> From: Pascal
> To:
> Sent: Saturday, August 07, 2004 4:08 PM
> Subject: [68HC12] Use PORTT as input/output and timer > Hello,
>
> I want to know if it is possible to use the portt (for example
PT0) as a simple port (input/output) and in the same time use the
timer C0I? You can use, at the same time, different pins of port T as general
I/O and input capture/output compare. But you can't use the same pin
for both, at the same time (maybe that's obvious). I use PT0 for
input capture, PT7 for output compare, and PT2 for general I/O. PT0
and PT7 have special properties for IC/OC (e.g. pulse counters).

Pat




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Re: Use PORTT as input/output and timer - Andrew Lohmann's New Email Server - Aug 10 2:59:00 2004

It is disappointing to read: > I want to know if it is possible to use the portt (for example
PT0) as a simple port (input/output) and in the same time use the
timer C0I? >You can use, at the same time, different pins of port T as general
I/O and input capture/output compare. But you can't use the same pin
for both, at the same time (maybe that's obvious). I use PT0 for
input capture, PT7 for output compare, and PT2 for general I/O. PT0
and PT7 have special properties for IC/OC (e.g. pulse counters).
On HD6301 which is was an enhanced feature MC6801 I used to Output Compare to generate a periodic interrupts, with the pin output disabled. I could then use the pin as an input (not sure about output). I have also used the Input Capture as an interrupt source and also used the same pin as input to see the state of the pin. The latter seems to work on MC9S12E128, as well. Andrew Lohmann AIIE
Design Engineer

PLEASE NOTE NEW EMAIL ADDRESS IS: Bellingham + Stanley Ltd.
Longfield Road, Tunbridge Wells, Kent, TN2 3EY, England.
Tel: +44 (0) 1892 500400
Fax: +44 (0) 1892 543115
Website: www.bs-ltd.com

[Non-text portions of this message have been removed]




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Re: Use PORTT as input/output and timer - Edward Karpicz - Aug 10 3:16:00 2004

From: "Andrew Lohmann's New Email Server" andrew.lohmann@b
Sent: Tuesday, August 10, 2004 10:59 AM > It is disappointing to read: > > I want to know if it is possible to use the portt
(for example
> PT0) as a simple port (input/output) and in the same
time use the
> timer C0I?
> >
>
> >You can use, at the same time, different pins of port T
as general
> I/O and input capture/output compare. But you can't use
the same pin
> for both, at the same time (maybe that's obvious). I use
PT0 for
> input capture, PT7 for output compare, and PT2 for
general I/O. PT0
> and PT7 have special properties for IC/OC (e.g. pulse
counters). >
> On HD6301 which is was an enhanced feature MC6801 I used
to Output Compare to generate a periodic interrupts, with
the pin output disabled. I could then use the pin as an
input (not sure about output). I have also used the Input
Capture as an interrupt source and also used the same pin as
input to see the state of the pin. The latter seems to work
on MC9S12E128, as well. First one, = output compare without pin action + DDRT
dependent pin I/O, also is possible with HC12/HCS12
ECT/TIM. RTFM!

Edward > Andrew Lohmann AIIE
> Design Engineer
>
> PLEASE NOTE NEW EMAIL ADDRESS IS: > Bellingham + Stanley Ltd.
> Longfield Road, Tunbridge Wells, Kent, TN2 3EY, England.
> Tel: +44 (0) 1892 500400
> Fax: +44 (0) 1892 543115
> Website: www.bs-ltd.com




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Re: Use PORTT as input/output and timer - Pascal - Aug 10 3:41:00 2004

Hi,

I my application i use OC2 and OC3 as periodic interrupt. I would like to use PT2 as an output and PT3 as an input in the same time but not synchronised on OC2 and OC3 periodic interrupt.

For example :
In my program i would like to test PT3 like if (PT3&0x08) and command PT2 like PT2=0x04.
In the same time i want periodic interrupt with OC2 and OC3.

Is it possible on 9s12A64?

Thank you very much

Regards
----- Original Message -----
From: Edward Karpicz
To:
Sent: Tuesday, August 10, 2004 10:16 AM
Subject: Re: [68HC12] Re: Use PORTT as input/output and timer From: "Andrew Lohmann's New Email Server" andrew.lohmann@b
Sent: Tuesday, August 10, 2004 10:59 AM > It is disappointing to read: > > I want to know if it is possible to use the portt
(for example
> PT0) as a simple port (input/output) and in the same
time use the
> timer C0I?
> >
>
> >You can use, at the same time, different pins of port T
as general
> I/O and input capture/output compare. But you can't use
the same pin
> for both, at the same time (maybe that's obvious). I use
PT0 for
> input capture, PT7 for output compare, and PT2 for
general I/O. PT0
> and PT7 have special properties for IC/OC (e.g. pulse
counters). >
> On HD6301 which is was an enhanced feature MC6801 I used
to Output Compare to generate a periodic interrupts, with
the pin output disabled. I could then use the pin as an
input (not sure about output). I have also used the Input
Capture as an interrupt source and also used the same pin as
input to see the state of the pin. The latter seems to work
on MC9S12E128, as well. First one, = output compare without pin action + DDRT
dependent pin I/O, also is possible with HC12/HCS12
ECT/TIM. RTFM!

Edward > Andrew Lohmann AIIE
> Design Engineer
>
> PLEASE NOTE NEW EMAIL ADDRESS IS: > Bellingham + Stanley Ltd.
> Longfield Road, Tunbridge Wells, Kent, TN2 3EY, England.
> Tel: +44 (0) 1892 500400
> Fax: +44 (0) 1892 543115
> Website: www.bs-ltd.com Yahoo! Groups Sponsor
ADVERTISEMENT ------------------------------------------------------------------------------
Yahoo! Groups Links

a.. To
[Non-text portions of this message have been removed]




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Re: Use PORTT as input/output and timer - Edward Karpicz - Aug 10 4:18:00 2004

From: "Pascal" <pascal.derex@li>
Sent: Tuesday, August 10, 2004 11:41 AM > Hi,
>
> I my application i use OC2 and OC3 as periodic interrupt.
I would like to use PT2 as an output and PT3 as an input in
the same time but not synchronised on OC2 and OC3 periodic
interrupt.
>
> For example :
> In my program i would like to test PT3 like if (PT3&0x08)
and command PT2 like PT2=0x04.
> In the same time i want periodic interrupt with OC2 and
OC3.
>
> Is it possible on 9s12A64?

Yes, it's possible.
You can read PTT pin level whenewer you want. PTIT even
reports correct
logical level if you did setup your PTT to output logical 1
though PTT pin is shorted
to Vss.
When TCTL1/2 register OMx or OLx bit (or both are) is
one, the pin associated with OCx
becomes an output tied to OCx disregarding DDRTx. Also
setting the OC7Mx (x ranges from
0 to 6) will set the corresponding port to be an output
port ,disregarding DDRTx ,when the
corresponding TIOSx (x ranges from 0 to 6) bit is set to be
an output compare. Simply keep these bits cleared and
set DDRTx to 1 for output
and 0 for input.

To setup up TC2 for OC and PTT2 pin foroutput:

TIOS |= (1<<2);
OC1M &= ~(1<<2);
TCTL12 &= ~(3<<(2*2)); // TCTL12 is concatenated
TCTL1:TCTL2
DDRT |= (1<<2);

To setup up TC3 for OC and PTT3 pin for input:

TIOS |= (1<<3);
OC1M &= ~(1<<3);
TCTL12 &= ~(3<<(2*3)); // TCTL12 is concatenated
TCTL1:TCTL2
DDRT &= ~(1<<3); Edward
> Thank you very much
>
> Regards
> ----- Original Message -----
> From: Edward Karpicz
> To:
> Sent: Tuesday, August 10, 2004 10:16 AM
> Subject: Re: [68HC12] Re: Use PORTT as input/output and
timer > From: "Andrew Lohmann's New Email Server"
andrew.lohmann@b
> Sent: Tuesday, August 10, 2004 10:59 AM > > It is disappointing to read:
> >
> >
> > > I want to know if it is possible to use the
portt
> (for example
> > PT0) as a simple port (input/output) and in the same
> time use the
> > timer C0I?
> > >
> >
> > >You can use, at the same time, different pins of
port T
> as general
> > I/O and input capture/output compare. But you can't
use
> the same pin
> > for both, at the same time (maybe that's obvious). I
use
> PT0 for
> > input capture, PT7 for output compare, and PT2 for
> general I/O. PT0
> > and PT7 have special properties for IC/OC (e.g.
pulse
> counters).
> >
> >
> >
> > On HD6301 which is was an enhanced feature MC6801 I
used
> to Output Compare to generate a periodic interrupts,
with
> the pin output disabled. I could then use the pin as an
> input (not sure about output). I have also used the
Input
> Capture as an interrupt source and also used the same
pin as
> input to see the state of the pin. The latter seems to
work
> on MC9S12E128, as well.
> >
>
> First one, = output compare without pin action +
DDRT
> dependent pin I/O, also is possible with HC12/HCS12
> ECT/TIM. RTFM!
>
> Edward
>
> >
> > Andrew Lohmann AIIE
> > Design Engineer
> >
> > PLEASE NOTE NEW EMAIL ADDRESS IS:
> >
> >
> > Bellingham + Stanley Ltd.
> > Longfield Road, Tunbridge Wells, Kent, TN2 3EY,
England.
> > Tel: +44 (0) 1892 500400
> > Fax: +44 (0) 1892 543115
> > Website: www.bs-ltd.com > Yahoo! Groups Sponsor
> ADVERTISEMENT > ----------------------------------------------------------
--------------------
> Yahoo! Groups Links
>
> a.. To >
> [Non-text portions of this message have been removed] >
> ------------------------ Yahoo! Groups
Sponsor --------------------~-->
> Yahoo! Domains - Claim yours for only $14.70
> http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/dN_tlB/TM
> ----------------------------------------------------------
----------~- > Yahoo! Groups Links




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Re: Use PORTT as input/output and timer - Pascal - Aug 10 4:36:00 2004

Thank you very much for your answer Edward
----- Original Message -----
From: Edward Karpicz
To:
Sent: Tuesday, August 10, 2004 11:18 AM
Subject: Re: [68HC12] Re: Use PORTT as input/output and timer From: "Pascal" <pascal.derex@li>
Sent: Tuesday, August 10, 2004 11:41 AM > Hi,
>
> I my application i use OC2 and OC3 as periodic interrupt.
I would like to use PT2 as an output and PT3 as an input in
the same time but not synchronised on OC2 and OC3 periodic
interrupt.
>
> For example :
> In my program i would like to test PT3 like if (PT3&0x08)
and command PT2 like PT2=0x04.
> In the same time i want periodic interrupt with OC2 and
OC3.
>
> Is it possible on 9s12A64?

Yes, it's possible.
You can read PTT pin level whenewer you want. PTIT even
reports correct
logical level if you did setup your PTT to output logical 1
though PTT pin is shorted
to Vss.
When TCTL1/2 register OMx or OLx bit (or both are) is
one, the pin associated with OCx
becomes an output tied to OCx disregarding DDRTx. Also
setting the OC7Mx (x ranges from
0 to 6) will set the corresponding port to be an output
port ,disregarding DDRTx ,when the
corresponding TIOSx (x ranges from 0 to 6) bit is set to be
an output compare. Simply keep these bits cleared and
set DDRTx to 1 for output
and 0 for input.

To setup up TC2 for OC and PTT2 pin foroutput:

TIOS |= (1<<2);
OC1M &= ~(1<<2);
TCTL12 &= ~(3<<(2*2)); // TCTL12 is concatenated
TCTL1:TCTL2
DDRT |= (1<<2);

To setup up TC3 for OC and PTT3 pin for input:

TIOS |= (1<<3);
OC1M &= ~(1<<3);
TCTL12 &= ~(3<<(2*3)); // TCTL12 is concatenated
TCTL1:TCTL2
DDRT &= ~(1<<3); Edward
> Thank you very much
>
> Regards
> ----- Original Message -----
> From: Edward Karpicz
> To:
> Sent: Tuesday, August 10, 2004 10:16 AM
> Subject: Re: [68HC12] Re: Use PORTT as input/output and
timer > From: "Andrew Lohmann's New Email Server"
andrew.lohmann@b
> Sent: Tuesday, August 10, 2004 10:59 AM > > It is disappointing to read:
> >
> >
> > > I want to know if it is possible to use the
portt
> (for example
> > PT0) as a simple port (input/output) and in the same
> time use the
> > timer C0I?
> > >
> >
> > >You can use, at the same time, different pins of
port T
> as general
> > I/O and input capture/output compare. But you can't
use
> the same pin
> > for both, at the same time (maybe that's obvious). I
use
> PT0 for
> > input capture, PT7 for output compare, and PT2 for
> general I/O. PT0
> > and PT7 have special properties for IC/OC (e.g.
pulse
> counters).
> >
> >
> >
> > On HD6301 which is was an enhanced feature MC6801 I
used
> to Output Compare to generate a periodic interrupts,
with
> the pin output disabled. I could then use the pin as an
> input (not sure about output). I have also used the
Input
> Capture as an interrupt source and also used the same
pin as
> input to see the state of the pin. The latter seems to
work
> on MC9S12E128, as well.
> >
>
> First one, = output compare without pin action +
DDRT
> dependent pin I/O, also is possible with HC12/HCS12
> ECT/TIM. RTFM!
>
> Edward
>
> >
> > Andrew Lohmann AIIE
> > Design Engineer
> >
> > PLEASE NOTE NEW EMAIL ADDRESS IS:
> >
> >
> > Bellingham + Stanley Ltd.
> > Longfield Road, Tunbridge Wells, Kent, TN2 3EY,
England.
> > Tel: +44 (0) 1892 500400
> > Fax: +44 (0) 1892 543115
> > Website: www.bs-ltd.com > Yahoo! Groups Sponsor
> ADVERTISEMENT > ----------------------------------------------------------
--------------------
> Yahoo! Groups Links
>
> a.. To >
> [Non-text portions of this message have been removed] >
> ------------------------ Yahoo! Groups
Sponsor --------------------~-->
> Yahoo! Domains - Claim yours for only $14.70
> http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/dN_tlB/TM
> ----------------------------------------------------------
----------~- > Yahoo! Groups Links
Yahoo! Groups Sponsor
ADVERTISEMENT ------------------------------------------------------------------------------
Yahoo! Groups Links

a.. To
[Non-text portions of this message have been removed]




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )