Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

PortC problem

PortC problem

2004-01-11 by Dave and Connie

My son is trying to use a Mega16 to drive LEDs on PortC using Bascom.  Bits 
0,1,6,7 work but 2,3,4,5 do not.  The port is set up with Config Portc = 
output.  The same code works on PortA but he does not want to use that port 
as it is the A/D converters.  The LED code will eventually become stepper 
code.  He has tried the code on two chips with the same result.

Suggestions?

Dave

Re: PortC problem

2004-01-11 by velo1_4mb

Figured it out with a couple of hours of google.  It is a problem 
with JTAG.  The chip has it turned on by default and that takes the 
middle 4 pins of port c.  To turn it off in bascom you need to set 
the bit twice with:

Mcusr = &H80
Mcusr = &H80

All 8 bits are his now and the stepper spins.

Dave

--- In AVR-Chat@yahoogroups.com, Dave and Connie <dmatthe1@r...> 
wrote:
> My son is trying to use a Mega16 to drive LEDs on PortC using 
Bascom.  Bits 
> 0,1,6,7 work but 2,3,4,5 do not.  The port is set up with Config 
Portc = 
> output.  The same code works on PortA but he does not want to use 
that port 
> as it is the A/D converters.  The LED code will eventually become 
stepper 
Show quoted textHide quoted text
> code.  He has tried the code on two chips with the same result.
> 
> Suggestions?
> 
> Dave

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.