STK 500 port B

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

I recently starting using an STK 500 with a mega328p I had lying around. My question is why can I not light up all the LED's on port B?

If I use this code as a quick example:

DDRB = 0xFF;
PORTB= 0x00;

Only LED's 0to5 light up and 6&7 stay unlit. Anybody know why this may be?

Thanks!

Christan

Chief Tinkerer

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

Try a different ribbon cable from the port to the LEDs. Also, add an infinite loop at the end (probably not necessary, but wise):

DDRB = 0xFF;
PORTB= 0x00; 
while(1) ;

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

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

triden wrote:
My question is why can I not light up all the LED's on port B?

Look on the STK500 schematic.
Some pins are routed to PORTE/AUX.

Peter

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

Quote:
Only LED's 0to5 light up and 6&7 stay unlit. Anybody know why this may be?

Look at the mega328P data sheet.

Can you find a PORTB.6 and PORTB.7 pin ?

(Mind you, PC6 and PC7 are present on the 32pin packages.)

David.

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

Quote:
Look at the mega328P data sheet.

Can you find a PORTB.6 and PORTB.7 pin ?

Yes, pins 9 and 10.

Regards,
Steve A.

The Board helps those that help themselves.

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

These pins can be used for i/o only if the internal RC oscillator is used as a CPU clock source and if Timer2 is NOT in asynchronous mode.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

Quote:

"stk500 pb6 pb7"
Search for any terms or use query as entered
x Search for all terms

Quote:
Search found 88 matches
...
Mega8 PB6 and PB7 as I/O pins.
STK500 PB6 and PB7 don't respond.
Trouble with PB6 and BP7 as input on mega168
...
...

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

MBedder wrote:
These pins can be used for i/o only if the internal RC oscillator is used as a CPU clock source and if Timer2 is NOT in asynchronous mode.

I am using the internal RC and the Timer is not being used. Other ribbon cables dont make a difference.

Chief Tinkerer

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

The STK500 is designed to route the XTAL1 and XTAL2 pin to the PORTE/AUX header.

In the case of a mega328P you need to access the PORTE/AUX header. I think you will find that the PORTB header just does not get PB6, PB7 routed from the green AVR socket. You can check the STK500 schematic (I have not).

So if you put a two-way jumper from PORTE/AUX to the LED header you should see those LEDs. (remove the XTAL1 jumper)

Untested. If this does not work, shout. I will try it myself.

Note that you cannot use a 10-way ribbon. You need to use the 2-way jumper cables.

David.

Edit. Just tried it. i.e. four 2-way jumpers to LED header. It works fine. (with or without XTAL1 jumper)

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

david.prentice wrote:
The STK500 is designed to route the XTAL1 and XTAL2 pin to the PORTE/AUX header.

In the case of a mega328P you need to access the PORTE/AUX header. I think you will find that the PORTB header just does not get PB6, PB7 routed from the green AVR socket. You can check the STK500 schematic (I have not).

So if you put a two-way jumper from PORTE/AUX to the LED header you should see those LEDs. (remove the XTAL1 jumper)

Untested. If this does not work, shout. I will try it myself.

Note that you cannot use a 10-way ribbon. You need to use the 2-way jumper cables.

David.

Edit. Just tried it. i.e. four 2-way jumpers to LED header. It works fine. (with or without XTAL1 jumper)

Wow - I know this has been a few years but Thanks!
also true for the atmega168