Hi Dietmar,
I need to send a guaranteed 5ms break signal to the serial port (PLC
communication). In user space I don't get always 5ms, so I would like
to use a timer (0/1) in kernel space (or another solution). I saw that
you were able to get a 10kHz frequency, is it possible to share that
code with me (pls also the makefile) ? (My fox is extended with FOXZB)
this is my code:
#define DIFF_MICROSEC(x,y) ( y.tv_usec - x.tv_usec )
do
{
gettimeofday(&t2,NULL) ;
} while (DIFF_MICROSEC(t1,t2) < microsec);
PS maybe I send this message more then once ... but I had some
problems with joining this newsgroup ...
Regards,
Erwin
--- In [email protected], "horvat.johann" <[EMAIL PROTECTED]>
wrote:
>
> Dear Dietmar,
>
> Writing drivers isn't a problem. I worked with RTAI and RTLinux/GPL
> before and wrote some rt modules.
>
> I tried to install RTAI, but didn't get a working system.
>
> My application doesn't need the rest of the system, so the fox board
> is degraded to be a stupid oscillator application, which frequency
may
> be altered by users.
>
> I read the ETRAX 100LX documentation. There seems to be a timer0 and
a
> timer1:
>
> [...]
> Timer Interrupts
> ----------------
> There are two timer interrupts, one each for timer0 and timer1.
>
> timer1
> This interrupt is set whenever timer1 reaches its terminal count. It
> is cleared by setting the i1 field in R_TIMER_CTRL.
>
> timer0
> This interrupt is set whenever timer0 reaches its terminal count. It
> is cleared by
> setting the i0 field in timer register R_TIMER_CTRL.
> For more information about ETRAX 100LX interrupts, please refer to
> chapter 18 Interrupts.
> [...]
> taken from the ETRAX 100LX Designer Guide from Axis.
>
> So i thought to write a driver using tghis timer(s)?
>
> Thanks and
> best regards
> Johann
>
> --- In [email protected], "dietmar.dreyer33"
> <dietmar.dreyer33@> wrote:
> >
> > Hello Johann!
> > I guess the only way to get millisecond scale resolution is using
the
> > second timer of the etrax processor in a kernel module. I wrote a
> > driver that's polling input pins at a frequency of about 10 kHz,
using
> > the second timer. It needed a recompiled kernel (disabling of
> > fasttimers to get a free interrupt), but wasn't that difficult
after
> all.
> > If writing a kernel driver is an option to you, I can give you
some
> > example code for accessing io in an interrupt service routine.
> >
> > Best regards
> > Dietmar
> >
>