How to move from 8051 to ATMega (easily)
This project consists of a mezzanine that permits to use an ATMega DIL28 to replace a 8x51 (8751, 8951, RA2 ...) on a board.
I have many hardware (inside boxes) at home that perform home automation, they are most of them based on a old but very clever microcontroller (I mean the 8051). Of course I could redesign a new PCB to move to ATMega but as the analog sub systems work perfectly, I decided that replacing only the microcontroller is easier and quicker.
J'utilise à mon domicile plusieurs systèmes pour des fonctions domotiques au sens large. Ceux ci sont principalement basés sur un vieux mais très intelligent processeur (le 8051). Bien sur j'aurais pu re-concevoir une carte pour ATMega mais comme les parties électronqiues fonctionnent parfaitement, j'ai décidé que remplacer le microcontroleur était plus simple et plus rapide.
The 8051 has 32 I/Os (8 bits P0, P1, P2 and P3), but the ATMega has only 20 I/Os so I use a PCF8574 to get 8 more I/Os. As 20+8 means only 28, what about the 4 other pins ? Well first of all, if you decide to use the internal clock of the ATMega you can get 2 more I/Os.
In my case I modify a little bit the mother board to move the LCD connections from a 8 bits interface to a 4 bits interface.
For this board you need only an ATMega (on the pic ATMega168), a PF8574 (A or not), a BC547 to invert the reset line and some resistors and caps (most hidden below the DILs).
The most interesting job is now to update your software ... do not hesitate to contact me about that.
J'utilise à mon domicile plusieurs systèmes pour des fonctions domotiques au sens large. Ceux ci sont principalement basés sur un vieux mais très intelligent processeur (le 8051). Bien sur j'aurais pu re-concevoir une carte pour ATMega mais comme les parties électronqiues fonctionnent parfaitement, j'ai décidé que remplacer le microcontroleur était plus simple et plus rapide.
The 8051 has 32 I/Os (8 bits P0, P1, P2 and P3), but the ATMega has only 20 I/Os so I use a PCF8574 to get 8 more I/Os. As 20+8 means only 28, what about the 4 other pins ? Well first of all, if you decide to use the internal clock of the ATMega you can get 2 more I/Os.
In my case I modify a little bit the mother board to move the LCD connections from a 8 bits interface to a 4 bits interface.
For this board you need only an ATMega (on the pic ATMega168), a PF8574 (A or not), a BC547 to invert the reset line and some resistors and caps (most hidden below the DILs).
The most interesting job is now to update your software ... do not hesitate to contact me about that.
Updates van de auteur