CNMAT Flashback

A look back at some items in our archives.

Archive Browser

Browse CNMAT content by type
Book page

Known Bugs and Possible Issues

- Sometimes the device does not seem to receive commands to toggle the status lights. After resetting uOSC, it works again.
- USB Prober only seems to work correctly before the serial port is activated. Suspect the control endpoint isn't getting serviced because it is starved by activity on the CDC data endpoint.

Book page

Setup for Windows XP

micro-OSC is a USB class-compliant serial device -- it is automatically supported by built-in drivers provided by operating system manufacturers. For some reason, on Windows, you still need to load a driver "information" file, otherwise it won't work.

Book page

Meeting agenda 6/26/08

Meeting agenda for Friday 6/20/08:

- Review candidates for Music Applications Programmer position
- Review status of current research projects
- Sponsored research: Starkey
- Affiliates: Meyer, Sennheiser, Waves, Native Instruments, Ableton...
- Clarify profile of Rimas replacement and goals for Meyer collaborations
- Discuss fundraising strategy for next year.

Book page

Overview

# Project objectives

- Low cost microcontroller target
- Maximally complete OSC implementation
- Timestamps and synchronization
- Floating point support
- High performance transport
- Clock synchronization
- Hardware features
- TTL, SPI and I2C digital connectivity
- Ratiometric ADC for 3.3v regulated systems

Book page

OSC

Provides OSC protocol meta-information and clock synchronization services.

-----

**/osc/version** : Report OSC version

TX: [ /osc/version ]
RX: [ /osc/version ,s "1.0" ]

-----

**/osc/type/accepts** : List typetags understood by device

Book page

TTL Serial

Enables digital communication with devices over TTL serial (0-5v signaling). Baud rates of 2400-115200.

Note that the TTL serial mode conflicts with SPI and I2C modules--only one can be used at a given moment.

The transmit pin is C6 and the receive pin is C7 on the PIC18F series.

**NOTE:** Do NOT leave the input pin (C7) floating! If it is not in use, it must be grounded, otherwise the hardware UART module will behave strangely and may lock up the firmware.

-----

**/ttl/baud** : Get/set baud rate, argument is int-32

Book page

Hardware PWM

Enables 2-channel hardware pulse-width modulation control on pins C1 and C2. This can be used to control brightness of LEDs or digital-to-analog conversion.

Book page

SPI

The SPI module is mostly written but still untested. This is some preliminary documentation.

--------

**/spi/enable**

Turn on/off.

------

**/spi/rate**:

Configure clock rate. Fosc /4, /16, /64.

-------

**/spi/mode**:

Configure the transmission waveform. See spec sheet.

- Mode 0: Clock default low, falling edge on data transmit.
- Mode 1: Clock default high, rising edge on data.
- Mode 2: Clock default low, rising edge on transmit
- Mode 3: Clock default low, falling edge on transmit

Book page

Developer Tools

- General Utilities:
- [w:Subversion] repository client.
Recommendation: svnX for Mac OS/X, TortiseSVN for Windows
- catserial.py -- utility for dumping serial port output (in the repository)
- slipserial.py -- utility for dumping a serial slip stream (in the repository)
- A Windoze machine (optional, for some hardware tools)
- USB Analyzer: [cnmat:node/5964]

Book page

uOSC.PIC Source Code Overview

# system/typedefs.h

Defines byte, word, LSB, MSB, etc.

# autofiles/usbcfg.h

Select which variant target to build for (CUI, Bitwacker, etc)

# autofiles/usbdsc.*

Contains the USB descriptor table

# io_cfg.h

Defines pins, pin counts, enable individual modules

# main.c

Starts the program when USB enumeration is completed

# user.c

Contains the main loop of program and i

Book page

PIC18F Hardware

- 5V supply
- Tosc = 48 Mhz clock, Fosc = Tosc / 4 = 12 Mhz instruction rate.
- Program memory: Up to about 16k ROM.
- RAM: 2048 bytes:
- 256 bytes for stack
- 512 bytes for micro-OSC buffers and other data
- 512 bytes for USB endpoint buffers
- 768 bytes for heap
- 16 digital I/O
- 13 analog in
- 4 hardware timers (internal clock, interrupts)
- 2 PWM out / CCP in
- 1 T

Book page

Module Development

Read the source code! Read it again. This is a very concise overview...

1. Make a MODULE\_ENABLE macro flag (io\_cfg.h) -- all of your code should be #ifdef conditional on this flag.
2. Make a file for low-level functions, e.g. user/mything.c
3. Make a file for handling the OSC dispatch, e.g. user/osc\_node_mything.c
4. Define the OSC schema (osc\_schema.c)
5.

Book page

OSC Message Handling

# Unpacking

This can be done in a node dispatch routine. Variables of note:

- osc\_message\_in\_argc : how many arguments in the typetag section
- osc\_message\_in\_len : total message length
- p\_osc_message\_in : pointer to start of message
- p\_osc_message\_in\_tt : pointer to start of typetags (after magic comma)
- p\_osc_message\_in\_data : pointer to start of data section

For figuring out which method was matched in a large tree of nodes:

Pages