38
Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

Sun SPOTs: A Great Solution for Small Device Development

Claudio M. HorvilleurCromasoft, S.A. de C.V.México

Page 2: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

2

Agenda> What is the Problem?> What is a SunSPOT?> Adding a New Sensor> Hardware Development Issues> Adding a New Board> Summary

Page 3: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

3

What is the Problem?> Device Development issues:

● Expensive● Long Term Projects● Requires Specialized Skills● Difficult to Debug

Page 4: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

4

What is a SunSPOT> Sun Small Programmable Object Technology> Experimental Technology from Sun Labs

Page 5: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

5

What is a SunSPOT> Three Basic Elements

● Battery● Processor Board● Sensor Board

> A base-station is just a processor board

> Programmed in Java with standard tools

Page 6: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

6

What is a SunSPOTProcessor Board / Battery> 32 bits ARM920T processor @180 MHZ> 512 KB of RAM / 4 MB of Flash> Radio 802.15.4> USB interface> Rechargeable Battery (lithium-ion) 3.6 V / 750ma> Deep Sleep mode (36uA)

Page 7: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

7

What is a SunSPOTSensor Board> 3 axes accelerometer 2G/6G> Light sensor> Temperature sensor> Buttons (2)> 24 bits RGB LEDs (8)> Analog inputs (6)> General I/O pins (5)> High current output pins(4)

Page 8: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

8

What is a SunSPOTSoftware> Squawk Virtual Machine

● J2ME CLDC 1.1 IMP Profile● Java-on-metal● Designed for limited memory

devices● Mainly written in Java● Isolates applications● May run on Solaris, Linux, Mac

and Windows

Page 9: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

9

What is a SunSPOTSoftware> Transducer library

● Supports all the sensors for the edemoBoard● Includes energy administration for optimizing the

battery life.● Includes Mesh Networkng

> Fully Open Source● Squawk (http://squawk.dev.java.net)● SunSpot (http://spots.dev.java.net) ●

Page 10: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

10

What is a SunSPOTTelemetry Demo

Page 11: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

11

Adding a New SensorAn Electronic Compass (Robson R1655)

Page 12: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

12

Adding a New SensorReading the Data> Initialization

EDemoBoard demo = EDemoBoard.getInstance();IScalarInput[] analogInputs = demo.getScalarInputs();

> Getting the dataSender.send( analogInputs[EDemoBoard.A2].getValue(), analogInputs[EDemoBoard.A3].getValue());

Page 13: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

13

Adding a New SensorCompass DemoWhere is the North?

Page 14: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

14

Hardware Development IssuesStandard Process> Design and implementation of a board

● Have to start with a micro-processor> Firmware programming

● Signal management● Data I/O● DMA● Multithreading / Multitasking● Functionality

Page 15: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

15

Hardware Development IssuesStandard Process> Software development in:

● Assembler● “C” with a cross-compiler

> EEPROM programming> Debugging with a signal analyzer

Page 16: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

16

Hardware Development IssuesFollow the Trail - “Por las Piedritas”

Page 17: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

17

Hardware Development IssuesWith a SunSPOT> Design and implementation of a board

● Start with a base platform> Firmware programming

● Included in the SunSPOT● Signal management● Data I/O● DMA● Multithreading / Multitasking

● Functionality

Page 18: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

18

Hardware Development IssuesWith a SunSPOT> Software development in Java> Download to the SunSPOT with a simple “deploy”> Debugging from the development environment

Page 19: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

19

Hardware Development IssuesFollow the Highway

Page 20: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

20

Adding a New BoardSpecs> Board with as many signals and interfaces

● RF-ID reader from SkyeTek (SkyModule M1-Mini with SPI or Serial interface)

● One-Wire interface from Dallas Semiconductor Maxim (serial)

● SD card reader● USB-HOST interface

Page 21: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

21

Adding a New BoardThe board> Design Software

● gEDA (http://www.gpleda.org/)> Start with the “eBones”> Add your devices> Build the board

● Print the circuit board (PCBexpress http://pcbexpress.com)

● Solder the elements

Page 22: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

22

Adding a New BoardeBones

Page 23: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

23

Adding a New BoardSerial Device

Page 24: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

24

Adding a New BoardSPI device

Page 25: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

25

Adding a New BoardBoard

Page 26: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

26

Adding a New BoardBoard

Page 27: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

27

Adding a New BoardSoftware> Start with the device´s vendor software> Adapt the I/O specific classes

● Port Setup● Data I/O

Page 28: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

28

Adding a New BoardVendor´s I/O Source Code

Page 29: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

29

Adding a New BoardSerial I/O Programming> Device Setup

serialOutput = Connector.openOutputStream( “serial://usart?baudrate=9600”);serialInput = Connector.openInputStream( “serial://usart”);

Page 30: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

30

Adding a New BoardSerial I/O Programming> Data output

serialOutput.write(data);serialOutput.flush();

> Data outputif (serialInput.available() == 0) { ... }byte start = serialInput.read();int actualBytes = serialInput.read(respBuffer, 0, respLen);

Page 31: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

31

Adding a New BoardSPI Programming> Device setup

spi = newBoardDeviceSPI(2, (ISpiMaster.CSR_MODE0 | ISpiMaster.CSR_BITS_8 | ISpiMaster.CSR_SCBR_250K | ISpiMaster.CSR_DLYBCT_200));

Page 32: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

32

Adding a New BoardSPI Programming> Data output

spi.sendSPICommand(req, req.length, null, 0);

> Data inputspi.sendSPICommand(nul, 0, resp, resp.length);

Page 33: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

33

Adding a New BoardRF-ID Demo

Page 34: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

34

Summary> The SunSPOT is a very usefull platform for small

devices development. > Device development does not need to be

expensive> It can be a short term project> If you know Java you can develop firmware> You can debug it as any other software

Page 35: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

35

SummaryFrom a Forest ....

Page 36: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

36

Summary... to a Rose Garden

Page 37: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

37

SummaryQ&A

Page 38: Sun SPOTs: A Great Solution for Small Device Development · Sun SPOTs: A Great Solution for Small Device Development Claudio M. Horvilleur Cromasoft, S.A. de C.V. México

Claudio M. [email protected]