Using XIN pin as port or timer output

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using XIN pin as port or timer output

MarkoC
Hello,
 
I am trying to use the XIN pin (pin 19 on MSP430G2553, MSP-EXP430G2
launchpad) as the timer TA0.1 output, but can't get it to work.
Also tried to do port output there, also no success.
I have set the ACLK to VLO in BCSCTL3, port 2.6 direction to output, and
P2SEL, P2SEL2 to 0,0 for port, or 1,0 for timer.
The timer is working, I can see it's output on pin14, but not on pin 19.
Also, when I configure pin 19 as P2.6, it does not change when I write to
P2OUT.
I did check the values in the registers with md (mspdebug), and they are as
I wrote them.
With an oscilloscope, I can see a slight change on pin 19 when I start the
program. Before start, it is at around 0.5V, after start it goes down to 0V.
 
Any idea what I am doing wrong here?
 
Marko Cebokli
 

------------------------------------------------------------------------------

_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: Using XIN pin as port or timer output

Eric Decker
Table 21 on pg 53 is confusing.  There are two columns, P2SEL.6/P2SEL.7 and
P2SEL2.6/P2SEL2.7.  I have no idea what the P2SEL2.6/P2SEL2.7 column is
referring to (and it has the opposite value of P2SEL.6/P2SEL.7.

Same table says that for Capative Sensing P2SEL2.6 is a 1.  Not sure where
that gets set or reset.

For TA0.1 to be output on P2.6, we need P2DIR.6 to be a 1, P2SEL.6 to be a
1, and P2SEL2.6 to be 0.

Now if that is set up P2.6 will output the output of output module for
Timer0 CCR1.  You have to have the timer h/w programmed properly and the
output mode set properly to see something meaningful on the TA0.1 pin.

I'm most concerned about you not getting P2.6 to act as a port.  That is
where I would start.  Get that working first.

You have to have P2DIR.6 set to 1, P2SEL.6 set to 0.  Then P2.6 should
follow what you wright to bit 6 of P2OUT.


On Mon, Nov 28, 2016 at 12:54 AM, Marko Cebokli <[hidden email]>
wrote:

> Hello,
>
> I am trying to use the XIN pin (pin 19 on MSP430G2553, MSP-EXP430G2
> launchpad) as the timer TA0.1 output, but can't get it to work.
> Also tried to do port output there, also no success.
> I have set the ACLK to VLO in BCSCTL3, port 2.6 direction to output, and
> P2SEL, P2SEL2 to 0,0 for port, or 1,0 for timer.
>


> The timer is working, I can see it's output on pin14, but not on pin 19.
>

what exactly are you seeing on pin 14?   How do you know the timer is
working?

how do you have P1.6 programmed?


> Also, when I configure pin 19 as P2.6, it does not change when I write to
> P2OUT.
> I did check the values in the registers with md (mspdebug), and they are as
> I wrote them.
> With an oscilloscope, I can see a slight change on pin 19 when I start the
> program. Before start, it is at around 0.5V, after start it goes down to
> 0V.
>
> Any idea what I am doing wrong here?
>
> Marko Cebokli
>
>
> ------------------------------------------------------------
> ------------------
>
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>

--
Eric B. Decker
Senior (over 50 :-) Researcher

------------------------------------------------------------------------------

_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: Using XIN pin as port or timer output

David W. Schultz
In reply to this post by MarkoC
On 11/28/2016 02:54 AM, Marko Cebokli wrote:
> Any idea what I am doing wrong here?

I suspect that you haven't configured the pin correctly. This simple
program causes P2.6 to toggle along with the LED:

#include <msp430.h>


int main()
{
  WDTCTL = WDTPW + WDTHOLD;        // stop watchdog timer

  P1DIR = P2DIR = 0xff;

  P2DIR &= ~BIT7;
  P2SEL &= ~BIT6;
  P2SEL2 &= ~BIT6;

  while(1)
    {
      P1OUT ^= BIT0;
      P2OUT ^= BIT6;
      __delay_cycles(1000000L);
    }
}

XIN and XOUT connect to the pin headers via 0 Ohm resistors R28 and R29.
If those resistors are not present, then no signal will reach those pins.


--
David W. Schultz
http://home.earthlink.net/~david.schultz
"Life without stock is barely worth living..." - Anthony Bourdain

------------------------------------------------------------------------------
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: Using XIN pin as port or timer output

MarkoC
The problem was that P2SEL bit 7 also affects pin 19. It is set upon reset
and has to be cleared, to use pin 19 as timer output.
Thanks again to all that ave responded. (This forum is set so, that when you
hit "reply", it goes only to the poster)

Marko Cebokli

-----Original Message-----
From: David W. Schultz [mailto:[hidden email]]
Sent: 30 November, 2016 10:37 PM
To: [hidden email]
Subject: Re: [Mspgcc-users] Using XIN pin as port or timer output

On 11/28/2016 02:54 AM, Marko Cebokli wrote:
> Any idea what I am doing wrong here?

I suspect that you haven't configured the pin correctly. This simple program
causes P2.6 to toggle along with the LED:

#include <msp430.h>


int main()
{
  WDTCTL = WDTPW + WDTHOLD;        // stop watchdog timer

  P1DIR = P2DIR = 0xff;

  P2DIR &= ~BIT7;
  P2SEL &= ~BIT6;
  P2SEL2 &= ~BIT6;

  while(1)
    {
      P1OUT ^= BIT0;
      P2OUT ^= BIT6;
      __delay_cycles(1000000L);
    }
}

XIN and XOUT connect to the pin headers via 0 Ohm resistors R28 and R29.
If those resistors are not present, then no signal will reach those pins.


--
David W. Schultz
http://home.earthlink.net/~david.schultz
"Life without stock is barely worth living..." - Anthony Bourdain

----------------------------------------------------------------------------
--
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


------------------------------------------------------------------------------
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users