I started a project to program a custom i2c chip to the Raspberry Pi. This way it should be possible to put a few different functions on the same chip thus reducing the number of components on the external PCB. The PIC12F675 seems to be easily available for the hobby builders and is not too expensive. I have no previous experience on these micro-controllers and I find the programming a little laborious. I have kind of "nanoPLC" now that works somehow. Thanks to holden and tlc for the PIC programming interface.
If anybody is interested the repository is in
https://github.com/oh7bf/PiPIC/wiki