I must be missing something, exactly what software do I use to upload the sample code to the EL Sequencer? I’m using the FTDI basic breakout board for serial com-yes, the driver is loaded.
I’ve played with alot of different AVRs, most recently an arduino. Can I use the editor/loader on the arduino site, is that what is meant in the specs “arduino (8mhz lillypad) compatable”? Or am supposed to use AVRstudio4 with the soundfordge AVR-GCC(the sample code has an avrdude make file)? Is the controller programmed with a bootloader? Does it need one?
Most of the other projects/boards had clearer instructions. Help!
Myself and a few coworkers have been trying to find the answer to that question all morning… There does not seem to be any information on sparkfun about how this board is programmed… especially given the fact that the board appears to have no mounted components for connecting to a computer or external microcontroller.
Checked all the usual places for information (forum, comments, google, youtube, and even flickr) with no luck.
There is a footprint for a 6pin ISP header on the board. It dose not have a bootloader, its just a regular old AVR. You will need an AVR programmer to change the code on the chip.
What ever program you use to make the code is up to you (AVR Studio and winAVR GCC, straight ASM, IAR, or otherwise). But you will need a AVR ISP capable programmer to put the code onto the AVR on that board.
I just picked this up and have the same question… has there been any response from the sparkfun team on how to actually use this thing? I should have paid a lot more attention before I picked this thing up…
How do i get this thing either bootloaded so I can program it with the arduino system (I think that’s what the “lilypad compatible statement meant”) or directly program the thing?
I have the EL Sequencer and a 3.3v FTDI breakout. I could successfully push down arduino sketches but couldn’t seem to figure out how to control the A-H channels.
So I decided to switch over to a pure C and winAVR approach. I updated my eclipse environment with the AVR plugin, which uses winAVR tools behind the scenes. It was really easy to create a new AVR C application and paste the sparkfun code into a main.c. But I ran into trouble trying to figure out what type of hardware to configure it for(avrdude stuff).
With this, I get a decent output coming back from avrdude:
C:\mystuff\MyProjects\NeonHelloWorld\Debug>avrdude -pm168 -cavrisp -P//./COM31 NeonHelloWorld.elf -Uflash:w:NeonHelloWorld.hex:a -v -b19200 -F
avrdude: Version 5.6, compiled on Mar 5 2009 at 09:59:30
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
System wide configuration file is "C:\WinAVR-20090313\bin\avrdude.conf"
Using Port : //./COM31
Using Programmer : avrisp
Overriding Baud Rate : 19200
AVR Part : ATMEGA168
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Max
W ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
eeprom 65 5 4 0 no 512 4 0 3600 36
00 0xff 0xff
flash 65 6 128 0 yes 16384 128 128 4500 45
00 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 45
00 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 45
00 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 45
00 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 45
00 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0
0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0
0 0x00 0x00
Programmer Type : STK500
Description : Atmel AVR ISP
Hardware Version: 2
Firmware Version: 1.16
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA168 is 1E 94 06
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "NeonHelloWorld.hex"
avrdude: input file NeonHelloWorld.hex auto detected as Intel Hex
avrdude: writing flash (1584 bytes):
Writing | ################################################## | 100% 1.42s
avrdude: 1584 bytes of flash written
avrdude: verifying flash memory against NeonHelloWorld.hex:
avrdude: load data flash data from input file NeonHelloWorld.hex:
avrdude: input file NeonHelloWorld.hex auto detected as Intel Hex
avrdude: input file NeonHelloWorld.hex contains 1584 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 1.20s
avrdude: verifying ...
avrdude: 1584 bytes of flash verified
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK
avrdude done. Thank you.
C:\mystuff\MyProjects\NeonHelloWorld\Debug>
Note that I have to ignore the device signature (-F) to get it to work. I have not verified that this actually worked - I’m running out of “weekend” but wanted to post my results.
I also noticed that I had to reboot my el sequencer board every time when I was trying different configurations. It flashes the LED rapidly 7 times on boot up, and then it’s ready to accept an update.
Now if I can figure out how to make the LED blink, I can verify that the code actually works! (Don’t have my neon wire - my son went to band camp today, and took the ac inverter and neon wire with him - we made a “neon man” that he wanted to show off.)
Hope this helps someone else. I’ve seen a lot of posts about this topic, but with no good concrete results.
It works! I used [this article to figure out how to make the LED work. I can successfully light up the LED now. Here’s the modified sparkfun code. Note that I still don’t have any neon wire or inverter, so have not tested that part yet. And my ledOn() and ledOff() functions aren’t friendly to the current state of the neon wire. They should only modify bit 5’s state, not all bits of the port.
/*
EL Driver test code
Pete Dokter, 5/20/09
*/
#include <avr/io.h>
#include <avr/interrupt.h>
#define EL_G 0 //PB0
#define EL_H 1 //PB1
#define EL_A 0 //PC0
#define EL_B 1 //PC1
#define EL_C 2 //PC2
#define EL_D 3 //PC3
#define EL_E 4 //PC4
#define EL_F 5 //PC5
#define LED 5 //PB5
//Define functions
//======================
void ioinit(void); //Initializes IO
void delay_ms(uint16_t x); //General purpose delay
void delay_us(int x);
void ledOn();
void ledOff();
void pulse(char line, int speed);
void cycle(int speed);
void line_on(char line);//send 'A' through 'H'
void line_off(char line);//send 'A' through 'H'
//======================
static char line_on_1 = 0;
static char line_on_2 = 0;
int main (void)
{
int x;
ioinit(); //Setup IO pins and defaults
delay_ms(5000);
while(1)
{
delay_ms(1000);
ledOn();
for (x = 0; x < 4; x++)
{
pulse('A',125);
delay_ms(100);
}
for (x = 10000; x < 25000; x+=1000)
{
cycle(x);
}
for (x = 25000; x < 32000; x+=200)
{
cycle(x);
}
for (x = 0; x < 1600; x++)
{
cycle(32000);
}
for (x = 0; x < 15; x++)
{
line_on('F');
delay_ms(20);
line_on('B');
delay_ms(20);
line_on('H');
delay_ms(20);
line_on('E');
delay_ms(20);
line_on('C');
delay_ms(20);
line_on('A');
delay_ms(20);
line_on('D');
delay_ms(20);
line_on('G');
delay_ms(20);
}
line_off('D');
line_off('G');
for (x = 0; x < 4; x++)
{
pulse('A',250);
delay_ms(100);
}
ledOff();
}
}
void ioinit (void)
{
//brent_c's update:
PORTB = 0;
DDRB = 0x23;
PORTC = 0;
DDRC = 0x3F;
TCCR2B = (1<<CS21); //Set Prescaler to 8. CS21=1
}
//General short delays
void delay_us(int x)
{
int y, z, a;
y = x/256;
z = x - y * 256;
for (a = 0; a < y; a++)
{
TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
TCNT2 = 0; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click
while(!(TIFR2 & 0x01));
}
TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
TCNT2 = 256-z; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click
while(!(TIFR2 & 0x01));
}
//General short delays
void delay_ms(uint16_t x)
{
for (; x > 0 ; x--)
{
delay_us(250);
delay_us(250);
delay_us(250);
delay_us(250);
}
}
void pulse(char line, int speed)
{
int x;
for (x = 0; x < 10000; x+=speed)
{
line_on(line);
delay_us(x + 100);
line_off(line);
delay_us(10000 - x);
}
for (x = 0; x < 10000; x+=speed)
{
line_on(line);
delay_us(10100 - x);
line_off(line);
delay_us(x + 100);
}
}
void line_on(char line)//send 'A' through 'H'
{
char temp;
if (line_on_2 != 0) line_off(line_on_2);//can't have more than one line on at a time
//keep track of what's on and in what sequence
line_on_2 = line_on_1;
line_on_1 = line;
temp = line - 65;
if (temp < 6) DDRC |= (1<<temp);
else DDRB |= (1<<(temp-6));
}
void line_off(char line)//send 'A' through 'H'
{
char temp;
if (line == line_on_2) line_on_2 = 0;
else if (line == line_on_1)
{
line_on_1 = line_on_2;
line_on_2 = 0;
}
temp = line - 65;
if (temp < 6) DDRC &= ~(1<<temp);
else DDRB &= ~(1<<(temp-6));
}
void cycle(int speed)
{
int x;
if (speed > 32000) speed = 32000;
for (x = 65; x < 72; x++)
{
line_on(x);
delay_us(32100 - speed);
}
for (x = 72; x >= 65; x--)
{
line_on(x);
delay_us(32100 - speed);
}
line_off('B');
delay_us(32100 - speed);
line_off('A');
}
void ledOn(){
PORTB = 0xFF;
}
void ledOff(){
PORTB = 0x00;
}
Not to resurrect a dead topic, but I’d like to purchase the EL sequencer rather than the Escudo. Have we determined that this can be programmed with the Arduino environment? I have the FTDI breakout board and drivers installed.
BretMattingly:
Not to resurrect a dead topic, but I’d like to purchase the EL sequencer rather than the Escudo. Have we determined that this can be programmed with the Arduino environment? I have the FTDI breakout board and drivers installed.
Yes, it can. Works just like an Arduino, can program it using a standard FTDI cable/board.
Only thing: I had a bit of trouble figuring out how to actually get it to work, and the software library included… well, just doesn’t work. The EL Sequencer is different in a number of ways than the El Escudo, specifically around pin mapping.
Here’s some code that I wrote. See http://site3.ca/projects/el-sequencer-sign/ for specific details on what I used it for. I took the fade code out of the library and put it right into my sketch, changing slightly to account for different pins (using the analog pins instead of A-H).
Funny, your code looks VERY similar to the stuff I drafted up on paper today, particular.
Mine just came in today (SFE Tech Support confirmed the FTDI could program it). I was comparing notes on the EL Escudo library to the Heartbeat Jacket tutorial, and just like you, I found something was afoul.
The straitjacket tutorial said that the TRIAC was turned on by setting the channel pin HIGH.
The Escudo library turns the pin LOW?
I haven’t gotten to test it yet, but my money’s on the first one. Looks like your code works, though I haven’t determined from your code that HIGH is on and LOW is off. Is that the case?
Cool project, btw! And as it happens, I AM making an EL mask. Great minds?
The El Escudo library is on a different computer so I can’t check right now, but I wouldn’t be surprised if the library turns the pin low to turn the wire on. I remember looking at that code a few times and wondering “…does this even work? Has anyone ever tested this?” I gave up on it very quickly though when I realized that the EL Sequencer board is entirely incompatible with the EL Escudo code (“why is it referencing those pins with A - H?”).
What kind of mask are you working on? I assembled a mask from a gas mask which I lit up with red LEDs inside the eyes and a cap where I wove in 50 lengths of 2’ wire on four channels for hair. Attaching a more powerful inverter that would drive 25’ or so of wire just didn’t work when connected through the EL Sequencer. At that point I was running out of time, so I just used four separate inverters and didn’t go for the fade effects I wanted. I’m actually thinking of putting together a board similar to the EL Sequencer but adding a few features (onboard inverter, chainable, controlled by an external Arduino).
Best of luck with your project, post some project details when you’re done!
Haven’t gotten to test it yet…All I have is sh*tty RadioHack heat shrink and EL wire is a BITCH to solder with.
I know the Escudo library is not compatible with the Sequencer, but by comparing the Arduino schematic and the Sequencer schematic, I was able to figure out which channels were assigned to which pins.
Thanks for clarifying, I believe the Escudo code in the library is this:
//Wire on function
pinMode(channel, OUTPUT);
digitalWrite(channel, LOW);
//Wire off function
pinMode(channel, INPUT);
And the ‘all on’ function is just weird. I’ll update if I have success (once I can test this stuff. Busy weekend for me).
That gas mask sounds awesome. I’m just designing something bare minimal, for a masquerade. It’s gonna be wrapped around my face (ideally in flexible nylon tubing) looking like a sort of tribal face design.
Alright. Now I’m having programming issues. Go figure.
First, my specs:
Windows XP SP3
FTDI Basic Breakout 5V (Trace cut and solder jumper added, device operates at 3.3V)
Arduino 0017
When I try to upload the code, I get this:
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
I’ve tried both serial port options and several board options. Nothing seems to be working. even tried resetting the board manually beforehand. Nothing. Can anyone offer some assistance?
First, make sure you’re using the correct serial port. You can tell which one it is by going into the Windows Device Manager and checking under Ports to see which one is attached to the FTDI breakout.
From there, give the “LilyPad Arduino w/ ATmega 168” board profile a try. That’s the one that’s working fine for me. I’m also using a 5V FTDI cable, so if the board profile doesn’t work for you, maybe try the FTDI board at 5V?
Anyone who’s using the newest EL Seq has an ATMega328, NOT a 168. Switched the board option to “Pro or Pro Mini with ATMega328 (3.3V, 8mHz)” and BOOM. Love it. Thanks for all your help!