Saphum

Recent Posts

  • June 08, 2008

    RS232-to-RS485 Converter

    Since my Ifos project relies on Modbus over RS485, I needed a simple way to interface to an RS485 network from my PC during development.Here’s a simple single-chip converter based on the MAX3162. A DB-9F connects to the serial port on the PC...

  • February 08, 2008

    Tiny Modbus Master in Ruby

    Here’s a tiny Modbus master in Ruby that supports ASCII and RTU1 modes for all function (and subfunction) codes defined in the MODBUS Application Protocol Specification V1.1b.Serial port handling in Ruby is provided by Guillaume Pierronnet&r...

  • February 08, 2008

    Framerate Timing Resolved

    I solved my timing issue, but I have to admit, I’m still confused as to exactly what caused it.My basic timing functions rely on an asynchronous wallclock with millisecond resolution. I implement this using Timer 0 in 16-bit mode, setting its init...

  • February 06, 2008

    Framerate Timing

    I’ve been trying to track down an annoying timing issue in my main loop.My target is 20 frames/second (capped), which means 50ms between frames. I start a 50ms countdown timer at the beginning of the main loop, then process messages in a tight loo...

  • January 29, 2008

    RS-485 Line Biasing

    Finally tracked down the source of my RS-485 communication problems, manifested by slave responses containing spurious characters, dropped entirely, or garbled beyond recognition. Server commands were always fine; data was complete and checksummed...