hi friends ,
iam trying to make PD0 as a gpio output and PD1 as a input ( BF 548 ) and an interrupt is triggered when there is a falling edge on the input pin ,
can anybody tell me how to do this .
Here are the steps:
- clear both bit0 and bit1 of PORTD_FER register.
- set bit0 and clear bit1 of PORTD_DIR register.
- set bit1 of PORTD_INEN register.
These steps will configure PD0 as GP output pin and PD1 as GP input pin.
High or low on PD0 can be driven by writting to setting bit0 of PORTD_SET or PORTD_CLEAR registers respectively.
In order to get interrupt from the PD1 pin, follow these steps:
- register the interrupt handler for IRQ_PINT2 block
- set bit1 of PINT2_INVERT_SET register
- set bit1 of PINT2_EDGE_SET register
- set bit1 of PINT2_MASK_SET register
In the PINT2 ISR, clear the interupt latch by setting bit1 of PINT2_REQUEST register.
[Note: I have suggested to use PINT2, because by default PORTD pins are mapped to it. If you want to use PINT3 or upper part of PINT2, configure ASSIGN register of that PINT block appropriately].
I am attaching a similar code, which might help you. Let me know if you need any clarification regarding any step.
as this question relates to the BF548, I have moved it from the Processors and DSP Community to the Blackfin Community for better visibility. Please continue the discussion here.
Thanks Prashant , actually iam new to blackfin so i need to know step by step the code that u sent is a little hard to me , please can u send me a simple code where i can set these pins .
Thanks and regards
hi prashant ,
i got it , how to make gpio as output / input , thanks for the attached example .
Retrieving data ...