model-railway-devices.git
6 years agoProvide peak current since last read master
Mikko Rasa [Tue, 1 Apr 2014 10:54:17 +0000 (13:54 +0300)]
Provide peak current since last read

6 years agoVolatile is not needed here
Mikko Rasa [Tue, 1 Apr 2014 10:52:58 +0000 (13:52 +0300)]
Volatile is not needed here

7 years agoAdd command to change arducontrol baud rate
Mikko Rasa [Tue, 12 Nov 2013 14:03:03 +0000 (16:03 +0200)]
Add command to change arducontrol baud rate

7 years agoAdd function to change serial port baud rate on the fly
Mikko Rasa [Tue, 12 Nov 2013 14:01:36 +0000 (16:01 +0200)]
Add function to change serial port baud rate on the fly

7 years agoAdd a clock facility
Mikko Rasa [Tue, 12 Nov 2013 13:57:18 +0000 (15:57 +0200)]
Add a clock facility

7 years agoAvoid a race condition with the last bytes of an S88 read
Mikko Rasa [Sat, 9 Nov 2013 22:30:36 +0000 (00:30 +0200)]
Avoid a race condition with the last bytes of an S88 read

7 years agoGive each MFX command its own feedback packet type
Mikko Rasa [Fri, 8 Nov 2013 18:41:28 +0000 (20:41 +0200)]
Give each MFX command its own feedback packet type

7 years agoKeep zero speed as is
Mikko Rasa [Thu, 7 Nov 2013 23:34:35 +0000 (01:34 +0200)]
Keep zero speed as is

7 years agoAdd a delay after MFX packets
Mikko Rasa [Thu, 7 Nov 2013 23:34:04 +0000 (01:34 +0200)]
Add a delay after MFX packets

7 years agoInsert dummy zero at end of packet if last eight bits are ones
Mikko Rasa [Thu, 7 Nov 2013 23:33:24 +0000 (01:33 +0200)]
Insert dummy zero at end of packet if last eight bits are ones

7 years agoAdd support for Märklin MFX protocol in arducontrol
Mikko Rasa [Sun, 3 Nov 2013 17:41:15 +0000 (19:41 +0200)]
Add support for Märklin MFX protocol in arducontrol

It hasn't been exhaustively tested yet, but decoder registration and
function control at least works.

7 years agoMake current and voltage readings public to other modules
Mikko Rasa [Sun, 3 Nov 2013 17:08:22 +0000 (19:08 +0200)]
Make current and voltage readings public to other modules

7 years agoAdd a subsystem by which other modules can sync to the output
Mikko Rasa [Sun, 3 Nov 2013 17:05:33 +0000 (19:05 +0200)]
Add a subsystem by which other modules can sync to the output

7 years agoDrop the pretense of C89, put declarations where they make sense
Mikko Rasa [Sun, 3 Nov 2013 13:14:44 +0000 (15:14 +0200)]
Drop the pretense of C89, put declarations where they make sense

A lot of places already had mixed code and declarations, since that's
what I'm used to in C++.  Might as well use them everywhere and tell
the compiler to use C99 mode.

7 years agoMake the programming utility recognize packetized replies
Mikko Rasa [Sun, 3 Nov 2013 12:22:03 +0000 (14:22 +0200)]
Make the programming utility recognize packetized replies

7 years agoSupport chaining packets to create a larger packet
Mikko Rasa [Sun, 3 Nov 2013 09:20:42 +0000 (11:20 +0200)]
Support chaining packets to create a larger packet

MFX packets with response windows won't fit into the 256 bits available
in a single packet structure.  I'd rather keep the length field 8-bit to
preserve atomicity, and this also allows certain tricks later that would
be harder to do with a single packet.

7 years agoHide details of output packet lifecycle
Mikko Rasa [Sat, 2 Nov 2013 13:46:01 +0000 (15:46 +0200)]
Hide details of output packet lifecycle

Other modules should have no need to mess with the packet state directly.

7 years agoIncrease default overcurrent limit to 2500 milliamps
Mikko Rasa [Sat, 2 Nov 2013 12:30:31 +0000 (14:30 +0200)]
Increase default overcurrent limit to 2500 milliamps

7 years agoConnect some status leds to port B
Mikko Rasa [Sat, 2 Nov 2013 11:53:45 +0000 (13:53 +0200)]
Connect some status leds to port B

7 years agoAdd a function and command to find out if power is applied to the output
Mikko Rasa [Sat, 2 Nov 2013 11:38:48 +0000 (13:38 +0200)]
Add a function and command to find out if power is applied to the output

7 years agoMake upload device configurable
Mikko Rasa [Fri, 1 Nov 2013 13:30:42 +0000 (15:30 +0200)]
Make upload device configurable

7 years agoRemove the prototype of a debugging function
Mikko Rasa [Fri, 1 Nov 2013 12:45:27 +0000 (14:45 +0200)]
Remove the prototype of a debugging function

This was never intended to end up in the repository.

7 years agoFix S88 latching logic
Mikko Rasa [Thu, 31 Oct 2013 22:14:23 +0000 (00:14 +0200)]
Fix S88 latching logic

7 years agoUse pin change interrupt to react faster to the clock
Mikko Rasa [Thu, 31 Oct 2013 22:11:49 +0000 (00:11 +0200)]
Use pin change interrupt to react faster to the clock

7 years agoUse the new serial API in s88w-r
Mikko Rasa [Thu, 31 Oct 2013 22:08:33 +0000 (00:08 +0200)]
Use the new serial API in s88w-r

7 years agoMark module-private variables static
Mikko Rasa [Wed, 30 Oct 2013 21:59:50 +0000 (23:59 +0200)]
Mark module-private variables static

7 years agoMake arducontrol interface asynchronous again
Mikko Rasa [Wed, 30 Oct 2013 21:50:00 +0000 (23:50 +0200)]
Make arducontrol interface asynchronous again

Blocking the main loop for extended periods of time (as could previously
happen with an incomplete packet) is bad, because it prevents the monitor
from triggering overcurrent shutdown.

7 years agoSend at least four S88 data octets per packets if possible
Mikko Rasa [Mon, 28 Oct 2013 20:20:28 +0000 (22:20 +0200)]
Send at least four S88 data octets per packets if possible

Each packet has three bytes of overhead, which is pretty significant if
only a single data byte is sent.  Grouping them in larger units increases
throughput and only produces a negligible increase in latency.

7 years agoRespond to a zero-length packet with another zero-length packet
Mikko Rasa [Mon, 28 Oct 2013 20:11:14 +0000 (22:11 +0200)]
Respond to a zero-length packet with another zero-length packet

This could be useful for sync recovery

7 years agoRewrite arducontrol interface module to use the new serial API
Mikko Rasa [Mon, 28 Oct 2013 19:59:48 +0000 (21:59 +0200)]
Rewrite arducontrol interface module to use the new serial API

7 years agoExpand the serial API and add an asynchronous mode
Mikko Rasa [Mon, 28 Oct 2013 19:10:47 +0000 (21:10 +0200)]
Expand the serial API and add an asynchronous mode

This breaks any existing code using the API, since the callback macro
isn't available anymore.

7 years agoRewrite ringbuffer implementation to be interrupt-safe
Mikko Rasa [Mon, 28 Oct 2013 18:28:07 +0000 (20:28 +0200)]
Rewrite ringbuffer implementation to be interrupt-safe

The earlier version had a race condition with the fill variable, where an
interrupt might execute in the middle of increment/decrement and do the
opposite operation.  Each variable is now written to by only one end of
the buffer, eliminating the problem.

7 years agoFix a bug in interpreting Motorola commands
Mikko Rasa [Sun, 27 Oct 2013 15:36:59 +0000 (17:36 +0200)]
Fix a bug in interpreting Motorola commands

7 years agoAdd support for S88 feedback modules
Mikko Rasa [Wed, 23 Oct 2013 21:36:44 +0000 (00:36 +0300)]
Add support for S88 feedback modules

7 years agoAdd ring buffer utilities
Mikko Rasa [Wed, 23 Oct 2013 21:02:11 +0000 (00:02 +0300)]
Add ring buffer utilities

These are cropping up all over the place in arducontrol.

7 years agoMove output to a higher priority timer
Mikko Rasa [Wed, 23 Oct 2013 18:06:18 +0000 (21:06 +0300)]
Move output to a higher priority timer

7 years agoAdd functions for sending replies
Mikko Rasa [Wed, 23 Oct 2013 18:02:42 +0000 (21:02 +0300)]
Add functions for sending replies

7 years agoPass command data through a pointer
Mikko Rasa [Wed, 23 Oct 2013 17:36:25 +0000 (20:36 +0300)]
Pass command data through a pointer

This is cleaner and more flexible than the global buffer, and isn't any
slower.

7 years agoMark parameterless functions as such with a void argument list
Mikko Rasa [Tue, 22 Oct 2013 16:56:33 +0000 (19:56 +0300)]
Mark parameterless functions as such with a void argument list

7 years agoUse symbolic constants for addressing I/O pins
Mikko Rasa [Mon, 21 Oct 2013 23:17:59 +0000 (02:17 +0300)]
Use symbolic constants for addressing I/O pins

7 years agoRewrite ADC code to cause less timing interference
Mikko Rasa [Mon, 21 Oct 2013 23:15:31 +0000 (02:15 +0300)]
Rewrite ADC code to cause less timing interference

Doing divisions in ISR is bad, mkay?  The new code uses a different method
which avoids divisions altogether and is much more accurate too.

7 years agoOrganize arducontrol code by functionality
Mikko Rasa [Mon, 21 Oct 2013 20:10:35 +0000 (23:10 +0300)]
Organize arducontrol code by functionality

7 years agoImplement current and voltage monitoring
Mikko Rasa [Wed, 3 Jul 2013 16:13:56 +0000 (19:13 +0300)]
Implement current and voltage monitoring

7 years agoSomre more common facilities
Mikko Rasa [Wed, 3 Jul 2013 15:53:32 +0000 (18:53 +0300)]
Somre more common facilities

7 years agoAdd decoder programming utility
Mikko Rasa [Tue, 2 Jul 2013 14:58:57 +0000 (17:58 +0300)]
Add decoder programming utility

7 years agoAdd railway control firmware
Mikko Rasa [Tue, 2 Jul 2013 14:58:01 +0000 (17:58 +0300)]
Add railway control firmware

Only motorola protocol is supported to begin with, but further features
will be added in the near future.

7 years agoSet UCSR0A in serial_init
Mikko Rasa [Sat, 18 May 2013 15:55:21 +0000 (18:55 +0300)]
Set UCSR0A in serial_init

It contains the U2X0 bit, which must be cleared to get the desired
bitrate.  Some versions of the Arduino bootloader appear to leave it
set.

7 years agoReplace the svg schematic with proper schematics and boards made in kicad
Mikko Rasa [Mon, 13 May 2013 18:47:03 +0000 (21:47 +0300)]
Replace the svg schematic with proper schematics and boards made in kicad

There are still some references to my local files; I'll fix those later.

7 years agoFix an inline asm constraint
Mikko Rasa [Mon, 13 May 2013 17:47:59 +0000 (20:47 +0300)]
Fix an inline asm constraint

The sbiw instruction is limited to certain word-capable registers, and the
compiler needs to be informed that such a register is needed.

7 years agoReorganize the directory structure
Mikko Rasa [Mon, 13 May 2013 17:18:01 +0000 (20:18 +0300)]
Reorganize the directory structure

These were forked off the r2c2 repo since especially the s88w stuff is not
tied to it.

7 years agoStrip Id tags and copyright notices from files
Mikko Rasa [Tue, 8 Jan 2013 12:56:06 +0000 (14:56 +0200)]
Strip Id tags and copyright notices from files

The license text is now stored in a separate file.

9 years agoFix an error in s88w-t diagram
Mikko Rasa [Tue, 8 Mar 2011 10:37:32 +0000 (10:37 +0000)]
Fix an error in s88w-t diagram

10 years agoRename the project to R²C²
Mikko Rasa [Tue, 16 Nov 2010 17:53:13 +0000 (17:53 +0000)]
Rename the project to R²C²

10 years agoMake LCD output selectable at runtime through an extra I/O pin
Mikko Rasa [Mon, 15 Nov 2010 21:07:41 +0000 (21:07 +0000)]
Make LCD output selectable at runtime through an extra I/O pin

10 years agoChange the input filtering for better suitability for unreliable track circuits
Mikko Rasa [Fri, 12 Nov 2010 21:03:19 +0000 (21:03 +0000)]
Change the input filtering for better suitability for unreliable track circuits
Reduce the amount of spam sent by s88w-t
Optimize the LCD output code in s88w-r

10 years agoSupport multiple timers (currently 0 and 1)
Mikko Rasa [Wed, 27 Oct 2010 16:14:17 +0000 (16:14 +0000)]
Support multiple timers (currently 0 and 1)
Provide functions for setting timers in µs as well as Hz
Rewrite interrupt callbacks as macros that directly create the ISR
Add an async mode for LCD
Fix DDRB in s88w-t

10 years agoAdd some utility functions for interfacing with hardware
Mikko Rasa [Sat, 25 Sep 2010 08:46:20 +0000 (08:46 +0000)]
Add some utility functions for interfacing with hardware
Improve makefile to support uploading to Arduino Mini
Expand s88w protocol to support multiple transmitters
Add lcd output to s88w-r for debugging

10 years agoAdd wireless s88 firmware and schematic
Mikko Rasa [Fri, 30 Apr 2010 20:47:18 +0000 (20:47 +0000)]
Add wireless s88 firmware and schematic

10 years agoAdd a program for serial port control and associated Arduino firmware
Mikko Rasa [Sat, 3 Apr 2010 09:49:02 +0000 (09:49 +0000)]
Add a program for serial port control and associated Arduino firmware