Hi,
On Saturday, September 08, 2012 05:09:27 PM Joe Tuttle wrote:
> I tried to go back to 1.20 and I couldn't get my code to work with it.
> I may still try again later.
I think it would be good if you did it now: then you wont have such a big
difference between your code and the mainline..
>
> One thing that I found with my version of the library...when I was
> sending a lot of packets (one send, then another...which waited on the
> first to finish), I was also checking to see if serial data was
> available in between the sends. What I found was that I was dropping
> a lot of serial data. I assumed this had something to do with all of
> the atomic blocks.
In your code, is the mode test/wait at the beginning of send() inside or
outside the interrupt block?
I think it can and should be outside: I dont think it needs protection. Thats
how it is in 1.20. The idea of the atomic blocks should be that they only last
a very short time, and not be operating during a busy/wait
The recv code you sent quite a while back has the test *inside* the atomic
block.
> I switched all of the blocks to just disabling
> INT0, and I no longer have incoming serial issues. I did find that
> you can't disable the interrupt during the setup routine, or your
> application will lock up. I will probably test reading the interrupt
> mask, and then restoring it just like the atomic block does for global
> interrupts.
>
> I went back to using SPI...just a little faster than bit-banging.
> Although I think it would make a great addition to the library...to be
> able to switch it to bit-bang mode so that you can use any 4 pins you
> want.
Yes, that would be nice. Maybe need to abstract the SPI library.
>
> I also found that if you want RSSI, you have to use a hardware
> interrupt. The way that the library gets the last rssi, is via the
> interrupt when it receives a valid preamble. I found that this was
> not reliable when I was servicing the interrupts from the main loop.
> By the time I went to service the interrupt, the radio signal may have
> been finished. But everything else seemed to work well without the
> interrupt. It made debugging a lot easier. But I went back to using
> the hardware interrupt.
>
> On Fri, Sep 7, 2012 at 9:04 AM, Joe Tuttle <
joet...@gmail.com> wrote:
> > Thanks for the suggestion...the new 1.20 code does the wait at the
> > beginning of the send. I'm not locking up on the wait. Somewhere
> > else in my code. Still eluding me.
> >
> > I have took out the RF22 code temporarily, and I cannot get the
> > lockup. I put it back in, and I get a lockup somewhere. I have even
> > replaced the SPI code with my own bit-bang code. The lockup still
> > happens, and the library doesn't yet fully work in bit-bang mode.
> > Still debugging. But I should end up with code that allows the RF22
> > to work with any 4 I/O pins and no interrupt pin.
> >
> > On Fri, Sep 7, 2012 at 8:58 AM, Paul Martinsen <
pmart...@gmail.com>
wrote:
> >> Do you call waitPacketSent after each message is sent? I found calling
> >> send twice without waiting for completion can cause lookups.