LINUX AT90S8515 single-chip GCC programming lights experiment documentary

zhaozj2021-02-12  221

LINUX AT90S8515 single-chip GCC programming lights experiment documentary

Tang Tiexin

I looked at the illuminated diode flashed, I was happy and jumped. Success! For a newcomer, this is too memorable.

......

In the 9CBS Forum I heard that AVR, downloaded the programmed stuff, found that there is a "AVR microcontroller GCC programming" written on Linux Focus when searching related information online, I feel that there is operability, so I associated The information is hard drive.

However, there is no AT90S4433 that runs through Guangzhou's electronic store. Only AT90S8515, what should I do? From the Internet, the introduction of the "AVR high-speed embedded microcontroller principle and application (revised)", to the bookstore, I found out that the principles of the two film downloads are the same, but the pins are somewhat different, it is better to ... ...

Hardware production:

To the electronic city bought the following Dongdong: AT90S8515 single-chip microcomputer (N-fold than OTP 51, N> 5) one, 40 foot ordinary locking socket, 30PF 2 (I found 27PF However, just, I know, the cash is 10 to 30pf), one, 4M crystal, one polyester plate, one of the DB25 parallel, single row, double row pin, one row (actually no need), resistance, I am unloading from a broken display. I didn't have 470 euros, with 100 Euro plus 380 Europe in series, I put three 1.5V batteries soldered together with the power supply.

Everything is all, let's go. According to the principle of Guido Socher in AvrledTest-0.1.tar, according to the "AVR high-speed embedded microcontroller principle and application (revised)" on the foot of AT90S8515, the schematic is heard. Very simple, I describe it: 6 feet PB5 (MOSI) series 480 European electrical blocking parallel 2 needle, 7 foot PB6 (MISO) series 220 Euro resistor parallel port 11 needle, 8 foot PB7 (SCK) series 480 Euro electric block parallel port 2 needles, 9 foot PB8 (RESET) series 480 European electrical blocking parallel 16-pin 10-pin 10 kΩ electrical attachment power supply positive (VCC), 15 foot PD5 series 1 kΩ resistance and a light emitting diode (attention direction) Power Positive (VCC), 18 foot XTAL2, 19 foot XTAL1 passed crystal vibration and coincidence capacitance (standard connection), oscillating circuit GND, single-chip 20 foot (GND), parallel port 18 pin (GND) is connected to power supply negative, single-chip 40 foot (VCC) Positive of the power supply.

Doing a board, you must have solder, soldering iron, wires, and multimeters. After doing good, check the route is wrong, use the multimeter measurement circuit throughout, resistance, capacitance is not bad, and then get it.

Software Installation:

Software I started to use the RedHat 7.0 I already have, the result is no PPDEV patch, so Redhat 9.0 (ie 7.3, Linux core 2.4.18). This redhat 9.0, I installed 5 or 6 times in my Intel 810, you don't give 810 graphics cards to 4M or more memory, Xfree86-4 Sever does not start, unlucky!

Without gxtar, you have to use Gzip, Bzip2 and Tar; all source code installations, you want; additional, use root. I don't detail the installation method, refer to Guido Socher 's "AVR MCU GCC Programming". Reminder: 1. Be sure to add / usr / local / atml / lib to the /etc/ld.so.conf file, and run the / sbin / ldconfig command to rebuild the connector cache. If you forget, you have to reload it from this step; 2, before loading AVR-LIBC-20020106, there is export cc = avr-gccexport as = avr-helpport ar = avr-limited ranlib = avr-ranlibexport path = / usr / local / atmel / bin: $ {PATH}

Several steps, use the export command to see what is the PATH setting of your environment, that is, the $ {path} here, don't directly enter the export path = / usr / local / atmel / bin: $ { Path}, knock the car, is not right, or in your root directory, display the hidden file, configure your .bash_profile file, join: / usr / local / atmel / bin path, restart the system, this is once again 3, remember, Linux is case sensitive, I decompressed UISP-20011025 under WIN, I can't make Make under Linux. It turned out that Dapa.c became dapa.c, really mad at me! Torting for a long time.

After installation, unzip avrledtest-0.1.tar because I use AT90S8515, so I deleted the avrledtest.hex and avrledtest.hex and avrledtest_pre.hex in the folder after the decompression, that is AT90S4433. Open the Makefile file with the GEDIT or other text editor, change the MCU = AT90S4433 to MCU = AT90S8515,

# Here Is a pre-compiled version in case you have trouble with

# Your Development Environment ENVIRONMENT

LOAD_PRE: AVRLEDTEST_PRE.HEX

UISP -DLPT = / dev / parport0 --rase -dprog = DAPA

UISP -DLPT = / dev / parport0 --upload if = avrledtest_pre.hex -dprog = dapa -dno-poll -v = 3 --hash = 32

# -------------------

This paragraph is deleted because I want to recompile a MCU = AT90S8515 AvrledTest.hex, if development environment has trouble, then don't finish!

test:

After getting Makefile, pick up the parallel port of the hardware to the computer, turn on the power; then open Linux's console, go to / sbin directory, lsmod looks

PARPORT_PCPPDEVPARPORT

If not, use

Insmod Parport_pcinsmod PPDevinsmod Parport

It may be that PARPORT cannot be loaded, then Insmod once. Take a look with LSMOD, determine it, go to the AvrledTest-0.1 directory, enter make

Successful, Avrledtest.hex is produced, then

Make loading

My make Load was three or four times, because my board had problems, check it for a while. My make load is successful in Console.

UISP -DLPT = / dev / parpart0 -Rase -dprog = DAPA

Atmel avr at90s8515 is found.

ERASing Device

......

UPLoading: Flash

#####

(Total 146 Bytes TransferRed in 0.68S (216 bytes / s)))

Polling: count = 145, min / avg / max = 3.00 / 3.14 / 12.08ms

OK, download it to the chip, pick up the parallel port, power off, turn it back, the film is RESET, the LED flashes. Lighting experiments successfully, you can do other experiments in the future, the AT90S8515 Flash can brush 1000 times. Cool! It is also so cheap that it can be so cheap! The simulator, the programmer is saved. (However, more than a dozen AT90S8515 can buy programmers. Develop products or use emulators, programmers).

If you can't do it, you can contact me, Netscapeer @ sina.com.cn.

转载请注明原文地址:https://www.9cbs.com/read-6119.html

New Post(0)