Welcome! Log In Create A New Profile

Advanced

Slow Interrupts?

Posted by Sander 
Slow Interrupts?
January 03, 2009 09:27AM
Hi all,

i'm still in the process of migrating my Home Automation project from the Arduino to the Sanguino platform. I'm quite sure i've created an comparable circuit which consists of a RF-receiver and a RF-transmitter.
I'm able to correctly send pulses via the RF-transmitter to turn on and off the lights in my house. But the signals i receive from the RF-receiver seem to be "slower".
On the Arduino i received many short pulses. On the Sanguino i received much less longer pulses. I've connected the data-pin of my RF-receiver to Pin 11 which triggers IRQ 1. On each IRQ i measure the duration and decode the pulses. Instead of receiving codes like:
RSSI [ 20] 68 [ 20] 68 [ 19] 68 [ 64] 25 [ 18] 69 [ 19] 69 [ 19] 69 [ 19] 68 [ 19] 69 [ 19] 69 [ 19] 69 [ 19] 68 [ 19] 69 [ 19] 69 [ 19] 69 [ 19] 68 [ 19] 69 [ 19] 69 [ 19] 69 [ 62] 26 [ 18] 69 [ 63] 25 [ 18] 70 [ 62] 26 [ 18] 623

I receive on the Sanguino:
RSSI [ 25] 1028 [ 404] 856 [ 394] 856 [ 395] 853 [ 397] 853 [ 401] 849 [ 396] 842 [ 409] 844 [ 406] 849 [ 401] 838 [ 412] 847 [ 403] 848 [ 411] 839 [ 401] 851 [ 403] 846 [ 400] 851 [ 400] 845 [ 404] 853 [ 398] 851 [ 399] 851 [ 399] 852 [ 398] 852 [ 398] 852 [ 398] 852 [ 398] 852 [ 398] 853 [ 397] 853 [ 397] 852 [ 409] 828 [ 422] 830 [ 420] 830 [ 419] 833 [ 417] 835
[ 414] 846 [ 404] 845 [ 405] 846 [ 404] 847 [ 392] 858 [ 392] 857 [ 392] 859 [ 391] 858 [ 393] 858 [ 392] 858 [ 391] 858 [ 392] 858 [ 392] 858 [ 392] 858 [ 392] 858 [ 392] 859 [ 391] 860 [ 391] 858 [ 391] 859 [ 391]

I don't think it has got something to do with the pre-scaler as transmitting signals works perfectly.

This are the most important parts of my code:

#define RSSIPIN 10 // The pin number of the RSSI signal
#define DATAPIN 11 // The pin number of the data signal

#define RSSIIRQNR 0 // The irq number of the RSSI pin
#define DATAIRQNR 1 // The irq number of the data pin

In Setup:
TCCR1A=0; // Normal mode (timer)
#if DATAIRQNR == 0
??
#elif DATAIRQNR == 1
TCCR1B = 0<=prevTime? (newTime - prevTime) : ((!prevTime) + 1) + newTime);

prevTime = newTime;
}

Does somebody see an obvious error i made in code? Am i using the incorrect (slower) interrupt pins or something? I've already put many hours into locating the problem, but with no succes.. Help would be much appreciated.
Oh..and.. It's an opensource project, hosted at GoogleCode

Thanks in advance, Sander Schutten
Re: Slow Interrupts?
January 03, 2009 03:44PM
I've found it myself!

I was using INT0 (Pin10) and INT1 (Pin11) for getting an initial trigger and INT1 for the data-pulses. Apparantly i had to use Pin14 on the Sanguino, which is the ICP.
Sorry, only registered users may post in this forum.

Click here to login