Zilog with the Sharpd GP2D15 sensor.

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

Reply to
amr
Loading thread data ...

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.