Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

Interrupt Handling

Started by WeakDude, April 02, 2012, 12:41:55 AM

Previous topic - Next topic



I'm using Eddy-S2M/Pin with Eddy-CPU v2.0 and I would like to build a frequency meter using one of four GPIO pins. The best way to do this is to handle an external interrupt when logical one appear on one of the pins but I can't figure out how to use interrupts. Could anyone help me?

Thanks in advance.

Best Regards,

Antti Lukats

The performance would be very low.

what is your maximum desired frequency to be measured?

but I think in ALL cases its better to add external small MCU or smallest FPGA to handle the frequency and convert it to say serial or i2c for the eddy to ready out



I would like to measure a 20-30kHz square wave.

With interrupt handling, I would have to just increment some value on every rising edge of the signal.

Antti Lukats


30 KHz could be possible, but I would say only if done as kernel module, not as user space application.
It would be better to use some timer to count pulses, but this as well may still need kernel module development.

Are you developing with linux?



Unfortunately, no...

I used interrupts in ARM but without Linux. I don't have any experience with Linux kernel programming so it might be to hard for me.

It seems that best way to measure this signal is using another uC (Atmega8?) and sending result to Eddy.

On my board there are 4 GPIO Pins and RS422/485 interface (Eddy-S2M/PIN JIG - Pin-to-DB9 gender) - is it possible to connect Eddy with atmega8 through USART? (by disconnecting Eddy-S2M/PIN JIG)

Antti Lukats


I agree fully, please use some small micro of your choice, measure and send the result as maybe ascii string with terminating <CR> over uart. Trying todo it in kernel driver is way more hassle then doing it with small external mcu and using ready communication interfaces that are accessible from user space (serial ports)