If you have specific tests, I can do it, even if I do not control everything...
Test data received by interruption
(20 posts) (4 voices)-
Posted 3 years ago #
-
Bernardo769 - what are you asking? I am not clear.
A simple technique to generate consistently timed events, potentially useful to test interrupts, is to use a signal from a timer. Once set, the timer will be relatively stable (using the MCU's crystal), and consistent.
A very simple approach, which needs very little software is feed a timers PWM output into a pin, and that gives a signal source which can trigger an interrupt.
By adjusting the duration of the timer count, you can sweep it across a range of frequencies in 1/72,000,000 increments.
By using two timer outputs from the same timer, you can trigger two pins, and by adjusting the PWM value for each, you can set which pin changes first and second.Posted 3 years ago # -
My lack of experience forces me to ask the obvious questions for you.
I'll use a second Maple to generate a PWM signal clean.
I will keep you informed of the outcome.Posted 3 years ago # -
Bernardo769 - You can use a second Maple, but you don't need a second Maple.
Take a PWM output pin, and connect it back into the pin you are trying to test. The timers are pure hardware, so once the values for frequency and 'pwmWrite' ratio are set, they don't generate interrupts, or run any software.
Posted 3 years ago # -
Hi,
I used a second Maple with this sketch :#include <Servo.h> #define PoloDigi4 26 Servo myservo; void setup(){ pinMode(BOARD_LED_PIN, OUTPUT); // Servo : myservo.attach(PoloDigi4); } // Move the servo to one extreme then to the other void loop(){ togglePin(BOARD_LED_PIN); for (int valServo=1000; valServo<2000; valServo++){ myservo.writeMicroseconds(valServo); // OK delay(1); } togglePin(BOARD_LED_PIN); for (int valServo=2000; valServo>1000; valServo--){ myservo.writeMicroseconds(valServo); // OK delay(1); } }
With a connection between Maple1-pin20 to Maple2-pin26
I still have the problem :
http://bernard.o.perso.neuf.fr/Electronic/MAPLE/BugRC/sourceMaplePWM.jpgIf there is no other solution, I'll put up a soft filter to eliminate and correct the incorrect values.
Posted 3 years ago #
Reply
You must log in to post.