MEGA using interrupts - INT2 [SOLVED]

Started by JohnO, August 17, 2014, 10:35:51 AM

JohnO

I am trialling the Jeelabs RF12Demo software on my recently delivered Moteino MEGA. I have made the adjustments I expected but am having a problem around interrupts. The interrupt is firing correctly on packet reception but things go wrong on transmission. The first packet is offered for transmission and the interrupt indicating successful transmission fires but then the interrupt mechanism is stalled with reception and transmission no longer possible. Is there anything unusual about INT2 on PB2 that I should be considering?

I have tried two different RFM69W cards with identical results.

Felix

Does RF12Demo support RFM69 radios?
What speed is the SPI in the jeelib? If it's 8mhz its too fast, slow it down to 4mhz.

JohnO

Thanks Felix, the RF12DEMO branch supports RFM69 radios. The issues I am seeing appear SPI related, I have just turned off SPI2X maybe a need to slow down more.

Felix

I have a hard time keeping up with what everyone else is doing but I guess everyone started to take a serious look at RFM69 and RFM12B is slowly going away.
For the atmega1284p it looks like it needs a slower clock than the mega328p. 4mhz should be good enough.

JohnO

The RFM12B is fine for some jobs and I will still be using them. I have dropped down to 1M SPI and still seeing my problem - perhaps it something else. Works fine at full speed on a 328P.

Felix

Is my latest RFM69 library working?

JohnO

#6
I'm afraid I haven't tried it - would it be able to receive from my Jeelib nodes?

Felix

I don't know since I don't support jeelib.
All I can say is the MoteinoMEGA works with the RFM69 lib (latest) and if there are issues with that then this is the place to bring it up. This forum is meant to support LowPowerLab hardware/libraries only.

JohnO

I have some of your example sketches running now built with your libraries under 1.0.5r2. The gateway & node sketches both work fine on 328P, I have gateway on Jee hardware with RFM69CW hardware and node on a Moteino 328 with RFM69W radio. When I load node onto the MEGA with RFM69W hardware I see:
Transmitting at 868 Mhz...
SPI Flash Init FAIL! (is chip present?)

with nothing on the gateway node.

I may be missing something on the MEGA build as I only changed the board type to do its compile/upload.

Felix

Do you have a FLASH chip on your MoteinoMEGA?

JohnO

No, I don't have flash on my other Moteino 328. It appears to ignore the flash being absent on the 328.

JohnO

I did try the Jeelabs sketch that fails on the MEGA and it works fine on the Moteino 328.

JohnO

#12
I have reversed the roles and now have the MEGA as my gateway node and a 328 as a node.
The MEGA appears to receive and ACK a couple of packets and then goes quiet for a while before receiving another packet or two:

[19/08/14 - 15:03:49:104] Listening at 868 Mhz...
[19/08/14 - 15:03:49:108] SPI Flash Init FAIL! (is chip present?)
[19/08/14 - 15:03:49:108] [3] to [1] 12   [RX_RSSI:-27] - ACK sent. Pinging node                                     [19/08/14 - 15:03:57:915]  3 - ACK...nothing
[19/08/14 - 15:03:59:579] [3] to [1] 123 ABCDEFGHIJ   [RX_RSSI:-38] - ACK sent.
[19/08/14 - 15:04:00:589] [3] to [1] @123 ABCDEFGHIJKL   [RX_RSSI:-128]
[19/08/14 - 15:04:00:635] [3] to [1] 123 ABCDEFGHIJKLM   [RX_RSSI:-38] - ACK sent.
[19/08/14 - 15:04:10:932] [3] to [1] @FLASH_MEM_ID:0x202   [RX_RSSI:-128] - ACK sent. Pinging node 3 - ACK...nothing
[19/08/14 - 15:04:10:965] [3] to [1] 123 ABCDEFGHIJKLMNO   [RX_RSSI:-39] - ACK sent.
[19/08/14 - 15:04:32:093] [3] to [1] 123 ABCDEFGHIJKLMNOPQRSTUVW   [RX_RSSI:-39] - ACK sent.
[19/08/14 - 15:05:07:046] [1] to [1] @123 ABCDEFGHIJKLMNO   [RX_RSSI:-128]
[19/08/14 - 15:05:29:618] [3] to [1] 123 ABCDEFGHIJKLMNOP   [RX_RSSI:-42] - ACK sent. Pinging node 3 - ACK...nothing
[19/08/14 - 15:05:29:721] [3] to [1] 123 ABCDEFGHIJKLMN   [RX_RSSI:-39] - ACK sent.
[19/08/14 - 15:05:45:744] [1] to [8] @123    [RX_RSSI:-128]
[19/08/14 - 15:05:45:792] [3] to [1] 123 A   [RX_RSSI:-39] - ACK sent.
[19/08/14 - 15:06:06:426] [3] to [1] 123 ABCDEFGHIJKL   [RX_RSSI:-128] - ACK sent. Pinging node 3 - ACK...nothing
[19/08/14 - 15:06:45:997] [3] to [1] 1123 ABCDE   [RX_RSSI:-128] - ACK sent.
[19/08/14 - 15:07:22:990] [3] to [1] @123 ABCDEFGHIJKLMNO   [RX_RSSI:-128]
[19/08/14 - 15:07:23:850] [3] to [1] 123 ABCDEFGHIJKLMNOPQ   [RX_RSSI:-48] - ACK sent.
[19/08/14 - 15:07:59:877] [3] to [1] 123 ABCDEFGHIJKLMNOPQ   [RX_RSSI:-40] - ACK sent. Pinging node 3 - ACK...nothing


I have the 328 node sending packets every 900ms. The node never appears to receive the ACK.

Felix

The "Flash init FAIL" means there is no FLASH on board, which corresponds to reality.
Have you updated the RFM69 library?

JohnO

I have the latest version from git: Add Mighty Boost control sketch being the latest update.

I have also just reflowed the soldered radio connections.