Zilog with the Sharpd GP2D15 sensor.

Translate This Thread From English to

Threaded View
Hi,
I am using a Zilog Z8F6403 Evaluation board for programming. I am using
a GP2D15 sensor with it for proximity sensing. I am taking the output
of the sensor on port D pin 2. But, whenever I configure my port it
gives me a 3.3 V output even if I have configued that port as input.
I am generating an interrupt each time  I get a high from the IR
sensor. The IR sensor works fine but, the port pin remains high by
default and hence the program does not work. How do i set the port pin
as low so that I can wait for a HI from the sensor.

The settings for the port and interrupt are:
/********************************************************************/
void init_p2ad()
{

   SET_VECTOR(P2AD, isr_p2ad);

   PDADDR=0x00;
   PDCTL=0x00;

   PDADDR =0x01;
   PDCTL |= 0x04;

   IRQ1ENL &= 0xFB; // Assigning nominal priority.
   IRQ1ENH |= 0x04; //

   IRQES &=0x04;  // Rising edge
   IRQPS=0x04;    //
   printf("\n interrupt initialisation");
}
  #pragma interrupt
  void isr_p2ad()
 {
   //count++;
   Flag = 1;  // flag that we received an interrupt
 }
/*************************************************************************/


Thank you for any information.

Priti


Re: Zilog with the Sharpd GP2D15 sensor.

You might want to re-post your problem to the Z8 Encore Forum in Yahoo
Groups.


/*************************************************************************/


Site Timeline