I'm looking for a bit of guidance in getting "renard" serial protocol to work with JAL. Renard is a serial protocol for sequencing things like stage or Christmas lights. I'm a bit of a newbie to getting serial communication right.
Further below is the protocol info from http://www.doityourselfchristmas.com/wiki/index.php?title=Renard#Protocol My questions are: What is a pad byte? How should I code the escape byte? I'm guessing I look for the sync byte then use a for loop to read serial and turn on my individual outputs? Can I use the jallib slip library somehow to make this work? Also, i'm wondering if there is a "software" PWM I might be able to dim the LEDs on my pic with? At the moment I'm using an 18f43k20, but I'm flexible. Thanks! - John in WI Special Characters 0x7D - Pad byte, silently discarded by controller firmware, inserted by host PC to prevent Tx overrun 0x7E - Sync byte, start of packet marker. 0x7F - Escape byte, used as prefix for encoding dimmer levels that correspond to the special characters. To send the value 0x7D as data (rather than as a special character), send the two-character sequence '0x7F-0x2F' in its place. To send the value 0x7E as data (rather than as a special character), send the two-character sequence '0x7F-0x30' in its place. To send value 0x7F as data, send the two-character sequence '0x7F-0x31' in its place. The PICs have a rather large internal clock frequency tolerance, which could cause a transmitter overrun in a PIC which has a slow clock. This could happen under the following circumstances: 1) The host PC is transmitting characters with one stop bit, and 2) One (or more) of the PICs is using its internal oscillator (instead of an external crystal) and 3) That oscillator is running at the low end of it's tolerance (1% slow), The Renard firmware doesn't have any separate provision for transmit buffer other than the internal PIC transmit buffers. If data is arriving at the PIC faster than it can clear the UART transmitter, some data in the PIC transmitter would be over-written, causing data to be lost. The PAD byte is intended to give the transmitter in a slow PIC time to catch up. Packet Format Byte 0 - 0x7E (sync byte) Byte 1 - Command/address byte (usually 0x80, see below) Byte 2-n - Dimmer values (0-0xFF, values 0x7D, 0x7E and 0x7F have special encoding, all others are sent raw) -- You received this message because you are subscribed to the Google Groups "jallib" group. To view this discussion on the web visit https://groups.google.com/d/msg/jallib/-/uyJunMvhEcYJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
