Hello jc,thanks for your answer
I now use the http://jeefiles.equi4.com/recv868ook.pde source code
with only the fs20 part.
I tried to change the sourcecode from http://www.lochraster.org/etherrape/#software
and ,use only the fs20 part;
-----------------------------------------------
fs20.h from etherr
#define FS20BETWEEN(x, a, b) ((x >= a) && (x <= b))
#define FS20SYMM(x, y, r) ( (x-y) <= r && (y-x) <= r )
/ zero is 400uS: FCPU/10^6 400 = 8000, with prescaler 128 gives 62.5 Jeelab 50
-> test if value is between 33 and 73
Jeelab board 16.Mhz = Etherrape = 20/16 =1.25
-> test if value between 33/1.25 and 73/1.25 ? /
#define FS20PULSEZERO(x) FS20BETWEEN((x),(33/1.25), (73/1.25))
/ one is 600uS: FCPU/10^6 600 = 12000, with prescaler 128 gives 93.75 Jeelab 75
-> test if value is between 74 and 105
Jeelab board 16.Mhz = Etherrape = 20/16 =1.25
-> test if value between 74/1.25 and 105/1.25? /
#define FS20PULSEONE(x) FS20BETWEEN((x), (74/1.25),(105/1.25))
/ maximal difference between two pulses is 115.2 uS,
which means 18 timer cycles with prescaler 128
Jeelab board 16.Mhz = Etherrape = 20/16 =1.25
-> test if value = 68/1.25 /
#define FS20PULSEDIFFERENCE(x,y) FS20SYMM(x, y, (68/1.25))
/ a fs20 datagram consists of 58 bits /
#define FS20DATAGRAMLENGTH 58
/ queue length /
#define FS20QUEUELENGTH 5
/ structures /
struct fs20datagramt {
uint8t p5:1;
uint8t parity:8;
uint8t p4:1;
uint8t cmd:8;
uint8t p3:1;
uint8t addr:8;
uint8t p2:1;
uint8t hc2:8;
uint8t p1:1;
uint8t hc1:8;
uint16t sync:13;
};
struct fs20globalt {
uint8t enable;
struct {
union {
struct fs20datagramt datagram;
uint64t raw;
uint16t words[4];
};
uint8t rec;
uint8t err;
struct fs20datagramt queue[FS20QUEUELENGTH];
uint8t len;
uint8t timeout;
} fs20;
uint16t intcounter;
uint16t ovfcounter;
};
/ global variables /
extern volatile struct fs20globalt fs20global;
/ public prototypes /
void fs20init(void);
void fs20process(void);
void fs20processtimeout(void);
----------------------------------------------------------
setup is changed to 128 prescaler
But ... it doesn't work ok ,it checks on sync ,even parity ,checksum
and sometimes it receives a right FS20-code,maybe because the
hardware differs 20MHz ether versus 16 Mhz jeelab ,the software
is to slow.
Do you know more FS20 sources ?,I would gladly test your extend code
with my FS20 devices. !!
Is it possible to change the crystal in a 20Mhz on the jee node
or becomes it unreliable , I now have a crystal mounted in pins
so i can change it easly.Do i have to change the Arduino
environment (serial port)?.
gr Joop