-
Description
-
Register map
-
Schematic
-
Simulation
-
Goals
-
Wetware at work
### Description
A Modbus and push-button controlled 4-channel PWM generator based on the Atmel ATMega 328. Each channel can be set to one of four pre-defined duty cycles (0-255). In addition to being controllable by Modbus commands, the channel levels (0-3) can also be selected by means of individual push-buttons, wich increment a channel's level, wrapping at 3. The active level for each channel is output as a 2-bit value which is used to drive a set of four LEDs by means of a 74HC138 decoder. The idea is to allow for remote control of the individual channels over a three-wire interface (plus GND and VCC). The Modbus communication layer is provided by the
yaMBSiavr library. The code compiles to less than 8kb.
*N.b. this is very much work in progress and many planned features are yet to be implemented - see
goals.*
### Register map
Putting a 1 into the last register (currently 50) will trigger a write to EEPROM of all register values.
![Registers](https://raw.githubusercontent.com/clickworkorange/Atmel-PWM-RTU/main/Registers.png)
### Schematic
A KiCAD schematic can be found in the /AVR-PWM-RTU folder.
![Schematic](https://raw.githubusercontent.com/clickworkorange/Atmel-PWM-RTU/main/Schematic.png)
### Simulation
Included is a Simulide project which runs the Atmel C code and simulates the control panels:
![Simulide](https://raw.githubusercontent.com/clickworkorange/Atmel-PWM-RTU/main/Simulide.png)
### Goals
* Design a PCB from the KiCAD schematic
* Enforce limits on register values and validate input parameters
* Make slave address & comms parameters settable through Modbus registers
* Incorporate a reset button to return the EEPROM to factory defaults
* Make PWM phase and frequency (or scaler) settable through Modbus registers
### Wetware at work
Resistance may indeed be futile, and I for one welcome our new software based overlords - who I'm sure are paying close attention. But this software was written by a *human*, and only humans can enjoy writing code. Perhaps that joy by itself will one day be seen as an act of
resistance?