The dsp-L8 Latin Perc Chip Source code

The source code to the dsp-L8 Latin Percussions chip is now avaliable for download.



The code runs unmodified on any Arduino Uno/Nano or on a standalone ATmega with 32Kb or more flash.

You can still buy the preprogrammed chip for $20

Order the preprogrammed dsp-L8 chip

The code is free for non commercial use and if you find it useful, please consider a $3 donation.

Source code:

Download the dsp-L8 Source


// dsp-L8 Latin Perc Chip (c) DSP Synthesizers 2015
// Free for non commercial use
// Please consider a donation of $3 if you find this code useful

#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

// Standard Arduino Pins
#define digitalPinToPortReg(P) \
(((P) >= 0 && (P) <= 7) ? &PORTD : (((P) >= 8 && (P) <= 13) ? &PORTB : &PORTC))
#define digitalPinToDDRReg(P) \
(((P) >= 0 && (P) <= 7) ? &DDRD : (((P) >= 8 && (P) <= 13) ? &DDRB : &DDRC))
#define digitalPinToPINReg(P) \
(((P) >= 0 && (P) <= 7) ? &PIND : (((P) >= 8 && (P) <= 13) ? &PINB : &PINC))
#define digitalPinToBit(P) \
(((P) >= 0 && (P) <= 7) ? (P) : (((P) >= 8 && (P) <= 13) ? (P) – 8 : (P) – 14))

#define digitalReadFast(P) bitRead(*digitalPinToPINReg(P), digitalPinToBit(P))

#define digitalWriteFast(P, V) bitWrite(*digitalPinToPortReg(P), digitalPinToBit(P), (V))

const unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
//——— Ringbuf parameters ———-
uint8_t Ringbuffer[256];
uint8_t RingWrite=0;
uint8_t RingRead=0;
volatile uint8_t RingCount=0;
volatile uint16_t SFREQ;



8 Responses to “The dsp-L8 Latin Perc Chip Source code”

  1. Jon Pyre Says:

    Thanks for open sourcing this, What are you using to convert your sounds into hex?

  2. pierre Says:

    thanks for sharing, but a pdf to share code isn’t the best format… lot of wrong “return” to remove manually before being able to run the code.
    Why not putting a simple .ino file?

  3. Levi Says:

    So this is source code for an Arduino?

  4. Silva Rexwinkle Says:

    Have you ever considered about including a little bit more than just your articles? I mean, what you say is fundamental and everything. But imagine if you added some great visuals or video clips to give your posts more, “pop”! Your content is excellent but with pics and videos, this blog could certainly be one of the best in its niche. Excellent blog!|

  5. Jaime Levine Says:

    thank you very much,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: