Programming the ATtiny84 with the Propeller (working)
Cluso99
Posts: 18,069
I have a tiny (pun intended) Avr board to plug into a propeller board as an add-on. I intend it to communicate with the propeller by either serial or I2C. Jazzed has already proved I2C works to the Propeller, having placed a PS2 Keyboard and Mouse on the other end of the ATtiny.
My board (Cluso's AvrBlade) is 1"x1" and has provision for an ATtiny85 (8pin) and/or an ATtiny84 (14pin) and a 3V3 regulator.
Both AVRs have 4pin headers for programming them and I intend to ultimately program them with the Propeller. Communications to the propeller is intended to be via the SDA & SCL pins on each ATtiny.
The ATtiny85 brings out 2 ADCs to header pins and the ATtiny84 brings out 4 ADCs to header pins and a further 4 I/Os to header pins.
From research, the PropPlug and FT232RL may or may not work. The Propeller will certainly be able to program the ATtiny in ISP SPI mode.
Just before I start on my programming attempts, and not wishing to reinvent the wheel...
1. Has anyone programmed an ATtiny (or any AVR in ISP mode) with the Propeller?
2. Has anyone programmed an ATtiny with a PropPlug or FT232RL based board?
Postedit: I have now programmed the ATTiny84 successfully with the Propeller chip. Code is attached to post #14.
My board (Cluso's AvrBlade) is 1"x1" and has provision for an ATtiny85 (8pin) and/or an ATtiny84 (14pin) and a 3V3 regulator.
Both AVRs have 4pin headers for programming them and I intend to ultimately program them with the Propeller. Communications to the propeller is intended to be via the SDA & SCL pins on each ATtiny.
The ATtiny85 brings out 2 ADCs to header pins and the ATtiny84 brings out 4 ADCs to header pins and a further 4 I/Os to header pins.
From research, the PropPlug and FT232RL may or may not work. The Propeller will certainly be able to program the ATtiny in ISP SPI mode.
Just before I start on my programming attempts, and not wishing to reinvent the wheel...
1. Has anyone programmed an ATtiny (or any AVR in ISP mode) with the Propeller?
2. Has anyone programmed an ATtiny with a PropPlug or FT232RL based board?
Postedit: I have now programmed the ATTiny84 successfully with the Propeller chip. Code is attached to post #14.
Comments
Next is to program a simple led flash program to verify the actual programming works from the prop.
I use Pony Prog and a serial interface or USBASP, http://www.fischl.de/usbasp/ (But there are those chickens and pre-chickens again).
I have a simple led flash program (in C) and I have a small hex file for this... Well 160B just to make an output and alternate with a delay! Hope it works because I am just going to hardcode the programming (cut & paste) of the hex file to prove the programming works. Report back shortly
It is a pity that the one port that was one of the first requisites on a home computer is now dropped, it prevents so many little interface kludges. On our works laptop I had to argue for one that had a real serial port and not rely on those USB adaptors that have a 50/50 chance of working with propriatry/older software.
Unfortunately, while the programming is correctly verified, the attiny program does not work properly. The led is on permanently. I have also attached the C code too in case someone can see what is wrong.
AVRtest001.c
ATTinyISP_011.spin
I have never played with the t84 though, t45s were "costless" to me a while back, so I have had a few of those.
Not sure what was wrong with the AVR C code. I rewrote using just a register instead of the delay calls and it works!
Here is the full code to read the various config bytes, flash and eeprom from the ATTiny84, erase, and program it. The hex file is in the DAT section, along with the AVR C source code.
Since I have a 3V3 regulator on my little avr pcb, no resistors are required on the 4 interface pins.
And here is a pic of my AvrBlade pcb. It is 1"sq and stacks onto my other boards. While you cannot see the ATTiny84 (14 pin SOIC), you can see provision for the ATTiny25/45/85. Next to program the ATTiny85.
ATTinyISP_012 - Archive [Date 2011.10.17 Time 20.15].zip
The F860 is slightly cheaper, ~80c 1+ at Mouser, and can be programmed over the 2 wire C2D interface, but would need a code change from the SPI-AVR pgm.
I have Tachyon code that programs the Silabs parts on the C2 interface. I normally communicate with these chips over I2C so what I do is tie the C2D line to the SDA line and then I only need one dedicated Prop I/O for the C2RST line. The trouble I find with Silabs parts is that there is never any real stock anywhere, I mean Digikey has a whopping great stack of 48 chips, you heard it boys and girls, 48 chips, come and get it.
Useful info.
that's for the B revision, the C revision most would prefer is showing (wait for it) 42 at Mouser.
Mouser says 3 weeks FLT and Digikey gave me a date of 27 Dec when I entered 1008 units.
Mouser do show for the
C8051F850-C-GU 8kB/512B RAM, ADC, QSOP24
23 Can Ship Immediately 168 On Order Estimated Ship Date 168 11/29/2013
- but you are right, all toe-in-the-water volumes.
Given this makes a nice 12b ADC, the micro almost comes for free..