Hello,
I am using a PCAN Router as a gateway but I was wondering if I can use the din0 input with an interrupt? I want to be able to calculate the frequency of pulses on a digital input line (varying from ~2Hz to ~60Hz) and use this as a CAN output.
I checked the manuals but despite referencing that the Din0 is a low active pin I couldn't find out how to interface with it in the firmware.
Thanks for any advice you can offer,
Adam
Using Din0 input with interrupt?
Re: Using Din0 input with interrupt?
hello,
the Din0 is not available for interrupt. The normal case is to use the function
HW_GetDIN(). For 60 Hz this will be about 16 ms in Period so it could satisfy
your requirements. When the main loop is not blocking to much the timer
example can be used to check timer value when an edge is detected.
The Din0 is connected to pin P0.19 / CAP1.2 . See the LPC21XX datasheet.
You can use timer capture too. When Din0 is pulled to GND a rising edge is
seen at the capture pin. Configure PINSEL1 register and modify timer 1
initialization e.g. from the timer example.
Regards
the Din0 is not available for interrupt. The normal case is to use the function
HW_GetDIN(). For 60 Hz this will be about 16 ms in Period so it could satisfy
your requirements. When the main loop is not blocking to much the timer
example can be used to check timer value when an edge is detected.
The Din0 is connected to pin P0.19 / CAP1.2 . See the LPC21XX datasheet.
You can use timer capture too. When Din0 is pulled to GND a rising edge is
seen at the capture pin. Configure PINSEL1 register and modify timer 1
initialization e.g. from the timer example.
Regards
--------------------------------------------
PEAK-System HW development Team
support@peak-system.com
phone: +49-6151-8173-20
fax: +49-6151-8173-29
--------------------------------------------
PEAK-System HW development Team
support@peak-system.com
phone: +49-6151-8173-20
fax: +49-6151-8173-29
--------------------------------------------
Re: Using Din0 input with interrupt?
Thanks for the hints! I'll post back here once I've had a go at it 
