You are on page 1of 27

Particle Photon

1
Photon
Raspberry PI

HCS12

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 2
Photon Block Diagram

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 3
Comparing with Raspberry Pi
RASPBERRY PI 2: It is credit card size computer
 SoC: Broadcom BCM2837 64-bit system-on-chip with Raspberry Pi 3 review: The revolutionary $35 mini-PC
four ARM Cortex-A53 CPU cores clocked 1.2GHz
Faster, better, harder, stronger
 CPU: 4X ARM Cortex-A53, 1.2GHz
 GPU: Broadcom Video-Core IV
 RAM: 1GB LPDDR2 (900MHz)
 Networking: 10/100 Ethernet, 2.4GHz 802.11n wireless
 Bluetooth: Bluetooth 4.1 Classic, Bluetooth Low Energy
 Storage: microSD
 GPIO: 40-pin header, populated
 Ports: HDMI, 3.5mm analogue audio-video jack, 4X USB
2.0, ethernet, Camera Serial Interface (CSI), Display
Serial Interface (DSI)
 8-Channels ATD.
 Real-time clock
Cyber-physical systems: Physical environment, sensors & actuators,
integument computation and communications.
HDMI (High-Definition Multimedia Interface) is a proprietary audio/video
interface for transferring uncompressed video data and compressed or
uncompressed digital audio data from an HDMI-compliant source device,
such as a display controller, to a compatible computer monitor, video projector, digital television

4
Processing is done in the Raspberry Processor / Processing is done in the cloud. Photon terminal unit

Server

The Ras-Pi
Processor The photon
& Server is remote
Terminal I/Os

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 5
Raspberry Pi vs. Photon
Raspberry Pi Photon
Microcontroller 4X ARM Cortex-A53 STM32F205
CPU Speed 1.2GHz 120MHz
RAM 1GB 128KB
Storage microSD (32/64GB) 1MB flash memory
WiFi support 802.11n wireless 802.11 b/g/n
Wireless Module Broadcom BCM2837 Broadcom BCM43362

Bluetooth yes no

GPIO 40 pins 18 pins


DAC no yes
ADC no yes
Communication UART(serial), I2C, I2S, SPI, 3.5mm analog audio jack, UART(serial), JTAG, I2C, SPI, CAN
4x USB 2.0, Ethernet, HDMI, CSI, DSI
Timers A GPU timer which has 4 comparison registers, and PWM timer peripheral is duplicated on two pins (A5/D2)
4 interrupts + an ARM timer interrupt. and (A4/D3) for 7 total independent PWM outputs.

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 6
Physical Layout

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 7
Photon Peripherals

[1] FT = Five-volt tolerant

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 8
Characteristics

FT = Five-volt tolerant. In order to sustain a voltage higher than V3V3+0.3 the internal pull-up/pull-down resistors
[1]
must be disabled.

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 9
Photon Status LED
• The Photon status LED is an RGB LED; meaning it combines a Red, Green, and a Blue LED in different intensities
in order to create different colors.
LED blinking Mode
pattern
Breathing (blue) Listening mode. Your devices should be in this mode to
connect over USB and do the setup configurations. You
can enter listening mode by pressing the “SETUP”
button. That can be done via the command prompt.
Fast (green) Looking for a network
Fast (cyan) Connecting to the cloud
Breathing (cyan) Connected to the cloud

Fast (magenta) Updating firmware/uploading code

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 10
Photon Pin Assignment Specifications

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 11
Pin Out Diagram

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 12
Pin Out Diagram

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 13
I/O

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 14
Memory Map
STM32F205RGY6 FLASH LAYOUT OVERVIEW
• Bootloader (16 KB)
• tells the hardware where to look and how to get
running when you start things up
• DCT1* (16 KB), stores Wi-Fi credentials,
keys, mfg info, system flags, etc..
*DCT stands for DRAM OTA (Over The Air) is the memory part used to save
(Dynamic Random Access Memory) Controller. the user application code compiled via Web IDE
• DCT2 (16 KB), swap area for DCT1 (Particle Build). In other words: when a user writes a
• EEPROM emulation bank 1 (16 KB) program via the Web IDE, it will be stored in the
• A portion of the flash memory that acts like an cloud and then downloaded to the OTA memory in
EEPROM the photon over the internet. It is worth mentioning,
• EEPROM emulation bank 2 (64 KB) [only 16k used] you can write your program using either Web IDE
• System firmware (512 KB) [256 KB Wi-Fi/comms + (Particle Build: an IDE that can be access via a
256 KB hal/platform/services] browser) or Local IDE (Particle Dev: an IDE that has
• Factory backup, OTA backup and user application to be installed on your computer).
(384 KB) [3 x 128 KB]
HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 15
Pin Out Diagram

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 16
WiFi Specifications

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 17
Development
https://www.sparkfun.com/products/13320

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 18
Programming
• Since the Photon was developed to be an IoT
(Internet of Things) device, most of the
communication between the developer and the
device –such as uploading code and sending
commands- takes place over the cloud.
• Your device does not have to be directly
connected to your computer in order for you to
upload new programs to it. In fact, as long as
both your Photon and you have internet access,
you can program it from any place in the world.
• Particle programs are edited locally, but
compiled on the cloud.

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 19
Claiming a Photon

• Before you start communicating with the Photon you


first have to claim your device (identify it and
connect it to your account). This can be done using
the Particle CLI command prompt tool and a USB
cable.
• Connect your photon to your laptop using the
micro USB cable.
• Make sure your devices is in listening mode
(blinking blue).
• Open cmd and type: particle identify.
• The Particle CLI tool will automatically detect
your Photon over the USB cable and grab its ID.
• You can then add that ID to your devices in
Web IDE or Local IDE

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 20
Particle Build (browser: Particle Dev (application: editing
IDE editing and compiling on PC and compiling in the
in the cloud) cloud)
Access through any Need to download and install on
Accessibility
browser the PC, but available on all OSs
Simplicity Simple More complex
Large complicated firmware
Usage Small projects
project
Compiling and
Through the cloud Through the cloud
uploading code
Adding
Easy through the search Need to download the library
official/community
tool in the browser folder then include it manually
libraries
Adding your own Yes; if you have it as a
No
libraries github repository
Serial monitor (USB) No Yes

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 21
Input/Output Pins
• Because of the way the some of the channels are multiplexed, some
pins may have more than one variable name that you can use in your
code interchangeably. For the scope of this lab, you will be using the
pins as either analog input or output
Pin name on Pin name in code Analog modes Digital modes
board
A0 A0 INPUT INPUT/OUTPUT
A1 A1 INPUT INPUT/OUTPUT
A2 A2 INPUT INPUT/OUTPUT
A3 A3/DAC2 INPUT/OUTPUT INPUT/OUTPUT
A4 A4 INPUT INPUT/OUTPUT
A5 A5 INPUT INPUT/OUTPUT
DAC A6/DAC/DAC1 INPUT/OUTPUT INPUT/OUTPUT
WKP A7 INPUT INPUT/OUTPUT
WAKEUP

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 22
Important Functions * This will enable the internal
20K pullup resistors, which will
Function Parameters Return Description pull up the input pin to a HIGH
Pin: pin number you want to reading unless it is pulled LOW
pinMode(pin, mode) use Configure digital pin to behave as by external circuitry.
Mode: INPUT, OUTPUT, None
e.g. pinMode(D7,OUTPUT) an input or output
INPUT_PULLUP*
delay(ms) ms: an integer number of
None
Pauses program execution for (ms) *
e.g. delay(500) microseconds number of milliseconds
Pin: pin number If the pin has been configured as
digitalWrite(pin, value)
Value: *HIGH=(2.4 - 3.3V) None an output, its voltage will be set to
e.g. digitalWrite(D7,HIGH)
*LOW=(0V - 0.5V) the corresponding value
Reads the value from a specified
digitalRead(pin) *HIGH=(2-3.3V)
Pin: pin number digital pin that has been
e.g. digitalRead(D0) *LOW=(0-0.8V) configured as input
Pin: pin number
analogWrite(pin, value)
Value: the duty cycle: between Writes an analog output value
e.g. analogWrite(DAC1,815) None
0 (always off) and 4095 (always (PWM wave) to a pin
0000-4095
on)
analogRead(pin)
Reads the input value from the
e.g. analogRead(A0) Pin: pin number int (0 to 4095)
specified analog pin
0000-4095

Read Values in DAC and ADC are integer units and must be converted to voltage or sensor readings
ADC=DAC resolution= 3.3/4096 =0.8mV= 800µV . Then you should use the Sensor resolution to covert it to temperature like..

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 23
Programming Language: C Wiring
• Photon programming language is based on Wiring language (C with
libraries for microcontrollers), and thus looks exactly like Arduino.

Step-1. Include libraries

Step-2. Declare (and


initialize) global variables
and functions

Step-3. Initial
configurations such as
Step-4. Your application
setting pin modes, serial
code execution which
baud rate, etc… (done
will be repeating forever
once only at the
beginning)

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 24
Digital Example 1: Blink an LED

Step-2. Declare variables: in this case you only need D7

Step-3. Initial configurations: initialize led (i.e. D7)


as an output to control the on-board LED

Step-4. Application code: blink the LED


with a period of 1 second

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 25
Digital Example 2: Control an LED With a Switch
Step-2. Declare variables

Step-3. Initial configurations

Step-4. Application code

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 26
Analog Example 1: Control LED Intensity Based on Temperature

DAC Channel: output

ADC Channel: input

HTTPS://DOCS.PARTICLE.IO/DATASHEETS/PHOTON-DATASHEET/ 27

You might also like