Thanks MarkT will consider this. I think my problem has to do with accessing the same pointer in both the interrupt service and the main loop thus leading to a conflict.
Looks like I have a bit of work to do. Thanks to all of you for your suggestions. When I get this thing working, I'll update everyone on what I've got.
Paul, thanks for weighing in on this. I will try to restructure some code per your suggestions.
Good point. I caught that possibility and have insured that p1 is reinitialized only in the interrupt service when bufferdone is set true. Have also...
Joe, That is what I do in the interrupt service. I set bufferdone=true. Loop checks to see if bufferdone= true and processes the buffer.When loop completes it sets bufferdone=false. I think the difference between what you suggest and what I am...
Hi Joe,
I thought if I dont turn off interrupts, the A/D interrupt service routine called by a Timer at 1.0 MHz will overwrite the existing buffer of samples while I'm processing them and change the pointer p1 in doing so. This would upset the...
Interesting idea. Despite your suggestion, the Serial.print in loop does work to print . The problem I have is that in the absence of that print statement in the for (j=0;j<1999;j++) loop, computation of the average value after completion of the...
volatile unsigned int value1[2000]; // buffer for A/D values
volatile unsigned int *p1 = value1; // pointer to A/D sample buffer1
I dont know how it is being allocated or how to find out. this is the allocation info from the compilation if...
A delay doesnt change anything. I tried this. Not overflowing the UDP stack. The UDP data is correct and intact as received as evidenced by the Wireshark UDP stream received when the println statement is present in the for loop.
There are a...
I'm using a T4.1 (600MHz clock) in a fairly complex program that regulates the current in a sensor using PWM to control the voltage in a resonant circuit(No problems here). I am interleaving two A/Ds to achieve 1MHz 12 bit sampling of an analog...