Using the port F as digital I/O in Teensy++

I wanted to use the port F in Teensy++ board as ordinary digital inputs/outputs and it turned out that there is an extra step involved to ordinary DDR stuff. I’m coding using the Teensy port of core Arduino libraries to AT90USB646 chip. After checking the chip datasheet, I found that the proper port initialization includes setting the DIDR0 register (setting desired pins of port F to digital instead of analogue). So the full initialization should look like

The homebrew AVR-based PLC – the introduction

Few years ago when I was searching the net for similar projects to gather some stuff for my potential graduate thesis, there was just a plain void. On techie forums ocasionaly some excited novice popped up with greeny questions about what would take to make a PLC, etc., just to get a bunch of “smart” answers about how stupid one has to be for trying to make something that someone somewhere can eagerly sell him. Not much useful, indeed. Sure, people wrote about projects and “PLCs” they’ve made, but almost all of them were just a kind of a relay board with a MCU attached to it – far from being something like the real thing.