Hi Ashley First of all thanks for the time you take to reply to my question. >Hi Gilles > >I think your problem is the "Else" statement. >This should be in a C "Block" (surrounded by { } ). Otherwise the compiler >thinks the else refers only to the next statement which in your case is the >"output_low(PIN_B1);" You are right Ashley, we have to make a C Block around the Else. I have surrounded the needed command with the { } and everything is working well now. >This means that every time through the loop, the output_low(PIN_A3); is >being executed so there would be a very brief pulse at the output of A3, not >the intended long pulse. Hum here i dont follow you Ashley. I understand the C block around the Else, but why a brief pulse at the output of A3 if output_low(PIN_A3); is skipped, not executed ? Other thing, When a 1 is find, output_high(PIN_B1); and output_high(PIN_A3); are both executed and A3 have to be high for the delay time. and the output_low(PIN_A3); is never executed, but the output stayed low as observed with a LED ? The program work well and now i can start the PCB. Thanks again for your help Ashley. Gilles >Try something like: > >If (string[i] == '1') >{ >output_high(PIN_B1); >output_high(PIN_A3); >} >Else >{ >output_low(PIN_B1); >output_low(PIN_A3); >} > >// delay here.. > >Hope that helps, >Cheers, >Ash. > > >Ashley Roll >Digital Nemesis Pty Ltd >www.digitalnemesis.com >Mobile: +61 (0)417 705 718 > Hi > > > > I just want to make A3 an output . > > I send the same timing to A3 and B1. > > With B1 the timing is perfect, but with port A3 i have nothing ! > > > > I set the fuse, the I/O and i desable the analog as follow with PCW. > > > > #fuses INTRC,WDT,PUT,NOMCLR,INTRC_IO,NOLVP, > > #use fast_io(B) > > #use fast_io(A > > > > set_tris_a (0); > > set_tris_b (0); > > > > setup_vref(FALSE); > > setup_comparator(FALSE); > > > > I am shure that i skip something, but what. Can you help me on that ? > > > > Thanks a lot for your collaboration and excuse my English. > > > >void main() { > > > > char string [28] = "11101110100011101110100000" ; > > int i,j; > > > > set_tris_a (0); > > set_tris_b (0); > > > > setup_wdt(WDT_72MS); > > setup_counters(RTCC_INTERNAL,RTCC_DIV_2); > > setup_timer_1(T1_DISABLED); > > setup_timer_2(T2_DISABLED,0,1); > > setup_vref(FALSE); > > setup_comparator(FALSE); > > > > while(1) > > { > > for (i=0;i<26;++i) > > { > > If (string[i] == '1') > > { > > output_high(PIN_B1); > > output_high(PIN_A3); > > } > > Else > > output_low(PIN_B1); > > output_low(PIN_A3); > > //delay_ms(333); > > for (j=0;j<185 ;++j) > > { > > restart_wdt(); > > delay_ms(16); > > set_tris_a (0); > > set_tris_b (0); > > } > > } > > } > > } > > > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > >http://www.piclist.com#nomail Going offline? Don't AutoReply us! >email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu