At 01:12 AM 5/13/01 -0500, you wrote: (DMX-512 receiver/dimmer) Just some random thoughts here... as always read the data sheets and I may be mixing up *your* chip with one of the others that I'm concurrently developing stuff for... ;-) Well, if you start by trying to use the on-chip periperals.. that limits you only slightly in the possible clock speeds.. you can use 4MHz, 16MHz or even 20MHz and still run the UART at 250k baud with zero error. At 250k baud, you'll have a 11? bit packet every 2.75 milliseconds (depending on the exact spec, I'm too lazy to pull it out right now). Personally, I'd look at servicing this with an interrupt, rejecting packets for other dimmers inside the ISR, and only saving the required packets in a few bytes of RAM. You'll have to detect the framing somehow. You can do the dimmer timing with the capture/compare module. You can generate an interrupt when the comparison gets a hit, and then reset the comparator for the next time. The minimum time required here is probably 100 microseconds or so for the pulse to the gate. You'd have a RAM location holding the delay time. If we assume 8 bit resolution, that means 33 microseconds (or less, depending, resolution). You can capture and interrupt on the zero crossing, and then add the timer value to your delay time to get the next comparator value. Background processing (between interrupts) (eg. linearization error checking, stuff like that) can take place on the stored bytes, writing into the RAM location. I'd probably look at running the PIC at 20MHz for this application, though you can probably get it to work at 4MHz. The lower clock rate would lead to more jitter (probably not enough to be visually objectionable). Best regards, =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics