--- In [email protected], "fox_grack" <[EMAIL PROTECTED]> wrote: > > Hallo Geert > i try to understand what you write. > The source you write is it a kernel package or do you use it as an > bash script?
No, it's not a kernel package and it's not a bash script. It's straightforward c(pp) code which is compiled and transformed into an executable that is then later on run on the FoxBoard. > If it is a kernel package you have to compile it with the sdk is that right? That's correct, but that's equally correct for user space code. You have to use the SDK to compile your code (gcc/g++ is part of the SDK, since it's "tailored" to be able to compile the assembly for the Etrax processor). > The following source you write > tvTimeVal.tv_usec = 10000; /* 10ms is minimal timer tick of system */ > is a timer from the Fox-board? Well, it's not a timer from the FoxBoard. Of course, the FoxBoard is providing the clock frequency (say, speed of the processor) using an external crystal oscillator and as such is indirectly providing a "timer" to the OS (being Linux in this case). Linux needs a timebase to be able to run schedulers and so on, and that timebase is indirectly derived from the crystal that runs the processor (Etrax, in this case). The so-called jiffies (a term that is used in Linux jargon) are also derived from that. > The PCF8575 is conectet to the i2c-bus (if i read the datasheet corect) ? Indeed, that device is an I2C device. So, what happens is the following: I read out the status of all pins every multiple of 10ms. As I gave in my very first explanation, that device has 16 pins. Those pins can be polled at different times. Every pin can be assigned a polling time, which is a multiple of 10ms. So, every 10ms, I'm looking if a pin (or more) has to be polled. If so, I'm submitting some I2C communication. If not, then nothing happens towards that device and the next 10ms, I'm checking again. This goes on "forever", for as long as the application is running. Since it's running in a separate thread (that is, to me, very important to know), you can very easily do lots of other things in the mean time (do not forget that 10ms is an ocean of time for a processor)... > Sorry for so many question. No problem, hope my answers are useful to you. Best rgds, --Geert
