Search found 210 matches

by danlee58
Wed Dec 16, 2015 2:36 am
Forum: Kitchen sink
Topic: While Loop Ends Unexpectedly.
Replies: 15
Views: 34812

Re: While Loop Ends Unexpectedly.

I wiggle P1.28 in the interrupt. It first appears at the right time after a reset, on the first falling edge of P1.18, but then just oscillates, preventing the main program from running. I could print the Logic Analyzer screen, but it has a black background, and it will use a ton of ink. I'll try a ...
by danlee58
Wed Dec 16, 2015 12:55 am
Forum: Kitchen sink
Topic: While Loop Ends Unexpectedly.
Replies: 15
Views: 34812

Re: While Loop Ends Unexpectedly.

I am only trying to measure the time of the low pulse, not the high time. I only used the printf to verify what I have seen on the output pin. I'll try wiggling a pin in the interrupt, and eliminate the printf. I interrupt on the falling edge just to reset TC, so TC will read the time between the fa...
by danlee58
Tue Dec 15, 2015 2:19 am
Forum: Kitchen sink
Topic: While Loop Ends Unexpectedly.
Replies: 15
Views: 34812

Re: While Loop Ends Unexpectedly.

I put a printf into both the interrupt and the main program. On the terminal I get a sequence of -1s, followed by a sequence of 0s. This corresponds to the signal being high, then going low. Then I get a continuous series of 32s. This represents the value in the 'TIME' integer. I should only get one...
by danlee58
Mon Dec 14, 2015 2:39 pm
Forum: Kitchen sink
Topic: While Loop Ends Unexpectedly.
Replies: 15
Views: 34812

Re: While Loop Ends Unexpectedly.

It appears that the interrupt never returns to the main program. Here is my interrupt routine. unsigned int TIME = 0; __attribute__ ((interrupt)) void TIMER1_IRQHandler(void) { if ((FIO1PIN2 && 0x04) == 1)TIME = (T1_TC & 0X1fffffff); T1_IR = 0x10; //Reset Capture Channel 0 Interrupt. T1_TCR = 2; //R...
by danlee58
Sun Dec 13, 2015 2:50 pm
Forum: Kitchen sink
Topic: While Loop Ends Unexpectedly.
Replies: 15
Views: 34812

Re: While Loop Ends Unexpectedly.

I had Timer1 Interrupt enabled. The Main program While loop hangs when the Interrupt occurs. I must be missing a clear interrupt instruction.
by danlee58
Sun Dec 13, 2015 3:03 am
Forum: Kitchen sink
Topic: While Loop Ends Unexpectedly.
Replies: 15
Views: 34812

While Loop Ends Unexpectedly.

I have a series of Low true 10 msec pulses that repeat every 80 msecs. I read the state on P1.25, and output an inverted version on P0.10. I use this code for a test. while (1){ junk = IN1(25); if ((junk && 1) == 1) LOW(10) else HIGH(10); } After a reset the correct pulse will sometimes occur on P0....
by danlee58
Mon Dec 07, 2015 12:56 pm
Forum: Kitchen sink
Topic: Measure Pulse Width
Replies: 14
Views: 33608

Re: Measure Pulse Width

I already have a file named TIMER1_IRQHandler.c. That's for another application.
by danlee58
Sun Dec 06, 2015 12:14 pm
Forum: Kitchen sink
Topic: Measure Pulse Width
Replies: 14
Views: 33608

Re: Measure Pulse Width

I found a problem with the PINSEL. Now I do get an Interrupt, with the following message.

FaultISR 0xFFFFFFF1 SCB->CFSR=0x00020000
by danlee58
Sun Dec 06, 2015 2:15 am
Forum: Kitchen sink
Topic: Measure Pulse Width
Replies: 14
Views: 33608

Re: Measure Pulse Width

I have: T1_PR = 0; //Set Prescale Register so TC will increment at the full clock rate T1_CTCR = 0; //Set Timer Mode T1_CCR = 0x38; //Set Capture Control Register1 for falling or rising edge and generate Interrupt. T1_TCR = 2; //Reset Timer 1 T1_TCR = 1; //Enable Timer1 VICVectCntl0 = 0xf808f800; //...
by danlee58
Fri Dec 04, 2015 3:36 pm
Forum: Kitchen sink
Topic: Measure Pulse Width
Replies: 14
Views: 33608

Re: Measure Pulse Width

I changed my pin read from IN1(19) to ((FIO1PIN2 & 0x08) == 0x08). That compiles OK. The strange thing is that I use IN1(18) in the Main program, and it compiles & works correctly. My next problem is that my Interrupt procedure never runs. I know that the signal is going Low & High, because my Main ...