Programming the ATtiny84 with the Propeller (working)
Cluso99
Posts: 18,071
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
;test.asm ;test program for ATtiny45 ; ;Clock: internal 8 MHz RC oscillator #include "tn45def.inc" .def temp=r16 .def counter=r17 #define LED PB3 ; pin 2 #define Delay_count 6 .cseg .org 0x0000 rjmp RESET ; Reset Handler rjmp EXT_INT0 ; IRQ0 Handler rjmp PCINT0 ; PCINT0 Handler rjmp TIM1_COMPA ; Timer1 CompareA Handler rjmp TIM1_OVF ; Timer1 Overflow Handler rjmp TIM0_OVF ; Timer0 Overflow Handler rjmp EE_RDY ; EEPROM Ready Handler rjmp ANA_COMP ; Analog Comparator Handler rjmp ADC_CONV ; ADC Conversion Handler rjmp TIM1_COMPB ; Timer1 CompareB Handler rjmp TIM0_COMPA ; rjmp TIM0_COMPB ; rjmp WDT ; rjmp USI_START ; rjmp USI_OVF ; RESET: ldi temp,low(RAMEND) ;initialise stack out spl,temp ldi temp,high(RAMEND) out sph,temp sbi DDRB,LED ;PB3 output (LED) sbi PORTB,PB2 ;PB2 input with pullup cbi DDRB,PB2 ; set up Timer/Counter 0 ldi Temp,0x05 ;1/1024 prescale out TCCR0B,Temp ldi Temp,1<<TOV0 ;Clear TOV0/ clear pending interrupts out TIFR,Temp ldi Temp,1<<TOIE0 ;Enable Timer/Counter0 Overflow Interrupt out TIMSK,Temp ldi Temp,Delay_count;init. delay count out TCNT0,Temp ldi r19, 1<<LED clr r18 sei ; global enable interrupts loop: cpi counter, 5 brne loop1 clr counter eor r18,r19 out portb,r18 loop1: rjmp loop ; Timer0 Overflow Handler TIM0_OVF: push temp in temp,SREG push temp inc counter ldi temp,Delay_count out TCNT0,temp pop temp out SREG, temp pop temp reti EXT_INT0: ; IRQ0 Handler TIM1_COMPA: TIM1_OVF: EE_RDY: ANA_COMP: ADC_CONV: TIM1_COMPB: TIM0_COMPA: TIM0_COMPB: WDT: USI_START: USI_OVF: retiNext 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..