DDRA and PORTA declaration

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

HI Freaks...
I have connected an ISD2590 chip which is a speech IC .
I have declared PORT A (whicg the ISD is connected to ) like this...
DDRA 0x07 and that means that PA.0-PA2 is outpout
and PORTA=0x00.

In order to operate the chipp to play a massage i need to pull PA.1 down to "0" and then back to "1"
But the problem is that as soon as i turn the system on,the AT90s8515 semds this sequence for the PA.2 pin.
It looks like the PA.2 goes automaticlly to "0" and then gets back to is normally position which is "1" (by the ay it is connected with a pull up resistor.

After the system turns on it operates that trigger and then it is woking fine (only when i am asking it to sound the massage )

My question is....
1)can i declare a different DDRA in the midde of the code (in the main routineO or it can only be done before the MAIn begins?
2did i declared it correctly?

Thnak you

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

Hi,

When you set up your port, with DDRA 0x07 and PORTA 0x00, you are immediately putting a "low" out to the sound chip, triggering it. Initializing PORTA with 0x02 would put a "hi"
initially on PA.1 which may prevent triggering the chip. Having the pullup is good because
at/during reset the port pins will be in a high impedance state, which could allow spurious
operation without the pullup.

When initializing, I would first load PORTA, then set up DDRA. Also, you can freely
change your port configurations as much as you want anywhere in your program.

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma