lpc1769 - capture input - need help

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

lpc1769 - capture input - need help

1,011 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Sun Aug 05 09:25:38 MST 2012
Hi,

I'm trying to make my CAP0.0 input work and I'm having a lot of trouble interpreting the CMSIS1.3 functions - this is what I use in my project and I can't use anything else right now. Examples are not too good either.
I know there isn't really a true cmsis 1.3 documentation (or at least there was no such thing some time ago) so the only way for me is experimenting.
I've read the UM10360, Chapter 21: LPC17xx Timer 0/1/2/3 like 10 times now and I think I know how to do my task.
The problem is that a very simple program I wrote, that waits for a CAP interrupt, does not work. It should simply wait for a rising edge on input and trigger an interrupt (I make a break point in the ISR).

I've connected a wire to pin p1[26] and after the program is run I connected it to 3v3 and gnd and nothing happens.

I'm attaching my code - please tell me why it doesn't work.

Thanks!
--
Luke
0 Kudos
Reply
3 Replies

917 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Mon Aug 06 02:30:52 MST 2012
Hm, They set the CCR this way:
LPC_TIM0->CCR =((1<<0)|(1<<1)|(1<<2));

The UM says "bits 31:6 - Reserved, user software should not write ones to reserved bits. The value read from a reserved bit is not defined."

Is this way of assigning walue to CCR OK? I think it's writing all 32 bits.
But maybe it's tested and safe?

edit: cancel that... I should not write ones... and I only write zeros - so I guess that's ok
0 Kudos
Reply

917 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Sun Aug 05 09:49:26 MST 2012
Ha, thanks!
I'm using the wrong ISR :)
0 Kudos
Reply

917 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ex-kayoda on Sun Aug 05 09:40:45 MST 2012
What about sample in #10 of http://knowledgebase.nxp.com/showthread.php?t=2941 :confused:
0 Kudos
Reply