MCS51

Many times, I share my idea in Thai journal book. Since 2002, I have used microcontroller based on MCS51, I think it is easy to begin and learn. Now a day, the semiconductor companies like microchip, analog device, Motorola etc, their build the solution with high performance device. There are so many types until I can’t study all at the same time, but intend to learn all step by step.

For this page, I can’t show my MCS51 project for this entire page, because long page. November 2004 and January 2005, this project was top hit. It is about recycle IDE-CDROM to play audio compact disc.

Overview

I see old ide cd-rom from second hand computer shop, the price is surprisingly cheap. I prompt the idea to recycle all these old CD ROM. I was thinking ‘what to say if u can make the player to use these old CDROM’. With the intention, I started to learn ATAPI and discuses with one of my good friend, “K.Sakda”. He gave me the circuit and some details for interfacing with CDROM. At the same time, I learn more documents regarding ATAPI. And make hardware for test.

Hardware

The CPU, I have two CPU on board, one CPU (AT89C52) connect direct to CDROM and one CPU (AT89C2051) control switch and get values from remote control. The bottom switches for stop, play, forward track, reverse track and etc. To make it user friendly, I make it compatible to the Sony remote control, which means you can use the Sony Audio infrared remote control to play this project.

Firmware

Based on AT89C52, Why I use that one, because I need internal memory more 128 Bytes. AT89C52 has 256 bytes RAM. This internal memory is used to store track information. One track consumes 3 bytes, so if Audio CD have 99 Track, it mean (99*3=297 byte), it seems like the memory is not enough, however, the normal audio CD is not over 50 tracks, they likely contain around 20 tracks. The remained RAM is used for the calculation variable storage like calculate remain time and etc.


Overviews

It is simple to learn about the smart card interface. For this application, I try to introduce “what smart card” and “How to get data from the card” the standard protocol of smart card have two types, Synchronous and Asynchronous . For Asynchronous it are microprocessor, the asynchronous protocol is a bit complicated and this will be discussed in out next topic.

Now I would like to share the knowledge of synchronous protocol. This protocol very easy from the view of interfacing the card, the example I have is interfacing to the telephone card with SLE4436 chip. The example basically to get serial number, credit value in chip, expiry date of card. It is quite simple to know.

The hardware uses mcs51 core. AT89C2051 the circuit interfaces to smart card socket and connect to LCD and Serial RS232 interface.

Software

You can learn more from my source code. After plug power supply on board, it will wait for card insert. The software will verify card type and get the information on card and calculate to show serial number of card and price values.

The info is shown on LCD display and sent to RS-232. You will just need to run the application like hyper terminal or similar software on your PC. The port setting should be baud rate 9600, none parity, eight bit data and one stop bit

No comments: