Amberdrew Ltd wrote: > > Peter Homann wrote: > > > > Hi, > > > > I need to measure a continuous frequency between 0 - 250 cycles/MINUTE, > > and transmit it via RS-232 at 2400 baud in a message containing 6 bytes > > once 5 seconds. > > > > The PIC I plan to use is the low power 84 variant, running at 32 KHz, > > if possible. > > > > The two separate requirements are easy to implement on their own, it's > > getting the PIC to implement them concurrently that I'm having trouble > > with. I need to continue measuring the input frequency even while I am > > transmitting the output message. > > > > I'd appreciate it if anybody who has solved this type of problem, can > > give me a few pointers as this type of task, measure an input and > > transmit it must be quite common. > > > > With the PIC running at 32KHz, it is only operating at 8K instructions > > per second. Transmitting at 2400 baud, there is time for only 7 > > instructions per bit. > > > > I been tossing ideas around for a number of months now with no real > > solution comming forward. I could use 2 Pics, one to do the counting, > > the other to do the transmitting, but then I might as well use a > > faster crystal. > > > > Are there other alternatives? I may be blinkered down a set path. > > > > Any input would be great. Code fragments would be fantastic. > > > > Thanks guys, > > > > Peter. > > -- > > _______________________________________________________________________ > > Peter Homann email: peterh@adacel.com.au Work : +61 3 9596-2991 > > Adacel Pty Ltd Fax : +61 3 9596-2960 > > 250 Bay St, Brighton 3186, VIC, AUSTRALIA Mobile : 014 025-925 > > Hi, I have been working on a system that counts pulses and pulse width > using the 84 .I use both the T0 clock and INT on portB0 to generate > ints. > If you set the ints up so that an int is generated on the rising edge of > portb0 and increment a counter every time an int is generated you can > count pulses. now if you also set the clock to generate an int at a set > duty cycle you can count the number of pulses on the portb0 pin within a > set time. all of this can be done in the background and due to the > nature of the ints it is also VERY presise. > > I hope this is of some use > > Peter........ I think the problem is that the output of serial data will be corrupted by the interrupts. Peter. -- _______________________________________________________________________ Peter Homann email: peterh@adacel.com.au Work : +61 3 9596-2991 Adacel Pty Ltd Fax : +61 3 9596-2960 250 Bay St, Brighton 3186, VIC, AUSTRALIA Mobile : 014 025-925