Jump to content

Recommended Posts

Posted

Happy new year everyone,

 

I am working on a project where I want to control two brushed DC motors equipped with a magnetic encoder and driven by a H-bridge circuit. All this has to be done on a tiny arm board (with enough cpu power for other computations), and I decided to go for the NanoPi NEO Air. I compiled the actual mainline Kernel with realtime capability (turned PREEEMTIVE on in menuconfig, hope that's enough) and debian streched.

 

One issue might be the tight and constraining timing when sampling the magnetic encoder, which generates two 1.6kHz (about 0.6ms) pulses for each motor. I guess it would be best to get an interrupt generated at each rising edge for one signal/pin. The second signal indicated the direction of the motor and can get read within the interrupt routine. All this has to be done two times because of the two motors. So does anyone know if this is possible on the NanoPI with RT Linux?

 

On the other side I am just looking around what ways there are to access the GPIO pins and found several like WiringNP (aka WiringPi and others), wiringX, GPIO via SysFS, and maybe others. I prefer writing my application in ansi C ... so which way to access the GPIOs would you recommend?

 

I appreciate every feedback.

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines