Linux AT90S8515 Single Chip Microcomputer GCC programming lighting experiment documentary

Source: Internet
Author: User
Linux AT90S8515 Single-Chip GCC programming lighting experiment documentary-Linux general technology-Linux programming and kernel information, the following is a detailed reading. Watching the Light Emitting Diode flash, I'm so happy. Success! For a newbie, this is the first time that we will never forget.
......
I have heard of avr in the csdn forum and downloaded programming and other things. When I searched for related information online, I found a Linux focus article titled "AVR SCM GCC programming" written by Guido Socher. I felt it was operable, so I moved the relevant materials and software to the hard disk.
However, all electronic stores in Guangzhou could not find AT90S4433, but AT90S8515. What should I do? I can see the introduction of "Principle and Application of AVR high-speed embedded single-chip microcomputer (revised version)" on the Internet. I found that the programming principles for downloading two films are the same, but the pins are somewhat different, it's better ......

Hardware production:
To electronic city to buy the following stuff: AT90S8515 single chip microcomputer (more than 51 parts of the OTP expensive n times, n> 5) One, 40 feet ordinary lock socket one, 30pf Ceramic Capacitor two (I can't find 27pf, but as far as I know, use 10 to 30pf for vibration), a 4 m crystal oscillator, a polyester board, and a DB25 port, single-row and double-row pins (in fact, you don't need to use them). The resistors and LEDs are removed from the broken display. Resistance I do not have 470 Euro, with 100 euro 380 series instead (in fact, 250 to 700 can, generally 470), I connected three 1.5V batteries with wires welded together for power.
Everything is done. Let's get started. According to the schematic diagram of Guido socherin avrledtest-0.1.tar, according to The AT90S8515 pin in "Principle and Application of AVR high-speed embedded single chip microcomputer (revised version)", the schematic is re-drawn. It's easy. Let me describe it: 6-pin PB5 (MOSI) is connected in series with 480 euro resistance and 2-pin, and 7-pin PB6 (MISO) is connected in series with 220 euro resistance and 11 pins, 8-pin PB7 (SCK) series 480 euro resistor connected parallel port 2-pin, 9-pin PB8 (RESET) connect the 480 euro resistor to the parallel port and connect 10 thousand euro resistor to the positive pole (VCC), 15 feet PD5 Series 1 thousand euro resistor and a light emitting diode (attention direction) rear Power Supply positive pole (VCC), 18 feet XTAL2, 19 feet XTAL1 connected crystal oscillator and vibration capacitor (standard method), oscillating circuit GND, microcontroller 20 feet (GND) and the parallel port 18-pin (GND) is connected to the power supply negative pole, and the single chip microcomputer 40-pin (VCC) is connected to the power supply positive pole.
Make a board, you must have things such as soldering tin, soldering iron, wire and multimeter. After the installation is complete, check whether the line is correctly connected. Use A multimeter to test the connection failure, and check whether the resistance and capacitor are damaged.

Software installation:
I started to use my existing Redhat 7.0, but I didn't have the ppdev patch, so I installed Redhat 9.0 (7.3, Linux kernel 2.4.18 ). This Redhat 9.0, in my intel 810 installed 5, 6 times I understand, you do not allocate more than 4 m memory to the 810 graphics card, Xfree86-4 Sever it can not start, unlucky!
If you do not have gxtar, You need to decompress it with gzip, bzip2, and tar. Both are source code installations and you need to. In addition, you need to perform operations as root. I will not elaborate on the installation method. Refer to Guido Socher's "AVR SCM GCC programming". Note: 1, after installing the binutils-2.11.2 must add/usr/local/atml/lib This line to/etc/ld. so. in the conf file, and run the/sbin/ldconfig command to re-build the connector cache, if you forget, you need to re-install it from this step; 2. Before installing the avr-libc-20020106, there are
Export CC = avr-gcc
Export AS = avr-
Export AR = avr-ar
Export RANLIB = avr-ranlib
Export PATH =/usr/local/atmel/bin: $ {PATH}
A few steps: Use the export command to see what path is set in your environment, that is, what $ {PATH} refers to here, do not enter export PATH =/usr/local/atmel/bin :$ {PATH} directly and press Enter. That's not correct, or go to your root directory, display the hidden file and configure your. in the bash_profile file, add the/usr/local/atmel/bin path to restart the system. This is done once and for all. Remember that Linux is case sensitive, I unzip the uisp-20011025 under Win, to Linux can not make, the original DAPA. C is changed to dapa. c. I am so angry! After a long time.
After the installation, decompress avrledtest-0.1.tar, because I use AT90S8515, so, the unzipped avrledtest-0.1 folder avrledtest. hex and avrledtest_pre.hex deleted, that is AT90S4433. Open the makefile file in Gedit or another text editor, change MCU = at90s4433 to MCU = at90s8515
# Here is a pre-compiled version in case you have trouble
# Your development environment
Load_pre: avrledtest_pre.hex
Uisp-dlpt =/dev/parport0 -- erase-dprog = dapa
Uisp-dlpt =/dev/parport0 -- upload if = avrledtest_pre.hex-dprog = dapa-dno-poll-v = 3 -- hash = 32
#-------------------
This section is deleted because I want to re-compile avrledtest. hex of MCU = at90s8515. If development environment is in trouble, it cannot be done!

Test:
After makefile is completed, connect the parallel port on the hardware to the computer print port and power on the computer. Then, open the linux console and go to the/sbin directory. lsmod can see if there is any
Parport_pc
Ppdev
Parport
If not, use
Insmod parport_pc
Insmod ppdev
Insmod parport
In this case, parport may not be loaded, and then insmod again. Use lsmod to see, OK all loaded, go to the avrledtest-0.1 directory, enter
Make
If it succeeds, avrledtest. hex will be generated, and then
Make load
I made the load three or four times. I checked the load for a while because my board was faulty. When I make load successfully, the screen appears in the console.
Uisp? Dlpt =/dev/parpart0? Erase? Dprog = dapa
Atmel AVR AT90S8515 is found.
Erasing Device
......
Uploading: flash
#####
(Total 146 bytes transferred in 0.68 s (216 bytes/s ))
Polling: count = 145, min/avg/max = 3.00/3.14/12.08 ms
OK, download to the chip, take the parallel port, power off, re-connect, the film will be reset, the Light Emitting Diode flash. After the light-on experiment is successful, you can do other experiments by yourself. The flash of AT90S8515 can be refreshed 1000 times. Cool! The original single-chip microcomputer experiment can also be so cheap! Simulation machines and programmers are all saved. (However, a dozen pieces of AT90S8515 or more out of the money, you can buy a programmer. To develop a product, you must use a simulator or programmer ).

If you can't do it, you can contact me, netscaner@sina.com.cn.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.