SM200 Series¶
SNAPpy Builtins¶
getInfo¶
All SM200 Series modules will return SM200 as their platform. Expected getInfo()
return values:
getInfo(0) # returns 0 meaning "Synapse Wireless"
getInfo(3) # returns 17 meaning SM200
sleep¶
The SM200 Series includes a 32kHz crystal RTC, so for most efficient sleep()
you should use sleep
mode 1 or 2, depending on the sleep duration. See the ATMEL ATmega128RFA1 chip section for more information.
Port Mapping¶
IO Pins¶
Pin configuration of an SM200 Series surface mount module:
SM200 Series Pad |
SNAPpy IO |
ATmega128RFA1 |
Description |
---|---|---|---|
A1 |
- |
GND |
Power Supply |
A2 |
- |
VCC |
Power Supply |
A3 |
- |
VCC |
Power Supply |
A4 |
24 |
PF0 ADC0 |
IO24 or Analog0 |
A5 |
26 |
PF2 ADC2 DIG2 |
IO26 or Analog2 or Antenna Diversity Control or (software) SPI CLK |
A6 |
28 |
PF4 ADC4 TCK |
IO28 or Analog4 or JTAG Test Clock |
A7 |
30 |
PF6 ADC6 TDO |
IO30 or Analog6 or (software) I2C SDA or JTAG Test Data Out |
A8 |
- |
GND |
Power Supply |
B1 |
18 |
PE2 XCK0 AIN0 |
IO18 or (software) SPI MISO or Analog Comparator or External Clock |
B2 |
19 |
PE3 OC3A AIN1 |
IO19 or PWM or Analog Comparator |
B3 |
21 |
PE5 OC3C INT5 |
IO21 or PWM or (software) UART 0 RTS input or Interrupt |
B4 |
25 |
PF1 ADC1 |
IO25 or Analog1 or (software) SPI MOSI |
B5 |
33 |
PG1 DIG1 |
IO33 or Antenna Diversity Control |
B6 |
29 |
PF5 ADC5 TMS |
IO29 or Analog5 or JTAG Test Mode Select |
B7 |
31 |
PF7 ADC7 TDI |
IO31 or Analog7 or (software) I2C SCL or JTAG Test Data In |
B8 |
- |
GND |
Power Supply |
C1 |
16 |
PE0 RXD0 PCINT8 |
IO16 or UART0 RX or Interrupt |
C2 |
17 |
PE1 TXD0 |
IO17 or UART0 TX |
C3 |
20 |
PE4 OC3B INT4 |
IO20 or PWM or (software) UART0 CTS output or Interrupt |
C4 |
22 |
PE6 T3 INT6 |
IO22 or Interrupt |
C5 |
23 |
PE7 ICP3 INT7 CLKO |
IO23 or (software) UART1 RTS input or Interrupt |
C6 |
- |
PF3 ADC3 DIG4 |
IO27 or Analog3 |
C7 |
- |
NC |
No Connection |
C8 |
- |
GND |
Power Supply |
D1 |
5 |
PB5 OC1A PCINT5 |
IO5 or PWM or Interrupt |
D2 |
6 |
PB6 OC1B PCINT6 |
IO6 or PWM or Interrupt |
D3 |
7 |
PB7 OC0A OC1C PCINT7 |
IO7 or PWM or Interrupt |
D4 |
- |
NC |
No Connection |
D5 |
- |
NC |
No Connection |
D6 |
- |
NC |
No Connection |
D7 |
- |
NC |
No Connection |
D8 |
- |
GND |
Power Supply |
E1 |
2 |
PB2 PCINT2 |
IO or Interrupt |
E2 |
3 |
PB3 PCINT3 |
IO or Interrupt |
E3 |
4 |
PB4 PCINT4 OC2A |
IO or PWM or Interrupt |
E4 |
- |
NC |
No Connection |
E5 |
- |
NC |
No Connection |
E6 |
- |
NC |
No Connection |
E7 |
- |
NC |
No Connection |
E8 |
- |
NC |
No Connection |
F1 |
0 |
PB0 PCINT0 |
IO or Interrupt |
F2 |
1 |
PB1 PCINT1 |
IO or Interrupt |
F3 |
9 |
PD1 INT1 |
IO or Interrupt |
F4 |
8 |
PD0 INT0 |
IO or Interrupt |
F5 |
- |
NC |
No Connection |
F6 |
- |
NC |
No Connection |
F7 |
- |
NC |
No Connection |
F8 |
- |
GND |
Power Supply |
G1 |
- |
CLKI |
Clock Input (must be pulled low) |
G2 |
15 |
PD7 T0 |
IO15 |
G3 |
12 |
PD4 ICP1 |
IO12 or (software) UART1 CTS output |
G4 |
10 |
PD2 RXD1 INT2 |
IO10 or UART1 RX or Interrupt |
G5 |
37 |
PG5 OC0B |
IO37 or PWM |
G6 |
- |
NC |
No Connection |
G7 |
- |
NC |
No Connection |
G8 |
- |
GND |
Power Supply |
H1 |
- |
GND |
Power Supply |
H2 |
14 |
PD6 T1 |
IO14 |
H3 |
13 |
PD5 XCK1 |
IO13 |
H4 |
11 |
PD3 TXD1 INT3 |
IO11 or UART1 TX or Interrupt |
H5 |
- |
RESET* |
Reset, Active Low |
H6 |
- |
TST |
Enable chip test mode, Active High |
H7 |
- |
NC |
No Connection |
H8 |
- |
GND |
Power Supply |
Note
The SPI and I2C locations are different on the SM200 Series than they are on the ATMEL ATmega128RFA1 chip.
Digitial IO¶
The SM200 Series supports 34 digital IO:
SNAPpy IO |
SM200 Series Pad |
ATmega128RFA1 |
---|---|---|
0 |
F1 |
PB0 PCINT0 |
1 |
F2 |
PB1 PCINT1 |
2 |
E1 |
PB2 PCINT2 |
3 |
E2 |
PB3 PCINT3 |
4 |
E3 |
PB4 PCINT4 OC2A |
5 |
D1 |
PB5 PCINT5 OC1A |
6 |
D2 |
PB6 PCINT6 OC1B |
7 |
D3 |
PB7 PCINT7 OC1C OC0A |
8 |
F4 |
PD0 INT0 |
9 |
F3 |
PD1 INT1 |
10 |
G4 |
PD2 INT2 RXD1 |
11 |
H4 |
PD3 INT3 TXD1 |
12 |
G3 |
PD4 ICP1 |
13 |
H3 |
PD5 |
14 |
H2 |
PD6 |
15 |
G2 |
PD7 |
16 |
C1 |
PE0 PCINT8 RXD0 |
17 |
C2 |
PE1 TXD0 |
18 |
B1 |
PE2 XCK0 AIN0 |
19 |
B2 |
PE3 OC3A AIN1 |
20 |
C3 |
PE4 INT4 OC3B |
21 |
B3 |
PE5 INT5 OC3C |
22 |
C4 |
PE6 INT6 |
23 |
C5 |
PE7 INT7 ICP3 |
24 |
A4 |
PF0 ADC0 |
25 |
B4 |
PF1 ADC1 |
26 |
A5 |
PF2 ADC2 |
28 |
A6 |
PF4 ADC4 or JTAG Test Clock |
29 |
B6 |
PF5 ADC5 or JTAG Test Mode Select |
30 |
A7 |
PF6 ADC6 or JTAG Test Data Out |
31 |
B7 |
PF7 ADC7 or JTAG Test Data In |
33 |
B5 |
PG1 |
37 |
G5 |
PG5 OC0B |
- Notable SNAPpy IO omissions (relative to a “bare” ATmega128RFA1 chip) are:
IO27 – used within the SM200 Series module for antenna control
IO32 – used within the SM200 Series module for LNA control
IO34 – used within the SM200 Series module for PA control
IO35 and IO36 – used within the SM200 Series module by the “sleep” crystal
Wakeup Pads¶
Seventeen of the IO pads can be used to wake a sleeping module:
SNAPpy IO |
SM200 Series Pad |
ATmega128RFA1 |
---|---|---|
0 |
F1 |
PCINT0 |
1 |
F2 |
PCINT1 |
2 |
E1 |
PCINT2 |
3 |
E2 |
PCINT3 |
4 |
E3 |
PCINT4 |
5 |
D1 |
PCINT5 |
6 |
D2 |
PCINT6 |
7 |
D3 |
PCINT7 |
8 |
F4 |
INT0 |
9 |
F3 |
INT1 |
10 |
G4 |
INT2 |
11 |
H4 |
INT3 |
16 |
C1 |
PCINT8 |
20 |
C3 |
INT4 |
21 |
B3 |
INT5 |
22 |
C4 |
INT6 |
23 |
C5 |
INT7 |
Note
Setting the unit to wake from an edge-triggered interrupt on INT4-INT7 (SNAPpy IO 20-23) will work, but it will result in higher power consumption during sleep. If you must have an edge-triggered wake signal, it is recommended you use a different pad.
Analog Input¶
Seven of the IO pads can be used as ADC inputs:
readAdc() channel |
SNAPpy IO |
SM200 Series Pad |
ATmega128RFA1 |
---|---|---|---|
0 |
24 |
A4 |
PF0 ADC0 |
1 |
25 |
B4 |
PF1 ADC1 |
2 |
26 |
A5 |
PF2 ADC2 |
4 |
28 |
A6 |
PF4 ADC4 |
5 |
29 |
B6 |
PF5 ADC5 |
6 |
30 |
A7 |
PF6 ADC6 |
7 |
31 |
B7 |
PF7 ADC7 |
Serial Port 0¶
Four of the IO pads can function as UART 0:
UART Function |
SNAPpy IO |
SM200 Series Pad |
ATmega128RFA1 |
---|---|---|---|
RX - Receive Data |
16 |
C1 |
PE0 RXD0 |
TX - Transmit Data |
17 |
C2 |
PE1 TXD0 |
CTS - Clear To Send(output) |
20 |
C3 |
PE4 |
RTS - Request To Send(input) |
21 |
B3 |
PE5 |
If you do not need RTS/CTS signals, then IO pads 20 and 21 are available for other usage.
Serial Port 1¶
Four of the IO pads can function as UART 1:
UART Function |
SNAPpy IO |
SM200 Series Pad |
ATmega128RFA1 |
---|---|---|---|
RX - Receive Data |
10 |
G4 |
PD2 RXD1 |
TX - Transmit Data |
11 |
H4 |
PD3 TXD1 |
CTS - Clear To Send(output) |
12 |
G3 |
PD4 |
RTS - Request To Send(input) |
23 |
C5 |
PE7 |
If you do not need RTS/CTS signals, then IO pads 12 and 23 are available for other usage.
Note
UART 1 is the default UART for serial communications with the node.
Pulse Width Modulation¶
Eight of the IO pads can optionally be used as Pulse Width Modulation (PWM) outputs:
SNAPpy IO |
SM200 Series Pad |
ATmega128RFA1 |
---|---|---|
4 |
E3 |
PB4 PCINT4 OC2A |
5 |
D1 |
PB5 PCINT5 OC1A |
6 |
D2 |
PB6 PCINT6 OC1B |
7 |
D3 |
PB7 PCINT7 OC0A/OC1C |
19 |
B2 |
PE3 AIN0 OC3A |
20 |
C3 |
PE4 INT4 OC3B |
21 |
B3 |
PE5 INT5 OC3C |
37 |
G5 |
PG5 OC0B |
SPI¶
Three of the IO pads can optionally function as a SPI bus:
SPI Function |
SNAPpy IO |
SM200 Series Pad |
ATmega128RFA1 |
---|---|---|---|
MISO |
18 |
B1 |
PE2 |
MOSI |
25 |
B4 |
PF1 ADC1 |
SCLK |
26 |
A5 |
PF2 ADC2 |
These are not the hardware SPI pads. SNAPpy SPI is done via software emulation.
You will also need one “SPI Chip Select” pad per external SPI device. Any available IO pad can be used for this purpose. For example, we often use IO 24 (PF0, pad A4).
I2C¶
Two of the IO pads can optionally function as an I2C bus:
I2C Function |
SNAPpy IO |
SM200 Series Pad |
ATmega128RFA1 |
---|---|---|---|
SDA |
30 |
A7 |
PF6 ADC6 |
SCL |
31 |
B7 |
PF7 ADC7 |
These are not the hardware I2C pads. SNAPpy I2C is done via software emulation.
Starting with SNAP 2.5, you can also call i2cInit()
with three parameters:
i2cInit(enablePullups, SCL_pin, SDA_pin)
The second and third parameters allow you to “move” the I2C pins to another pair of IO pins on the chip.