A minor code revision as I slowly get everything working properly. I am adding new modules as I need them for other projects.
The latest GenPIC deployed will be a coolant valve controller that allows remote control of some glycol valves in the AO bench. It is a pretty simple device, just four relays with some automatic timing rules and a serial control interface.
In the process I added support for the service connectors including parallel and simple serial modules to the GenPIC code base, may as well release it. Thus you get code release 0.2…
I have had hardware for a while now, it is about time I release some firmware that actually runs it.
Here it is!
The first GenPIC code revision is a test and demonstration release. It contains support for one serial port, an LCD character display, user input including the encoder and pushbuttons, the indicator LED’s, timer generation, analog input including onboard temperature readout.
Also included is a serial command interpreter implementing a serial interface usable with any serial terminal. There is also a user interface system with a state setup that provides multiple input screens. This should handle a wide array of basic control capabilities, either using the serial port or through using the LCD screen and the encoder.
The code allows you to exercise many of the basic functions of the hardware and provide a framework on which a real application can be built.
It works, it runs, it looks fairly good. Now time to make something useful with it…
The rotary encoder is a popular input device for many microcontroller devices. A knob that can be used to increase or decrease a setting with a nice tactile click for each increment. You can even get an integral pushbutton, just rotate for the setting then press the same knob to enter. With some clever programming you can create a one device user interface using only the encoder.
I have integrated a rotary encoder in the GenPIC utility board. With the combination of an LCD display and the rotary encoder you have all the ingredients for a functional user interface arranged neatly for a panel mount unit.
In the past I have simply set an interrupt to fire on the edge of one channel, then sampled the opposite channel to detect the direction. With the addition of a small delay to debounce the result. This worked well in previous devices, but this time I encountered trouble, the direction sampling was erratic, the value going up when it should have gone down and vice-versa.
Breaking out my logic analyser I found out why, this particular encoder proved to be somewhat noisier than I had seen in the past, with notable periods of bouncing signals.
You may have noticed that DarkerView got hacked back in late March. Somehow malicious files were inserted that sent search traffic to various less than reputable websites, of course that means mostly sex sites. Sorry about that.
Only search traffic was affected, those who went directly to the site saw the correct webpage, thus I did not notice right away as I use direct links. As a side note, getting hacked does result in a huge spike in traffic volume, that was the first sign. This sort of hack is apparently called conditional redirect hack, essentially borrowing a reputable website’s reputation with the search engines to send traffic towards certain websites.
As a result I have been tightening up security around here. Removing some old plugins, changing things around and checking for known vulnerabilities. One thing you will soon see is that the old theme will be replaced for an entirely new look for DarkerView.
The old theme is just that… old. Also probably insecure as there has been no maintenance on it in years. As I really do not know how the attacker got in I need to look to everything that could have been the weakness. Time to update the look and update the code to something that is modern and supported.