Project

General

Profile

debugging software on the jeenode micro

Added by Rolf over 5 years ago

Successfully uploaded a sketch to the jeenode micro, the “blink sketch” is working. Then I started to adapt jeenode software, a sketch which sends data to a jeelink. But the jeelink seems to not receive RF-packets.

My question is, what’s the way for software debugging on the jeenode micro, for the normal way via /serial/USB-BUB is not available?


Replies (17)

RE: debugging software on the jeenode micro - Added by JohnO over 5 years ago

/// Serial support (output only) for Tiny supported by TinyDebugSerial
/// http://www.ernstc.dk/arduino/tinycom.html
/// 9600, 38400, or 115200
/// Connect Tiny84 PB0 to USB-BUB RXD for serial output from sketch.

The above is built in these days and works a treat.

RE: debugging software on the jeenode micro - Added by JohnO over 5 years ago

But you may find PB0 connects to the mosfet on jn2/3. I haven’t found out how to redirect the pin yet.

RE: debugging software on the jeenode micro - Added by martynj over 5 years ago

@Rolf,

If you are not confident that the JeeLink is receiving properly, try running up the NRfMon visualiser. There is usually enough external RF activity in and around the band to confirm that the receiver section of the RFM12B module is working.

RE: debugging software on the jeenode micro - Added by Rolf over 5 years ago

@JohnO and martynj

Thanks for your advices. The Jeelink seems not to be the problem. Because I tested the data-sending software on a jeenode and it communicates properly with the jeelink. The main software change in the sketch uploaded to the j-micro is that RF is initialized via rf12_initialize, which sets the node address. In the jeenode I put this with rf12_demo in EPROM and call rf12_config afterwords.

RE: debugging software on the jeenode micro - Added by JohnO over 5 years ago

There is a version of RF12Demo which runs in a j-micro but it needs a piece adding to power on the RFM12B module.

You could then use the ‘t’ command to debug.

RE: debugging software on the jeenode micro - Added by JohnO over 5 years ago

Ah, not as simple as that we would also need to know how to redirect the serial.print away from pb0.

RE: debugging software on the jeenode micro - Added by jcw over 5 years ago

> But the jeelink seems to not receive RF-packets.

Maybe it’s been mentioned: the JNµ powers up its radio via a MOSFET connected to an I/O pin, see this example

RE: debugging software on the jeenode micro - Added by martynj over 5 years ago

Probably easier to bypass the dynamic RFM12B power feed function to free up PB0.

  • Solder a header pin in the Vdd dimple on the RFM12B module.
  • Make a flying lead to go from there to 3.3V on the header.
  • Link when debugging and burning.

But I’m biased towards hardware fixes! ;-)

RE: debugging software on the jeenode micro - Added by Rolf over 5 years ago

@ Jean Claude: Thanks! The very problem is fixed, the question of debugging still to be worked on. Though I read the section about power handling with the j-micro in the documention and design area, I did not understand that the RF has to be switched on. After adding the corresponding lines the setup() routine it works now:

bitSet(DDRB, 0);
bitClear(PORTB, 0);
delay(100);
rf12_initialize(node_address, RF12_868MHZ, 5);

Thanks a lot,

Rolf

RE: debugging software on the jeenode micro - Added by JohnO over 5 years ago

Excellent Rolf, I still want to remap Serial.print away from PB0 - in software!

RE: debugging software on the jeenode micro - Added by Rolf over 5 years ago

martynj: Hi. Yes, I like to avoid hardware fixes as well. And though I just mentioned that “the debugging problem still has to be worked on”, meanwhile I think different. Now that the RF is working, and it was done just by replacing my old code line “rf12_config()” by the four lines mentioned above, I think software debugging can be well done by the RF-output.

Rolf

RE: debugging software on the jeenode micro - Added by Rolf over 5 years ago

@JohnO: That would be great!

Rolf

RE: debugging software on the jeenode micro - Added by JohnO over 5 years ago

I have finally found it - pretty obvious if my mind worked like that. It is possible to remap the TinyDebugSerial output port to another pin. On my Win7x64 system setup as per jeelib standard instructions there is a file:
"C:1.5.4r2\sketchbook\hardware\jeelabs\avr\cores\tiny\TinyDebugSerial.h"
I modified this file (enclosed) to move from PB0 to PA3 to match the Jeenode Micro V3 PCB layout. Connect Tiny84 PA3(Jeenode AIO2) to USB-BUB RXD for serial output from sketch. I selected AIO2 because it has an “A” in it and so does transmit
the transmitted output of the Jeenode connects to the USB receive pin.

jcw, perhaps after more testing we could consider adding this to the https://github.com/jcw/ide-hardware

RE: debugging software on the jeenode micro - Added by valentin about 5 years ago

Hi JohnO,

unfortunately, it does not work at my site.
My configuration:

Arduino IDE 1.0 on Snow Leopard
USB BUB II
JeeNode Micro v3

RX of USB BUB connected to PA3 of JNu
GND of USB BUB connect to GND of JNu

external power supply (3.6V) at JNu

applied your patch to TinyDebugSerial.h. (/Users/valentin/Documents/Arduino/hardware/jeelabs/avr/cores/tiny)
598a599
> /*
601a603,607
> */
> // port A bit 3 (PA3)
> #define TINY_DEBUG_SERIAL_REGISTER 0x1B
> #define TINY_DEBUG_SERIAL_BIT 3
>

As sketch for the JNu I am using the radioblip2 with a
Serial.begin(38400);
Serial.println(“”);
at the beginning of setup().

The sketch itself is working (ping arriving at my central JeeNode v6)
but not output at the serial line … ;-(

Does anybody have any ideas?

Thanks in advance,

Valentin

RE: debugging software on the jeenode micro - Added by JohnO about 5 years ago

Hi Valentin,

Please ignore my previous comment as I thought we were talking about RF12Demo on the JNu. Do you have any Serial.print statements in radioblip2? Could you post the full exact sketch you are running?

RE: debugging software on the jeenode micro - Added by valentin about 5 years ago

Hi JohnO,

I have a good news: Now it is working ;-)
A restart of the whole environment does the job:
* Arduino IDE 1.0
* new sketchbook directory including jeelib (from your branch https://github.com/jcw/jeelib/tree/RF12Demo)
* current Arduino Tiny Lib: http://arduino-tiny.googlecode.com/files/arduino-tiny-0100-0018.zip
* your patch to TinyDebugSerial.h
* sketch is attached

JohnO, thank you very much for your help,

Valentin

radioBlip2.ino (3.96 KB) radioBlip2.ino radioBlip2 with Serial output
    (1-17/17)