JeeNode - Pin Layout and functions

All about Arduino, Jeenode and other Clones (hardware & Software)

Moderator: Mdamen

Post Reply
User avatar
JohnieBraaf
Starting Member
Starting Member
Posts: 32
Joined: Sat Sep 18, 2010 3:21 am
Location: Amsterdam
Contact:

JeeNode - Pin Layout and functions

Post by JohnieBraaf »

Hi all,

After the recent workshop, I've started experimenting with my new toys, however I realize that I don't fully understand the basic pin functionality of the JeeNode.
Therefore in this topic I would like to shed light on this matter and point to potentially confusing issues. So I made the following picture to illustrate the situation!

Image

As I found out experimenting with the fading led example, there are only 2 ports (2 and 3) able to produce the wanted output. Which is weird but caused by the timed property.
Moreover, the function of the turquoise Interrupt pins is unknown to me, as well as the SEL0 and SEL1 (purple) and the I2C (orange) communication pins.
Is there anybody, who already figured out the purpose of these pins.
One last thing that puzzled me, was that in the adruino examples there is an example which utilized 8 different leds. But how can we accomplish this on a JeeNode?
Maybe the solution is to be found in the presence of both an analog and a digital output per port, which makes a combined total of 8??? :roll:

Best regards,

Jan
Mdamen
Forum Moderator
Forum Moderator
Posts: 390
Joined: Sat Nov 22, 2008 6:58 pm
Location: Netherlands
Contact:

Re: JeeNode - Pin Layout and functions

Post by Mdamen »

About the fading leds, it only works on PWM pins.. which are DIO port 2 AND 3.
SEL0, and SEL1 are used for ISP programming of the Atmega (tied to PB0 and PB1 on the atmega)
Is it a on/off led example? Analog ports can be used both as digital as well as analog port. Which makes up 8 ports in total.
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: JeeNode - Pin Layout and functions

Post by Digit »

IIRC there was an IC in one of the kits to extend the number of outputs?
Yes, the 74HC595, with an example: 07 - ShiftingOut tutorial.pdf (part of the handout)
User avatar
JohnieBraaf
Starting Member
Starting Member
Posts: 32
Joined: Sat Sep 18, 2010 3:21 am
Location: Amsterdam
Contact:

Re: JeeNode - Pin Layout and functions

Post by JohnieBraaf »

Thanks for pointing me into the right direction! With the documentation of the Ports library over at JeeLabs I figured out how to control 8 leds individually.

:!: You need to save the Ports and RF12 libraries inside your Adruino IDE's Libraries folder in order for to use the simplified Ports library and the JeeNodes RF capabilities!

I used the following script:

Code: Select all

#include <Ports.h>
#include <RF12.h> 

Port one   (1);
Port two   (2);
Port three (3);
Port four  (4);

void setup() {
  // set digital pins as output
  one.mode(OUTPUT);
  two.mode(OUTPUT);
  three.mode(OUTPUT);
  four.mode(OUTPUT);
  
  // set analog pins as output
  one.mode2(OUTPUT);
  two.mode2(OUTPUT);
  three.mode2(OUTPUT);
  four.mode2(OUTPUT);
}

void loop() {
  // digital outputs
  one.digiWrite(1);  
  two.anaWrite(255);    // PWM - Timed Port
  three.anaWrite(255);  // PWN - Timed Port
  four.digiWrite(1); 
  
  // analog outputs
  one.digiWrite2(1);  
  two.digiWrite2(1);
  three.digiWrite2(1);
  four.digiWrite2(1);   
} 
Notice that I use a different statement for the 2 timed output pins on port 2 and 3!

In the documentation of this library it states that it schould also be possible to use interrupt pins as a port.
However when I use mode3 and digiWrite3 commands for example to power port 1, this also effects the other interrupt pins (on port 2,3 and 4).
This thus leads to an all or nothing situation. Is this normal behavior, or maybe a little bug in the Ports library wrapper?

Next point on the agenda is mastering the Shift Register, thanks digit for the helpful tip!
Post Reply

Return to “Raspberry, Arduino, Cubietruck and other clones Forum”