Can't Set Tiny10 output high !? Solved

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

@#@# !!!@ $#@! %$!!

Alright, now that I got THAT halfway off my chest...I'm STUCK using a t10 for a client's app. Nothing I do will set PB2 as an output pin to HIGH !!!? Nothing else is connected to the MCU yet. I couldn't find anything about this...

I read its sign. correctly and it programs fine...
Clk source is the default 8 MHz / 8.

Stank Tiny10 is the 6 pin package, at 5V.

Toolchain: 1), 2) and B) from my sign.

.nolist
.include  "tn10def.inc"
.list


.equ   BLUE_LED   PB2  // Right  pin
.equ   RED_LED   PB1  // Left pin


.org   0x0000

rjmp   reset

reti ;INT0
reti 
reti 
reti 
reti 
reti 
reti 
reti 
reti 


.org   0x000D

   reset:

// Stack pointer auto. set to RAMEND.

	ldi   r17, 1<< PB2
	ldi   r16, 1<< DDB2 	
	out   PORTB, r17
	out   DDRB, r16

	//sbi   PORTB, 2
	//sbi  DDRB, 2

	loop:

		rjmp  loop

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

Last Edited: Thu. Jun 7, 2012 - 08:06 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you tried the tutorials forum? :roll: :wink:

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

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

Welcome back Larry. There aren't any tuts about the t10s and anyway the posted code for setting port pins is correct.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

Is the Tiny10 not one of the few names that is used more then once by atmel?
hence perhaps the compiler chooses the wrong one and sets the wrong registers.
you could dig into the list/include file to see if the right registers are set there.
what happens if you just set all pins high or low, it might even be that you accidentally measure the wrong pin(but I assume you triple checked what pin to measure on)

writing this...
do you have the programmer still attached?

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

meslomp wrote:
Is the Tiny10 not one of the few names that is used more then once by atmel?
hence perhaps the compiler chooses the wrong one and sets the wrong registers.
you could dig into the list/include file to see if the right registers are set there.
what happens if you just set all pins high or low, it might even be that you accidentally measure the wrong pin(but I assume you triple checked what pin to measure on)
Meslomp, I don't know if the name is used > 1X, I've never worked with this gizmo. For my toolchain, only the assembler supports it. I'm definitely on the right pin. I've just tried setting PB0-PB2 and NONE go HIGH ( DMV = 430 mV, same when I just tried PB2 alone ).
Quote:
do you have the programmer still attached?
Yes.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

For a starter the code as posted doesn't assemble. :) Try

.equ   BLUE_LED=PB2  // Right  pin 
.equ   RED_LED=PB1  // Left pin 

ie = sign missing.

It simulates correctly otherwise.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I had to do this:

.equ   BLUE_LED   = PB2  // Right  pin 
.equ   RED_LED    = PB1  // Left pin 

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

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

How do we do that John? :o

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

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

Slow to the party Larry... :wink:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I was in the loo making room for a Fosters. :wink:

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

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

JS wrote:
For a starter the code as posted doesn't assemble.
Oops, in the original code I used
#define

and when I changed it to .equ, I missed = sign when I posted, but I had corrected when I assembled it. Yeah, it DOES simulate right either way, which only makes it more frustrating !

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

You say above that the programmer is still plugged in? What happens if you unplug it? At times the chips doesn't get released by it.

Of course in the silly suggestions dept. is a short on the board.:)

Unfortunately I have never used the 6 pin thingies so not much help from here. :(

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

The usual stuff at this point.

Did you try separate LEDs?
Check your wiring?
Get enough sleep?...

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

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

John, I did try unplugging it multiple times, but it didn't help.

Quote:
Unfortunately I have never used the 6 pin thingies
HOPEFULLY, this 1st time will be my LAST !

Larry, no LEDs just DVM to the pins/traces and no shorts. Sleep thing sounds REAL nice though... :wink:

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

Quote:
I was in the loo making room for a Fosters.

Larry, you do realise that no one in Australia actually drinks Fosters apart from tourists. We just export the crap! The popular one used to be Victoria Bitter (VB) which can also be used as a form of currency (slabavic).

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

Quote:
...no one in Australia actually drinks Fosters apart from tourists. We just export the crap!
LOL, NOW I know why those Foster's commercials didn't last too long over here ! Did them drinking it make them crappy tourists ?! LOL

Edit: To John S.: I "disconnected" the MKII before by just taking out USB on the programmer side ( Everything's powered by the 5V USB ). I just now tried disconnecting the ISP cable and NOW IT WORKS ! :D Thanks, man ! A 6 pack of VB to ya .

Damn, I'm hatin' this tiny10 ( So I'd have to disconnect and reconnect until I'm all done.... ). Would a series resistor allow me to keep the ISP connected ? I'll try it later ...

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

Last Edited: Thu. Jun 7, 2012 - 08:05 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok time for the stupid things....
power supply is OK?
reset is released?

what happens if you attach a vdd -> 10K
10K -> vss

does the pin float at that point or is it hard low?

whar happens if you put a ".cseg" infornt of the first ".org 0x0000"

and last but not least replace all the used things from the inc file by a hard coded adress.

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

Meslomp, all done...FINALLY.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

and then of coarse we all are curious as to what the problem turned out to be. :?:

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

Quote:
and then of coarse we all are curious as to what the problem turned out to be. Question

See my 2nd to last post. Thanks for everybody's time/input.

Also, I had already tried a pullup on reset pin ( t10s have an internal one ) and the .cseg and neither one helped.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

Kartman wrote:
Quote:
I was in the loo making room for a Fosters.

Larry, you do realise that no one in Australia actually drinks Fosters apart from tourists.

I haven't had a Fosters since the first time I had a Fosters. Hence the :wink:

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

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

Quote:
disconnecting the ISP cable and NOW IT WORKS !
Well that was meslomp's question early in the thread so half of the beer goes to him, actually he can have it all, too cold here for beer now. :)

When one asks about disconnecting the programmer one expects that it is unplugged from the board under test. :wink:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Quote:
Well that was meslomp's question early in the thread so half of the beer goes to him...
Yeah true, thanks Meslomp !

Quote:

When one asks about disconnecting the programmer one expects that it is unplugged from the board under test. :wink:
Yeah, sorry about that. :mrgreen:

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1