Search the web
Sign In
New User? Sign Up
lpc2000 · LPC ARM Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
unable to count the external clock   Message List  
Reply | Forward Message #43238 of 45909 |
Re: unable to count the external clock

O, yeah, you are right, how stupid I am.
Thank you very much!



--- In lpc2000@yahoogroups.com, Daniel Widyanto <daniel.widyanto@...> wrote:
>
>
>
> Hi,
>
> Check your PINSEL0:
> PINSEL0 |= 1<<12; //set P0.6 as cap0.2
>
> If you read the manual carefully (page 75 section 4.1), it's suppose to be:
> PINSEL0 |= 1<<13;
>
> -daniel
>
> --- On Thu, 7/9/09, robinfei2638 <robinfei2638@...> wrote:
>
> From: robinfei2638 <robinfei2638@...>
> Subject: [lpc2000] Re: unable to count the external clock
> To: lpc2000@yahoogroups.com
> Date: Thursday, July 9, 2009, 7:06 PM
>
>
> --- In lpc2000@yahoogroups .com, "robinfei2638" <robinfei2638@ ...> wrote:
> > Hi,
> >
> > I was trying to use the capture pin to count an external clock, then check
the result from a hypertermial. However, the reading is always zero, the TC
didn't increase. Anybody can help? Thanks.
> > Here is my code
> >
> > void capture()
> > {
> > char s[30]; // Buffer for keep string from integer convert
> > volatile uint32 i;
> >
> > uart0_init(9600) ; // Initial UART0
> > PINSEL0 |= 1<<12; //set P0.6 as cap0.2
> >
> > T0PR = 0;
> > T0CCR = 1<<7;
> > T0TC = 0;
> > T0TCR=0x01;
> >
> > while(1)
> > {
> > i=T0CR2;
> > sprintf(s,"Counter= %d \r",i);
> > uart0_puts(s) ; // Display to Terminal program
> >
> >
> > }
> > }
> >
> > Robin
> >
>
> sorry, i forgot to mention, I'm using a LPC2148 chip.
>





Fri Jul 10, 2009 6:51 pm

robinfei2638
Offline Offline
Send Email Send Email

Forward
Message #43238 of 45909 |
Expand Messages Author Sort by Date

Hi, I was trying to use the capture pin to count an external clock, then check the result from a hypertermial. However, the reading is always zero, the TC...
robinfei2638
Offline Send Email
Jul 9, 2009
7:03 pm

... sorry, i forgot to mention, I'm using a LPC2148 chip....
robinfei2638
Offline Send Email
Jul 9, 2009
7:06 pm

Hi, Check your PINSEL0: PINSEL0 |= 1<<12; //set P0.6 as cap0.2 If you read the manual carefully (page 75 section 4.1), it's suppose to be: PINSEL0 |= 1<<13; ...
Daniel Widyanto
daniel.widyanto
Offline Send Email
Jul 10, 2009
1:19 am

O, yeah, you are right, how stupid I am. Thank you very much!...
robinfei2638
Offline Send Email
Jul 10, 2009
6:52 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help