i'm new ... and i'm starting now with xc programming. I have an XC-1A development kit ... i want to depth understand how threads work. In particular i wrote a code that rises up three pins: X1D0, X2D0, X036 and X038 with separate threads. The code is the follows:
Code: Select all
#include <platform.h>
void riseUp( out port pp1);
on stdcore[0] : out port p3 = XS1_PORT_1O; //PIN 38
on stdcore[0] : out port p1 = XS1_PORT_1M; //PIN 36
on stdcore[1] : out port p4 = XS1_PORT_1A; // X1D0, PIN 1 X1portA
on stdcore[2] : out port p6 = XS1_PORT_1A; // X2D0, PIN 1 X2portA
int main(void) {
par{
on stdcore[0] : riseUp(p3);
on stdcore[0] : riseUp(p1);
on stdcore[1] : riseUp(p4);
on stdcore[2] : riseUp( p6);
}
return 0;
}
void riseUp( out port pp1){
pp1<:1;
}
https://picasaweb.google.com/lh/photo/H ... directlink
The three separate threads should not start at the same time?