> Dear all, are few days I'm in trouble with the following problem: > how to produce pulses bursts (from 5 portb of a 16f84 4 MHz) starting > from the same instant. > The number of pulses for each port can change from 0 to 65535, the > pulses freq can be any, the repetition rate of the bursts is 10 sec(from > an external trig). > I've tried to implement sorting routines but I realized to be too heavy, > more I tougth to produce a mask of the port in W, decreasing for 1 any > of the 5 words checking to Z and setting to 0 the relative bit in W > putting out W and more settingW to all 1s putting out it again; this > approach seems to me too time expensive. > This is a part of a project for a balloon borne experiment. > I'm sorry for my awful english, please be patient and "grazie" for any > suggestion. I couldn't follow all you were trying to say, but you can toggle a bunch of port bits at once using the XORWF instruction. If the burst only needs to be a few cycles long, you can inline a bunch of XORWF instructions and get an output frequency of oscillator/8. Longer bursts require a loop which would slow down the output frequency. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu