Programming the Tiny10 on the STK600

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With only 6-pins on the Tiny10, 3 out of 4 I/O pins have programming signals. Each time I try a program change I need to remove the jumpers. Mostly a nuisance, but prone to errors in the debug process. For a complex platform as the STK600, a tristate programming interface would have made sense - especially on the Tiny series.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In general on an AVR we can sort out the pin functions so that the ISP rig doesn't interfere with normal operations. Not always, but usually.

On the low pin-count devices it is harder, isn't it? ;) I don't know if that interface is "different" than the other ISP methods; I'd think the STK600 would have those signals high-impedance when not in a program mode.

Often you can isolate the ISP signals with a series resistor. I guess we'd need to see what you have hanging on those pins.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lee,
Here's the current setup

 
; ============================================
;      P O R T S   A N D   P I N S 
; ============================================
;
;               +-----+
; LED PWM PB0 [1|o    |6] PB3 Switch to gnd
;         GND [2|     |5] +Vcc
;     LED PB1 [3|     |4] PB2 ADC2 ARef0 
;               +-----+

Nothing robust, but the clk is on PB1 so the LED was always dimly lit, the Switch does not have to be removed, but ARef0 and the LED on PB0 need to be removed.
Note that Vcc must be 5.0 volts to program.

Bob

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would like to store some bits that can survive a complete power down. It does not appear that the Tiny10 has non-volatile R/W memory, but I thought it was worth asking if I'm mistaken.

I see in the spec that we can read the program memory starting at 0x4000, but not write it.

Anyone have any tricks that don't use external memory?

Thanks,

Bob

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nope, no EEPROM and no SPM. If you just traded up one small step to one of the 8 pin AVRs you could have these things.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmmm, you pose a strong argument Cliff. If I went to the Tiny13, I get to use the Dragon platform too. Interestingly, the STK-600 does not come with an adapter card for an 8-pin solution.

I guess I have to look at the spec sheet seriously and hope the port isn't major rewrite.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

the STK-600 does not come with an adapter card for an 8-pin solution.

Well if they are in PDIP then the 40 pin PDIP ZIF socket routing card can accomodate all the PDIP packages I believe - that *should* include 8 pin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I agree. But the STK-600 starter kit that I have does not have one. I'd have to buy the ATSTK600-DIP set of adapters. Personally, I'd rather get a Dragon and add the ziff socket.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yup it is a bit curious that you can get a whole Dragon and a ZIF socket for a lot less than the $99 that Atmel charge just for a ZIF and a few bits of PCB. The DIP routing card should be about $20-$30

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can anyone tell me why there is a "subi" instruction and not an addi? Is there a simple workaround?
I thought I could "subi temp,246" to actually "addi temp,10" but the resulting flags didn't set as expected. I assume it is because of the two's compliment of the subtract, but I don't really know.

B

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Can anyone tell me why there is a "subi" instruction and not an addi? Is there a simple workaround?

It's to save silicon. To add subtract the -ve of what you want to add. In other words 5+10=15 is the same as 5-(-10)=15. So just

subi r16, -10

but "-10" *is* 246 in 1 byte 2's complement so I'm not sure why you didn't find the 246 to work? What appeared to be wrong?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well if you agree it should work, then maybe I didn't think through my code. I'm adding a bit of hysteresis to my light detection code:

sbrc	State,Dark	; skip if already light
                        ; subtract -10 (no addi instr)
subi	ADValue,245	; it's dark, make it seem lighter

As the A2D sensor reached the threshhold, it would flicker a bit, so if it is already dark, then raise the threshold until it triggers light again. Then I don't apply any offset.
Maybe it's my logic, but I'm glad my subi -10 approach should work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Although you have the -10 comment there I'd actually switch the 245 to be -10 so it's clearer to the casual reader (perhaps with a comment to make it clear that it's actually "add 10")