i2c wav player chip

Post on 10-Apr-2015

680 Views

Category:

Documents

6 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Art Hacking

Dave Monachellosidnancy@verizon.net

Project blog: sidnancy.posterous.com

2

inspiration/history

Demo

4

How El-wire works

electroluminescent phosphor emits light when placed in a field of AC current.

Zinc sulfide powder, with small additions of copper or manganese

How El-wire works

How El-wire works

How El-wire works

8

What does it do?

Animated el-wire portrait Driven by a home-made sequencer that animated the

el-wire Provides synchronized sound via wave file player The el-wire animation data and wave file are stored

on an SD card There can be multiple animations on a card The system will loop through the SD card directory

(fat16 file system) and play all animation file pairs it finds

9

System Architecture

System

ELWire

(24 segments)

I2cseq I2c

seq

I2cseq

CPUcard

ACinverter

AMPspeaker

speaker

12v 12v6vsdcard

8 AC lines 8 AC lines

8AC

lines

I2C

I2CI2CAC

ACAC

11

Hardware – el wire driver

Triac circuit

optoisolator

Hardware – el wire driver

15

Hardware – daughter board

Hardware – daughter board

17

Hardware – propeller chip

18

Propeller cogs

Propeller Counters

20

EL Wire Portrait

21

Software

Big picture Talking over I2C Playing a wave file - 1 Playing a wave file - 2

22

Software Big Picture

Maincog

blinkercog

elcog

wavecog

SDcog

El datacog

I2Cpins

SPIpins

audiopins

I2Clib

Filereader

lib

Wavebufferplayer

23

Talking over I2C

repeat

pindir := -1

repeat 8

outa[dbgLed] := !outa[dbgLed] ' toggle the debug led

i2cObject.i2cStart

i2cObject.i2cWrite(i2cMuxAddr, numI2cMuxBits) ' send address

i2cObject.i2cWrite(pindir, numI2cMuxBits) ' send the data

i2cObject.i2cStop

waitcnt(frameTime + cnt)

pindir <-= 1

24

Playing a wave file - 1

'play the wave data from the buffer

PUB Player(pWav, buffSize, PinR, PinL) | idx, baseTime

'Set pins to output mode

DIRA[PinR]~~ 'Set Right Pin to output

DIRA[PinL]~~ 'Set Left Pin to output

'Set up this cog's counters to do D to A conversion

CTRA:= %00110 << 26 + 0<<9 + PinR

CTRB:= %00110 << 26 + 0<<9 + PinL

25

Playing a wave file - 2

buffSize--

baseTime:=cnt+15000

'Play loop

repeat idx from 0 to buffSize

baseTime += 10000 ' assume this is 8k rate.

waitcnt(baseTime)

FRQA:=(byte[pWav+idx])<<24

FRQB:=FRQA ' copy same data to the other audio channel

26

Creating sync data - 1

27

Creating Sync data - 2

AI phoneme FV phoneme

Creating sync data – 3

Creating sync data - 4

Data file format – frame<sp>phoneme<nl>

example el data file:1 A

25 C

49 ^

73 D

97 E

Big picture again

Maincog

blinkercog

elcog

wavecog

SDcog

El datacog

I2Cpins

SPIpins

audiopins

I2Clib

Filereader

lib

Wavebufferplayer

Credits wav player - Raymond Allen

http://obex.parallax.com/objects/324/

I2C interface - James Burrows

http://obex.parallax.com/objects/217/

SPI interface to a Secure Digital card - Tomas Rokicki - http://obex.parallax.com/objects/92/

 El wire hardware ideas – guerroloco member of instructables

http://www.instructables.com/id/EL-wire-eye-candy/

another el wire sequencer - Dave Chesavage - http://www.oceanbeach.com/ches/travel/burning_man/artcar/el_wire_sequencer/index.html

El wire/lipsync data file – David Cuny

http://yolo.sourceforge.net/

top related