----- Forwarded by Michael J Mansheim/Graco on 03/15/02 05:54 PM ----- I don't know anything about this DS thingy, so pay attention to Dale's suggestions, except the comment about the missing curly brace: for (...) blob(); this will loop through and do blob each time the for loop specifies - the braces are needed if more than one function, statement, whatever is to be done: for (...) { blob1(); blob2(); } some other observations: - when you say it doesn't work, does it even compile? As Dale pointed out: > void write_ds1615_byte(DS1615OP cmd, byte adr,byte dut) should not even compile (although I know things sometimes get gnarled up when trying to post them). There were also one or more undeclared variables that should have prevented a compile. - I can't figure out what that shift_right is trying to accomplish either (it would probably help if I knew how the DS thingy worked). Since I was curious, I got this to compile and tried following along with the simulator. As written, this command (I only looked at the first one in write_ds1615_byte) goes and stomps all over other memory locations, so I'm fairly certain it's not doing what you want it to. What is it supposed to do? - the stuff after the while(TRUE) loop will never execute. > while (TRUE) > { > tost(); // Call this function > } > setup_adc_ports(NO_ANALOGS); > setup_adc(ADC_CLOCK_DIV_2); > setup_spi(FALSE); > setup_psp(PSP_DISABLED); > setup_counters(RTCC_INTERNAL,RTCC_DIV_2); > setup_ccp1(CCP_OFF); > setup_ccp2(CCP_OFF); if these commands are important to your setup, they need to go first. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.