ATMega8L and Portb Problem

Status
Not open for further replies.

alisarhangpour

New Member
I've programmed fuse bits so my ATMega8L micro uses a 4MHz internal clock source and pins XTAL1 & 2 are free for I/O (port B, bits 6 & 7) but, although every other bits of this ports work OK, these two pins seem not to work as I/O pins. I know STK500 has a rather confusing routing to these pins, but I'm not using STK500. I program my chip through LPT1 having a 74244 buffer in between and every thing's OK except these two pins. Are there any more fuse bits, etc. I have to program in order to be able to work with PORTB6 & PORTB7? (I mean fuse bits other than cksel0...3)
 
Would there be jumpers on the STK500? I use AVR Dragon, so no jumpers to set, but remember reading something about jumpers and STK500...
 
Just setting them to be outputs with writing into DDRB will do what? What will the pins do, when you want to control them? stay 0?
 
Are you using someone else codes which is meant for also a 32.7KHz crystal connects to PB6 & PB7?

If so, looks like the AS2 bit in the ASSR register has been set. This will disconnect the pin from the I/O port so that it can be used in an oscillator configuration.
 
No, I'm not using someone else's code. I wrote 0xFF to DDRB and made it an output. Fuse bits are programmed already. I wrote a very simple code to toggle one of the PORTB pins every 500 usec and attached a buzzer to that pin. every pin of portb works well (toggles at every timer interrupt so the buzzer makes it's sound) except PB6 & PB7.
 
Then what are the PB6 and 7 doing? do you have an oscilloscope or something? is it floating around? is the hardware connected to them correct? Have you messed around in ASSR like Chung said?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…