退伍後趁著在找工作的這段時間又開始玩起8051了,不過每次都插版子IC拔來拔去的真的有點麻煩,索性直接弄個實驗版,再把燒錄介面改用USB燒錄,用的是AVR_Fighter這套軟體,當然51的所有腳位也接出來方便以後可以插麵包版,這樣就方便許多了。

正面


背面


燒錄器用的是USBasp,淘寶網上面買的,支援AVR和8051


只要依照下面的腳位接就可以正確的燒錄


最近有在淘寶網上看一些電子零件,突然發現露天和Y拍的東西都好貴喔,同一個MP3模組,淘寶網上面賣64RMB,而露天可以賣到650NTD,大約是兩倍的價錢,建議如果金額大的話其實可以直接在淘寶網買,速度也不慢,而且買的還是一樣的東西,說真的,淘寶網變成是我不想出門買電子零件的好管道。
如何製作能安裝Windows 7的USB隨身碟
[教學]將USB 隨身碟 製成 XP 的安裝碟 (模擬CD-ROM)
Windows 7 USB/DVD Download Tool
[Windows 7]Windows 7 USB/DVD Download Tool 讓 Windows 7 映像檔可透過 USB/DVD 安裝 Windows 7
RF無線收發模組

接收端腳位與外觀


發射端腳位與外觀


參考無線電收發模組電路製作介紹無線模組 SHY-J6122TR (ASK) 315MHz,搭配編解碼IC,HT-12D、HT-12E,不易受外界干擾。

接收端電路圖


發射端電路圖


無線收發模組必須搭配編、解碼 IC,將所設定的密碼與資料一同傳送與接收,以避免外部雜訊干擾,常用IC為HT-12,有一系列編、解碼 IC,其中HT-12D(Decoder)與HT-12E(Encoder)的主要特性如下:
(1) 應用CMOS 技術,具有省電、防雜訊等優點。
(2) 工作電壓在2V~12V。
(3) 內含振盪電路,只需外加一隻電阻即可提供工作頻率(OSC1 與 OSC2),一般而言,根據產品資料手冊建議,解碼 IC 的工作頻率約為編碼 IC 的 50倍,則編碼 IC 連接1MΩ,解碼IC 連接33KΩ即可。
(4) HT-12E編碼IC 有28 =256組密碼設定,可傳送4個位元資料。
(5) HT-12D 解碼 IC 具有 4 位元資料輸出,8 位元密碼設定,輸出資料具有栓鎖功能。

若12E的四個資料傳送腳位空接,經由RF模組傳送後至接收端則為高電位。12D的四個資料輸出腳位預設為低電位。

HT-12E編碼 IC 的接腳說明如,Pin1~Pin8(A0~A7)作為8位元=256組密碼設定,Pin10~Pin13(D0~D3)作為 4 位元資料輸入,也就是說設定一組密碼後,編碼 IC會將此密碼與資料一同傳送出去,當接收端所設定的密碼相同時,讀取 4 位元資料。
編碼 IC 的 Pin17(DATA OUT)是資料發送端,連接發射模組的 Pin6(CODE INPUT);Pin15(OSC2)與Pin16(OSC1)連接電阻產生工作頻率;Pin14(TE)為編碼致能接腳,當TE接腳為低電位「0」時,將A0~A7 所設定的密碼與D0~D3 的4位元資料進行編碼組合,由DATA OUT端以串列資料傳送出去,假如TE接腳為高電位「1」時則停止編碼與傳送,此 TE接腳狀態可由單晶片予以控制,在「無線電收發模組電路製作介紹」一文中,將 TE 接腳直接接地,使其低電位,讓編碼 IC 一直進行編碼、傳送動作。


HT-12D解碼IC的接腳說明如,同樣原理,Pin1~Pin8(A0~A7)作為8位元=256組密碼設定,Pin10~Pin13(D0~D3)作為4位元資料輸出,當發射端與接收端密碼相同時,編碼電路所傳送的 4 位元資料會顯示在解碼電路 4 位元資料輸出接腳,解碼 IC的 Pin14(DATA IN)為資料接收端,連接 接收模組的 Pin2(DIGITAL OUTPUT);Pin15(OSC2)與 Pin16(OSC1)連接電阻產生工作頻率;Pin17(VT)為解碼致能接腳,當接收電路接收到串列資料時,解碼 IC 會連續核對密碼四次,當密碼相同時,使得 VT解碼致能接腳呈現高電位「1」,並將 4 位元資料送至 Pin10~Pin13(D0~D3),密碼錯誤時,VT解碼致能接腳呈現低電位「0」,保留原始資料,也就是拴鎖功能,此 VT接腳狀態變化可由單晶片讀取,由程式判斷何時讀取4位元資料。

Development board for AT89SXXXX

This is a development board for ATMEL AT89 series or ATMEL ISP.It uses In-System Programming .Easy to use for developing your ATMEL MCS-51 base projects.

Features

# Support ATMEL AT89S series such as AT89S51, AT89S52, AT89S53, AT89S8252.(DIP 40 pin devices)
# Use In-System Programming(ISP).Low voltage programming
# RS232 X 1 .
# 5 V regulate on-board.
# No need any tools or programmer devices .
# connector for all I/O.
# Requite one PC parallel port for ISP.
# Software supports for All Windows.
# easy to build your own single side PCB.
# Require power supply from DC adpaptor 9-12VDC or AC


Fig. 1 Schematic


Fig. 2 ATMEL ISP calble

How to use ATMEL ISP.

To use this ATMEL ISP board you need to download software ISP-3v0 developed by Muhammad Asim Khan and distributed by Prof. Wichit 's website or download at the buttom on this page.


Fig.3 Software ATMEL ISP V3.0

After download software.

1. Connect ATMEL ISP cable to PC parallel port and power supply. (see Fig.5)
2. Run software ISP3.0 for Windows95/98/ME use ISP-3v0.exe and WindowsXP/2000/NT use ISP-XP.bat .
3. Select your devices from drop down list menu.
4. Click "Open file" to open hex file.
5. Click "Write" to program device.

How to use RS232 port.

To use RS232 port ,first build a simple RS232 cable.


Fig. 4 RS232 cable


Fig.5

Download schematic and PCB
2011/09/05更新:
利用這一年當兵放假的時間,有空就東摸摸西摸摸,一開始只是插麵包版,但是卻不知道什麼原因一直沒辦法燒錄,最後氣到了直接焊上去,沒想到...可以燒錄了! 至於是啥原因就不再管他了。

正面


背面


-----------------------------------------------------------------------------------------------------

Atmel 89 Series Device Programmer(Atmel 89系列的燒錄器)

Powerful programmer for the Atmel 89 series of microcontrollers that includes 89C51/52/55, 89S51/52/55 and many more. With this article you can make your own programmer. This is a complete programming solution when it is attached to a suitable power supply and connected to your personal computer. Proload and Firmware Version 4.1 at 57600 speed.


Features

* Supports major Atmel 89 series devices
* Auto Identify connected hardware and devices
* Error checking and verification in-built
* Lock of programs in chip supported to prevent program copying
* 20 and 40 pin ZIF socket on-board
* Auto Erase before writing and Auto Verify after writing
* Informative status bar and access to latest programmed file
* Simple and Easy to use
* Works on 57600 speed

Specifications

Dimensions: 76mm x 180mm (3" x 7")
Power Supply: 14-18V DC or 12-16V AC
Interface: RS-232, 9-pin D connector
Data Speed: 57600 bps, 8 bits, no parity, 1 stop, no flow control
File format: Intel 8-bit HEX
Program Sockets: 40 pin DIP - 0.6" & 20 pin DIP 0.3" ZIF socket
Software: Works on Windows 95, 98, Me, 2000, NT, XP

Introduction

Simple to use & low cost, yet powerful flash microcontroller programmer for the Atmel 89 series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase and Blank Check. All fuse and lock bits are programmable. This programmer has intelligent onboard firmware and connects to the serial port. It can be used with any type of computer and requires no special hardware. All that is needed is a serial communication port which all computers have.

All devices have signature bytes that the programmer reads to automatically identify the chip. No need to select the device type, just plug it in and go! All devices also have a number of lock bits to provide various levels of software and programming protection. These lock bits are fully programmable using this programmer. Lock bits are useful to protect the progam to be read back from microcontroller only allowing erase to reprogram the microcontroller.

The programmer connects to a host computer using a standard RS232 serial port. All the programming 'intelligence' is built into the programmer so you do not need any special hardware to run it. Programmer comes with window based software for easy programming of the devices.


Supported Devices

The table below shows the key differences between the various microcontrollers. Data sheets for each device can be found on the Atmel web site. All these devices are supported by the programmer.

Flash (Kbytes)EEPROMRAM (Bytes)I/O Pins
AT89C51 4 128 32
AT89LV51 4 128 32
AT89C52 8 256 32
AT89LV52 8 256 32
AT8C55 20 256 32
AT89LV55 20 256 32
AT89S51 4 128 32
AT89LS51 4 128 32
AT89S52 8 256 32
AT89LS52 8 256 32
AT89S53 12 256 32
AT89LS53 12 256 32
AT89S8252 8 2 Kb 256 32
AT89LS8252 8 2 Kb 256 32
AT89C1051 1 128 15
AT89C2051 2 128 15
AT89C4051 4 128 15

These microcontrollers from Atmel use flash memory to store programs. Flash memory can be electronically erased and programmed, no need for a UV eraser.

Hardware

Major parts of this programmer are Serial Port, Power Supply and Firmware microcontroller.

Serial data is sent and received from 9 pin connector and converted to/from TTL logic/RS232 signal levels by MAX232 chip. A Male to Female serial port cable, connects to the 9 pin connector of hardware and another side connects to back of computer. Serial Cable is made with 9 pin male connector to 9 pin female connector and connect pins 2,3 and 5 straight.

Power supply is attached to DC Socket, The bridge rectifies and make the polarity proper, This voltage is unregulated called VDD. From VDD the required supply are generated on board.

Hardware's central part is the firmware that makes the programmer intelligent. Firmware of this programmer is responsible to recognize inserted chip in either of the two ZIF socket. This information is sent to ProLoad on the computer. When a hex file is sent from the computer, the target MCU is loaded with appropriate address, data and control signals. After the programming of all data is finished the data written is sent to computer for verification.

Programming Software

Computer side software called 'ProLoad V4.1' is executed that accepts the Intel HEX format file generated from compiler to be sent to target microcontroller. It auto detects the hardware connected to the serial port. It also auto detects the chip inserted and bytes used. Software is developed in Delphi 7 and requires no overhead of any external DLL.



Connects to your computer's serial port (Comm 1, 2, 3 or 4) with a standard DB9 Male to DB9 Female cable. (Cable Included). Baud Rate - 57600,COMx Automatically selected by window software. No PC Card Required. Uses Intel Hex Data Format (Default output of most assemblers and compilers.)

Download

* Schematic
* Proload 4.1
* Hex file
* BOM
* PCB (pdf)

Forum for people who are facing problems with 89 series programmer is at http://www.sunrom.com/forum/

***************************************************************************
電路圖資料
想學8051有一段時間了,可惜都一直斷斷續續的,而學8051有一個最重要的問題就是燒錄器。

為了燒錄8051的晶片,所以花了不少時間上網找了一下資料,大致上有兩種方式,一種是用專用的燒錄器,要錢,所以不考慮。另一個則是利用ISP(In System Programming)方式燒錄。

Atmel公司所生產51晶片有兩種系列,一個是AT89C5X系列,一個是AT89S5X系列。而AT89C51在燒錄時必須在第31接腳VPP提供 +12V的電壓,也就是說如果要用89C5X系列的晶片就必須用專用的燒錄器,但89S5X系列則不用。

為了燒錄的問題,找了很多資料,雖然已經確定使用S系列的單晶片了,但是在燒錄方面還是有點麻煩。因為找到的資料中最簡單的燒錄方式是所謂的燒錄線(自製AT89S51單晶片燒錄器)

只要把燒錄線接在單晶片燒錄的接腳就可以進行燒錄了,雖然很簡單,但是卻是用print port,偏偏筆電上面就是沒有print port,所以燒錄依然還是問題。

之後又花了一些時間找資料,找一個比較方便燒錄的方式。

因為之前上嵌入式的課有買了一條USB轉RS232的線,所以這次打算找一個用RS232燒錄的電路。很剛好被我找到了一個還不錯的東西(89S51/52燒錄器–透過RS232及89C2051燒錄),只不過這個方式有點複雜。這個方式它必須透過另一個單晶片(AT89C2051)做轉換,而且還可以用USB轉RS232的線做燒錄。這個方法雖然可行,但是我必須先做一個AT89C2051的燒錄器將韌體燒進去才能把這個AT89C2051拿來用。即使PO這篇文章的作者也有PO一篇AT89C2051的燒錄器電路(89C2051燒錄器–用89S51實現),但是在不確定有啥問題的情況下,又加上因為實在是很麻煩所以我又把它放在一邊了。

之後幾天,我找到了一個英文網站,也是用AT89C2051來做轉換的,這讓我又有信心了。雖然兩份資料都是用AT89C2051來做轉換,但是我寧願相信外國人會比較厲害,所以我就打算參考這份英文資料(ATMEL AT89SXX ISP Flash Programmer v1.4)來動工了。

這是電路的區塊圖,利用AT89C2051當作中介,將程式碼燒到目標單晶片上。當然,AT89C2051要先把韌體燒進去。


這是詳細的電路圖。網站上提到
「The Programmer has just two ICs. IC1 = AT89C2051, IC2 = MAX 232. Few Resistors, LEDs, capacitors etc. The value of the crystal is critical and must be 11.0592 MHz.」
只需要少許的元件就能完成。


這份資料上只有電路圖、AT89C2051的韌體、燒錄軟體,並沒有AT89C2051的燒錄電路,所以我還是必須要搭配用前一個找到的資料裡面所提到的AT89C2051的燒錄器電路(89C2051燒錄器–用89S51實現)才能完成。

這是燒錄AT89C2051的電路圖。

圖中是利用89S51來當燒錄的單晶片,但是我就是因為89S51的燒錄方是很麻煩才找那麼多的資料,現在又回到原點了,真是Orz。不過這個做完之後就不用再用那種很麻煩的方式,想想也就還好了。

於是我用最先找的方法,燒錄線燒錄89S51的韌體,然後在AT89C2051當作轉換的韌體燒到AT89C2051,之後這顆AT89C2051就能用了。

原來這一切的一切都是陰謀,連做個燒錄器也像寫程式一樣充滿著迴圈。