micro-OSC
UC Berkeley
Department of Music
CNMAT
Andy Schmeder
micro-OSC
http://cnmat.berkeley.edu/research/uosc
Disclaimer
This document was authored Dec 9 2009.
micro-OSC is a work-in-progress and also a research project--some features shown are not yet available in the general release, and some of the OSC message interactions shown in this presentation are simplified for brevity.
For the latest... go to:http://cnmat.berkeley.edu/research/uosc
Thanks----Andy.
Innovation
Enables
Mutually Enables
Music
Innovation
Enables
Mutually Enables
Music
Science
Experimentation
Innovation
Enables
Mutually Enables
Sensing Expressive Gestures
Music
Science
Experimentation
Physics
Statistics
Affordable
Innovation
Enables
Mutually Enables
Sensing Expressive Gestures
Music
Science
Experimentation
Physics
Statistics
Minimize Cost
Affordable
Innovation
Enables
Mutually Enables
Sensing Expressive Gestures
Music
Science
Experimentation
Physics
Statistics
Minimize Cost
Affordable
Maximize Hardware
Performance
Innovation
Enables
Mutually Enables
Sensing Expressive Gestures
Music
Science
Experimentation
Physics
Statistics
Minimize Cost
Affordable
Maximize Hardware
Performance
Easy to Understand (Intuitive)
Innovation
Enables
Mutually Enables
Sensing Expressive Gestures
Music
Science
Experimentation
Physics
Statistics
Minimize Cost
Affordable
Maximize Hardware
Performance
Easy to Understand (Intuitive)
Innovation
Maximize Utility
Enables
Mutually Enables
Sensing Expressive Gestures
Music
Science
Experimentation
Physics
Statistics
Minimize Cost
Affordable
Maximize Hardware
Performance
Easy to Understand (Intuitive)
Innovation
Maximize Utility
Enables
Mutually Enables
Sensing Expressive Gestures
Music
Science
Experimentation
Physics
StatisticsReduce Time
Minimize Cost
Affordable
Maximize Hardware
Performance
Easy to Understand (Intuitive)
Innovation
Maximize Utility
Enables
Mutually Enables
Sensing Expressive Gestures
Music
Science
Experimentation
Physics
Statistics
Rapid Prototyping
Reduce Time
Minimize Cost
Affordable
Maximize Hardware
Performance
Easy to Understand (Intuitive)
Innovation
Maximize Utility
Enables
Mutually Enables
Cross Platform
Sensing Expressive Gestures
Music
Science
Experimentation
Physics
Statistics
Rapid Prototyping
Reduce Time
Minimize Cost
Affordable
Maximize Hardware
Performance
Easy to Understand (Intuitive)
Innovation
Maximize Utility
Enables
Mutually Enables
Cross Platform
Sensing Expressive Gestures
Music
Science
Experimentation
Serial Transport
Physics
Statistics
Rapid Prototyping
Reduce Time
Minimize Cost
Affordable
Maximize Hardware
Performance
Easy to Understand (Intuitive)
Innovation
Maximize Utility
Enables
Mutually Enables
USB
Cross Platform
Sensing Expressive Gestures
Music
Science
Experimentation
Power
Serial Transport
Physics
Statistics
Rapid Prototyping
Reduce Time
Minimize Cost
Affordable
Maximize Hardware
Performance
Easy to Understand (Intuitive)
Innovation
Maximize Utility
Enables
Mutually Enables
USB
Cross Platform
Open Sound Control
Sensing Expressive Gestures
Music
Science
Experimentation
Power
Serial Transport
Physics
Statistics
Rapid Prototyping
Reduce Time
Reduce Errors
Minimize Cost
Affordable
Maximize Hardware
Performance
Easy to Understand (Intuitive)
Innovation
Maximize Utility
Enables
Mutually Enables
USB
Cross Platform
Open Sound Control
Sensing Expressive Gestures
Music
Science
Experimentation
Power
Serial Transport
Physics
Statistics
Rapid Prototyping
Reduce Time
Reduce Errors
Minimize Cost
Affordable
Maximize Hardware
Performance
Use Semantic Models
Easy to Understand (Intuitive)
Innovation
Maximize Utility
Enables
Mutually Enables
USB
Cross Platform
Open Sound Control
Sensing Expressive Gestures
Music
Science
Experimentation
Power
Serial Transport
Physics
Statistics
Rapid Prototyping
Reduce Time
Reduce Errors
Minimize Cost
Affordable
Maximize Hardware
Performance
Use Semantic Models
Easy to Understand (Intuitive)
Innovation
Enumerate Use Cases
Maximize Utility
Enables
Mutually Enables
USB
Cross Platform
Open Sound Control
Sensing Expressive Gestures
Music
Science
Experimentation
Power
Serial Transport
Physics
Statistics
Rapid Prototyping
Reduce Time
Reduce Errors
Minimize Cost
Affordable
Maximize Hardware
Performance
Use Semantic Models
Easy to Understand (Intuitive)
Innovation
Enumerate Use Cases
Maximize Utility
Enables
Mutually Enables
USB
Cross Platform
Open Sound Control
Sensing Expressive Gestures
Music
Science
Experimentation
Power
Serial Transport
Physics
Statistics
User Friendly Interfaces
Rapid Prototyping
Reduce Time
Reduce Errors
Minimize Cost
Affordable
Maximize Hardware
Performance
Use Semantic Models
Easy to Understand (Intuitive)
Innovation
Enumerate Use Cases
Maximize Utility
Enables
Mutually Enables
USB
Cross Platform
Open Sound Control
Sensing Expressive Gestures
Music
Science
Experimentation
Power
Serial Transport
Physics
Statistics
Normalize Numerical Formats
User Friendly Interfaces
Rapid Prototyping
Reduce Time
Reduce Errors
Minimize Cost
Affordable
Maximize Hardware
Performance
Use Semantic Models
Easy to Understand (Intuitive)
Eliminate Micro
Programming
Innovation
Enumerate Use Cases
Maximize Utility
Enables
Mutually Enables
USB
Cross Platform
Open Sound Control
Sensing Expressive Gestures
Music
Science
Experimentation
Power
Serial Transport
Physics
Statistics
Normalize Numerical Formats
User Friendly Interfaces
Rapid Prototyping
Reduce Time
Reduce Errors
Minimize Cost
Eliminate Expensive
Tools
Affordable
Maximize Hardware
Performance
Use Semantic Models
Easy to Understand (Intuitive)
Eliminate Micro
Programming
Innovation
Enumerate Use Cases
Maximize Utility
Enables
Mutually Enables
USB
Cross Platform
Open Sound Control
Sensing Expressive Gestures
Music
Science
Experimentation
Power
Serial Transport
Physics
Statistics
Normalize Numerical Formats
User Friendly Interfaces
Rapid Prototyping
Reduce Time
Reduce Errors
Minimize Cost
Eliminate Expensive
Tools
Affordable
Maximize Hardware
Performance
Use Semantic Models
Easy to Understand (Intuitive)
Eliminate Micro
Programming
Innovation
Enumerate Use Cases
Maximize Utility
Enables
Mutually Enables
USB
Cross Platform
Open Sound Control
Sensing Expressive Gestures
Music
Science
Experimentation
Power
Serial Transport
Physics
Statistics
Normalize Numerical Formats
User Friendly Interfaces
Rapid Prototyping
Reduce Time
micro-OSC
Minimize Cost
Eliminate Expensive
Tools
Affordable
ICSP/ICSD Programmer/
Debugger ($150)
USB Protocol Analyzer ($1200)
SPI/I2C Protocol
Analyzer ($500)
Commercial Software
Toolchain ($300+)
Eliminate Micro
Programming
Digital Logic Analyzer ($1500)
Reduce Errors
Eliminate Micro
Programming
Interrupt Handler Race Conditions
Unprotected Memory
Difficult Debugging
Time sensitive operations
Technical Mumbo-Jumbo
Hardware Bugs
Reduce Time
Normalize Numerical Formats
User Friendly Interfaces
Use IEEE Floating
Point
Bit-depth Independent
Ratiometric Units (0.0 - 1.0)
SI Units
Maximize Hardware
Performance
Use Semantic Models
Easy to Understand (Intuitive)
Enumerate Use Cases
Requirements are smaller than
Consequences Useful Design Patterns
Properties enable Optimization
micro-OSC 1.0 USB.PIC
Open Sound Control
Serial
USB
PIC18F
Microchip PIC18F
13 Analog In
16 Digital In/Out
USB SIE
4K RAM
16K ROM
8-bit CPU
TTL, I2C, SPI...
12 MIPS
micro-OSC Platforms
Sparkfun "Bitwacker" PIC18F2455/2553
CUI PIC18F4550/4553
Olimex PIC18F4550/4553
$60
$50
$25
Open Systems Interconnect Basic Reference Model
Presentation Layer
Transport Layer
Hardware Layer
Application Layer
micro-OSC 1.0
HTTP
CaptureAudio Display Analyze
MIDI
Open Sound Control XML
UDP/IPSerial TCP/IP
USB Ethernet WirelessRS232
...
micro-OSC 1.0 USB.PIC
Open Sound Control
Serial
USB
Worldmicro-OSC Node
Resources Information Entities
Worldmicro-OSC Node
Development Layer
Microprocessor Code Programmer
Application Layer
Config Digital Protocols Controller
Open Sound Control
Circuit Digital Protocols InteractorPhysics
Systems Layer
Transports Digital Protocols ComputersUSB
Worldmicro-OSC Node
Development Layer
Microprocessor Code Programmer
Application Layer
Config Digital Protocols Controller
Open Sound Control
Circuit Digital Protocols InteractorPhysics
Systems Layer
Transports Digital Protocols ComputersUSB
FUN
TEDI
UM
Worldmicro-OSC Node
System Layer
Microprocessor
ComputersTransports
Platform
Network
Power
Code Programmer
Feed Energy
Identifier
OSC Transport Classes
Node NodeDatagram Stream
Broadcast Input Only Output OnlyBidirectionalMulticast
USB Transport ServiceUSB Serial Class Transport
Device Host
BidirectionalBlocking
GuaranteedHost Centric TopologyDevice ID EnumerationSerial ID Enumeration
USB Serial Transport Datagram Service
USB TransportDevice Host
SerialSLIP SLIP
Worldmicro-OSC Node
Application Layer
Hardware Interface
Software Interface
Sensors
Actuators
Circuit
Machines
HumansMeasurement
Mechanics
AttributesConfig Open Sound
Control
Functions
Controllers
Worldmicro-OSC Node
Application Layer
Software InterfaceAttributes
Config Open Sound Control
Functions
Controllers
OSC Message
Address Pattern
/foo/bar
Data
Typetags
,ifs
Packed Arguments
1, 3.14, "baz"
# Send an OSC message> /foo/bar 1, 2, 3.14, "baz"
# Received message< /foo/bar ...
OSC BundleEncapsulated Messages
Message #1NTP Timestamp
Seconds Seconds Fraction OSC Message Length
OSC Message
Message #n
OSC Message Length
OSC Message
Bundle Identifier
#bundle
...
# Message timecode
# Send an OSC message at t=000.00 > /foo/bar 1, 2, 3.14, "baz"
# Received message at t=0.1 sec00.10 < /foo/bar ...
Device Schema
/
/device
/processor /firmware /platform /power /id /bootmode /reset /config
# Hmm, wonder what the bugs are# in this revision of the processor?> /device/processor< /device/processor "PIC18F4550 Rev A3"
# Automatically seeded random name # (entropy from startup # enumeration time)> /device/id< /device/id "r16-7d9a"
# Set ID:# Also sets USB descriptor SerialID> /device/id "proto1"
# Get the power source > /device/power< /device/power "USB" 500 mA
OSC Implementation Properties Schema
/
/osc
/version
/type
/time
/accepts /reports
# Announcement< /osc/version "1.0"< /osc/type/reports "ifsbTFN"< /osc/type/accepts "ifsbTFN"
OSC Clock Information and Synchronization Schema
/
/osc
/time
/accuracy /precision /scale /overhead /offset /set /dec /inc /tick
# Get the time< /osc/time> /osc/time OSCTimeTag 00.01
# Set the time> /osc/time/set 37.18
# Clock sync API> /osc/time/inc 0.01> /osc/time/dec 0.03> /osc/time/scale 1.001> /osc/time/overhead 0.0001
Worldmicro-OSC Node
Resources Delay... Entities
Observed Delay
Jitter Induced Phase-Modulation Noise
Jitter Noise vs Carrier Frequency
Headroom in dB; BOLD where channel headroom < 8-bits.
Constant Delay Recovery
OSC Timestamp Semantics
OSC Bundle Input x
is x Timestamp NOW?
is x Timestamp Future?
is x Timestamp Past? Fault
Defer
Execute
Worldmicro-OSC Node
Application Layer
Hardware Interface
Sensors
Actuators
Circuit
Machines
HumansMeasurement
Mechanics
Microcontroller Input Circuit
State
+
Input Analog
Output Low
Output High
Microcontroller Pin
1.5KOhm25pF
InputInput Digital
Vdd 5V
Digital I/O Pin Schema
/
/v /dir
/ra /rb /rc...
# Read digital pin state (polling)> /ra/4/dir< /ra/4/dir input> /ra/4/v< /ra/4/v 0
# Set pin state output direction> /ra/4/v 1> /ra/4/v 0> /ra/4/dir< /ra/4/dir output
# Set pin state input direction> /ra/4/v -1> /ra/4/dir< /ra/4/dir input
Analog Input Circuit
Ratiometric Voltage Comparator
SampleMicroprocessor Input ImpedanceUser Circuit
Vref+
Vref-
+Vdd
AN(x)
AN2
Vss
Ri Rtemp 0Ohm @ 25C Rswitch 1.5KOhm 25pF
-+
-+
AN3
Result
Analog-Input Pin Schema
/
/v /dir /vp /vn /imp
/ra /rb /rc...
# Set impedance of input on pin B0> /rb/0/imp 10 KOhm
# Set ratiometric Vref+ to input of pin AN3# e.g. 3.3v sensor, 3.3v rail to AN3.> /rb/0/vp an3
# Set back to default> /rb/0/vp vss
...
# Set impedance low for fast conversion# when an op-amp is present...> /rb/0/imp 100 Ohm
Kalimba, Adrian Freed, CNMAT
Wood, AcrylicPressure resistive fabric
Copper tapemicro-OSC 1.0 SBF2455
Tablo, Adrian Freed, CNMATElastic conductive fabricPressure resistive fabric
VelostatIKEA bowl
micro-OSC 1.0 CUI4550
Voltage Divider for Measurement of Resistance
Pull DownCircuit
Runknown
Vmeasurement
+Rreference
# Set impedance on channel> /rb/0/imp 20 KOhm
# Enable resistive sensing reference> /rb/0/rref 10 KOhm
Pogostick (Duotouch 1-String Prototype), Freed, A, MacCallum J, Schmeder, A, CNMAT
Duotouch Pressure Sensor
Control State
Rdist1
+
Rdist2
+
+
Rpressure1M Ohm 1M Ohm
10K Ohm
# Distance 1> /ra/0/imp 1 MOhm> /ra/0/rref 1 MOhm
# Distance 2> /ra/1/imp 1 MOhm> /ra/1/rref 1 MOhm
# Pressure> /ra/2/imp 10 KOhm> /ra/2/rref 10 KOhm
# Pressure Control Logic# Always assert zero in output> /ra/2/v 0
# Switch to input every other step> /ra/2/dir + 0 % 2 = 0 @ 1
SensorCam, Andy Schmeder, CNMAT
Wide-angle IR firewire cameraUltrasound Range-Finder
3-axis accelerometermicro-OSC 1.0 on SFB2455
Pulse-echo Protocol
Tdelta
Pulse
Echo
# Send pulse00.00 > /rb/4/v 000.01 > /rb/4/v 100.02 > /rb/4/v 0
... wait
00.20 < /rb/5/v 000.21 < /rb/5/v 000.22 < /rb/5/v 0
... wait
# Interrupt packet!# Elapsed time = 0.73 - 0.0200.73 < /rb/5/int (...)
12-string ucelloUitti FM, Freed A, MacCallum J,
Schmeder A, CNMAT
Duotouch FSR StripsBowable rods with velocity and pressure sensing
Bow position estimationMultiplexed active electronics
micro-OSC 1.0 SBF2455
Multiplex Driver
MuxDrive Line 1
MuxDriveLine 2
Input
# Turbo button# (requires special handling on host)> /device/fast 1
# Setup 12-way multiplex logic# all output> /rb/4/v + 0 % 12 & 1 @ 1> /rb/5/v + 0 % 12 & 2 @ 1> /rb/6/v + 0 % 12 & 4 @ 1> /rb/7/v + 0 % 12 & 8 @ 1
# Set all inputs low impedance (op-amps)> /ra/*/imp 100 Ohm
# Assert disconnected pins to output# (gives speed improvement)> /rb/[0-3]/v 0
Music Player Concept with Bidirectional LED Sensor
Schmeder A, CNMAT
LEDsLCD Display
micro-OSC 1.0 CUI4553
Bidirectional LED
Output
Input
On Off
Charge Discharge DischargeCharge
# Output LED Off> /ra/0/v 0> /ra/1/v 0
# Output LED On> /ra/0/v 1> /ra/1/v 0
# Output LED Reverse Bias> /ra/0/v 0> /ra/1/v 1
# ... in 4 time frames
# Output ON> /ra/0/v % 4 = 0 @ 1
# Reverse bias drives high> /ra/1/v % 4 = 0 @ 0
# Discharge becomes input# for two time slices> /ra/1/dir + 0 % 4 < 2 @ 0
# Current estimation?> /ra/1/cref 0.1 uF
Multipoint Touch PadSchmeder A, CNMAT
Pressure-resistive fabricConductive tape
Ribbon cableActive electronics
micro-OSC 1.0 CUI4550
4x4 Scanning Multipoint Sensor
-+
+2.5V
-+ -
+ -+
+
5V
# Setup 16X sequential drive lines# That go to tristate when inactive> /d/0/v + 0 % 16 = 0 @ 1> /d/0/dir + 0 % 16 = 0 @ 0
> /d/1/v + 1 % 16 = 0 @ 1> /d/1/dir + 1 % 16 = 0 @ 0
> /d/2/v + 2 % 16 = 0 @ 1> /d/2/dir + 2 % 16 = 0 @ 0
# Low impedance op-amp inputs> /an/*/imp 100 Ohm
# Vref+ is op-amp virtual source# (Vref- is op-amp virtual negative, i.e. real ground)> /an/*/vp an3
Digital ProtocolsI2C
Clock
Data
SPI
Clock
Data
Select
TTL
RX
TX
1-Wire
Power+Data
TTL Devices
RFID Reader
LCD Display
GPS Module
...
# Setup> /ttl/baud 9600> /ttl/enable 1
# Transmit some bytes> /ttl/tx OSCBlob 26 __ __ __ ...
# Received bytes (interrupt)< /ttl/rx OSCBlob 14 __ __ __ ...
I2C Devices
Capacitance Sensor
LED Controller
Wii Nunchuck
...
EEPROM
# Go fast> /i2c/rate 400K> /i2c/enable 1
# I2C Read operation> /i2c/rd (device-id) (address) (n bytes)
# I2C Write operation> /i2c/wr (device-id) (address) (data)
nunshakeSchmeder A, CNMAT
Wii Nunchuck3.3V I2C Circut
micro-OSC 1.0 SBF2455
# Turn on I2C. Turn on nunchuck mode.> /i2c/enable 1> /i2c/nunchuck 1
# Nunchuck data @ about 60 Hz< /nunchuck (sx, sy), (ax, ay, az), (b1, b2)< /nunchuck (sx, sy), (ax, ay, az), (b1, b2)< /nunchuck (sx, sy), (ax, ay, az), (b1, b2)
SPI Devices
External ADC
3-Axis Compass Module
LED Controller
...
Coming Soon...(NOT on January 14th 2009)
Alternative Transports
SLIP TTL Wireless
SLIP HTTPTCP/IP
UDP/IP SPI Ethernet PHY
SLIP TCP/IP
OSC Transport
...
Micro-OSC 2.0 USB.PIC
Open Sound Control
Serial
USB
PIC32M
TTL / Wireless USB OTG
UDP/IP Audio
Microchip PIC32M
16 Analog In
64 Digital In/Out
USB SIE
32K RAM
256K ROM
32-bit CPU
TTL, I2C, SPI...
80 MIPS
Microchip PIC18F
13 Analog In
16 Digital In/Out
USB SIE
4K RAM
16K ROM
8-bit CPU
TTL, I2C, SPI...
12 MIPS
Moores law applies to microprocessors...
THE END...
Questions/Comments
Appendix...
Serial Stream Transport
output stream available?Output x Stream
Append x
retry limit exceeded? Fault
input stream has data?Input x Stream Read
Next x
retry limit exceeded? Fault
USB Serial Line Internet Protocol Encoder (SLIP RFC1055)
Input x
is x SLIP_ESC? Output SLIP_ESC_ESC
Output SLIP_ESC
is x SLIP_END? Output SLIP_ESC
Output SLIP_ESC_END
is Datagram Empty?
Datagram Completed?
Output SLIP_END
Output SLIP_END
Output x
Input x
USB Serial Line Internet Protocol Decoder (SLIP RFC1055)
Input x is x SLIP_END?
is x SLIP_ESC_END?
is x First?
Fault
is x SLIP_ESC? Input x
Output x
is x SLIP_ESC_ESC?
Output SLIP_END
Output SLIP_ESC
is x SLIP_END? Output Datagram Complete
Input x is x SLIP_END?
Fault
micro-OSC 1.0 Firmware System
User Program
Main
USB Driver
SLIP
OSC Dispatch
USB Serial
Clock Update
User Tasks
Boot
OSC Transport
Interrupt
User Handlers
ProgramButton
Reprogram? Boot Loader
ROM ConfigUser Initialize
USB Control
USB Class
USB SIE
User Scheduled Tasks
Idle Tasks
micro-OSC Double-buffered Pin I/O Subsystem
Update Pins Generate Timestamp
Write Pin States
Read Pin Values
Format OSC Report
Write Buffer
Read Buffer
Semantic Circuit Models Schema
/
/imp
/ra /rb /rc...
/cap /rref /cref
Clock Synchronization
http://cnmat.berkeley.edu/publication/implementation_and_applications_open_sound_control_timestamps
Multiplex Driver Switching Capacitance
MuxDrive Line 1
MuxDriveLine 2
Input
Digital Communication Hardware Modules Schema
/
/tx /rx /rd /wr /rate/rd /wr /rate /mode/rate /nunchuck
/ttl /spi /i2c /usb
/error /stall
# Advice of circuit capacitance> /ra/0/cap 0.01 uF
# Provide estimate of frequency upper bound> /ra/0/freq 2000 Hz
# Works for downsampling also> /ra/0/freq 20 Hz
MagIMUFreed, A, Schmeder A, CNMAT
3-axis accelerometer3-axis rate-of-turn3-axis compass
3.3V Analog electronics, SPImicro-OSC 1.0 SBF2455
Hardware Modules Schema
/
/rate /duty /mode
/eeprom /pwm /status
/rd /wr /refresh /state