-->
-->
Introduction
The schematic
Try the thermometer
The different
types of lists
The different
temperature scales
Various Notes
Pictures
Software packages
List of development
tools used to develop
the thermometer
List of parts used for
the thermometer
Emacs
(The editor I used to develop the software for the thermometer.)
Introduction
I got tired of the poor
memory functions of my thermometer so I built my own thermometer. I could see
the maximum and minimum temperature on the thermometer I had but I wanted to
know when those readings were recorded. So I needed the thermometer to have it's
own clock. In order to learn how to build a thermometer I had to learn about
embedded systems. So I read ISBN 0-333-92994-2 or as it's called An Introduction
to the Design of Small-scale Embedded Systems: With Examples From PIC, 80C51 And
68HC05/08 Microcontrollers. Then I chose my microcontroller (the processor) to
be an AVR device. The reason for this choice was the fact that the embedded
systems class at my university used AVR devices and the fact that the supplier
of electronics components in Sweden (where I live) ELFA didn't have any good
development boards for PIC (The book focused on PIC) microcontrollers (abbreviated MCUs (stands for Micro
Controller Unit)). This turned out to be a very good choice. Because there's a
website called
www.avrfreaks.net
. There you can get lots of help with designing and
implementing your system i.e. if you have some prior knowledge in electronics
and computer programming. It's good to use the AVR-GCC compiler because there's
a special forum at
www.avrfreaks.net
for people using AVR-GCC. There you can get even
more help. I use the WinAVR package, which uses the AVR-GCC compiler. WinAVR
contains the application Programmer's Notepad. I use Programmer's Notepad to
program my AVR-circuit. To be able to program my external target system
(external, because it's not situated on the STK500 development board) I use a
development board from Atmel, who manufactures all AVR devices, called ATSTK500
or just STK500. Debugging would have been much easier if I would have used an
emulator like the AVR-JTAG from Olimex Ltd.
www.olimex.com
or the more costly JTAG ICE from
Atmel. For my next project I'll use an emulator. To be able to solder
components, which are sensitive to electrostatic discharges you need an ESD safe
soldering station. I have the Temtronic WSD 81 from Weller. A lot of Integrated
Circuits (ICs) are sensitive to electrostatic discharges. A good piece of advice
to get things to work when designing an embedded system is to use the standard
designs from the datasheets of that specific component. There's a lot of good
information in the datasheets, so use them as your primary reference (even
though
some are over 300 pages long). For designing the schematic of my thermometer I
used Eagle
www.cadsoft.de
. Below is the
schematic I made.
The schematic
If you want to see a
larger image of the schematic, Right-click on the schematic
and choose "save target as" to
download a
larger image of it. (Internet Explorer will not show images that large.)
--> |
Regarding the potentiometer for the LCD: The schematic is not wrong. The other end of the potentiometer should not be connected to GND. It merely functions as a resistor, not as a voltage divider. Eagle also has an auto-routing feature, which enables the user to automatically create a board layout in case you want to make a PCB layout (PCB stands for Printed Circuit Board). I just used a regular general purpose Sea-of-holes PCB and lots of wiring. Even though it's not in the schematic I have jumpers on all subsystems. (Positive Power, MCU, LCD, Shift Registers, NV-SRAM, ADC, Sensor and Push Buttons) This solution enables me to measure the current consumption of each subsystem. Connect Vcc to the jumper and then take all power for that subsystem via that jumper. (Regarding the 78L05 subsystem (positive power) I have it on the GND pin.) Below is listed the current consumption of each subsystem:
Positive Power | 3.5 mA |
MCU | 7.0 mA |
LCD | 1.7 mA |
Shift Registers | 0.03 mA |
NV-SRAM | 0.05 mA |
ADC | 0.5 mA |
Sensor | 0.1 mA |
Push Buttons | 1.5 mA |
, which all together makes 21 mA. (???????) (I have a jumper on the whole system as well.) When the lists are maintained, at the very beginning of each minute, the current consumption drops to 14 mA, which is what it should be. Under extreme conditions maintaining the lists may take several seconds. (app. 5 seconds) Normally it takes app. 0.25 seconds, which is the same amount of time it takes to sample the sensor 50 times. The ADC waits 5 milliseconds between each sample. You could possibly cut it down to 3 milliseconds. If you go lower than that you're bound to get incorrect readings.
Try the thermometer
Below you can explore the
functionality of the thermometer. Click on the text in the window below. Then
continue by clicking on the alternatives of your choice, just as if you would
have pushed up, or down to get the arrows to mark a certain line and pushed
select or cancel.
The real thermometer is controlled via 4 pushbuttons:
UP
CANCEL SELECT
DOWN
The cancel menu items don't exist on the real thermometer. Neither does the hyperlink on the idle screen. Nor does the Back menu items. You press Cancel to get back. To get downwards in the menu-tree press Select. To get upwards in the menu-tree press Cancel. If the idle screen is shown and you push any button you arrive at the home menu (where settings is). An arrow at the beginning and at the end of a line indicates which line will be chosen when the SELECT button is pressed. Highlighting characters was not an option since my LCD only had room for 8 user defined characters (It's not a cheap LCD). There were no predefined highlighted characters. If you traverse down the menu tree in the inline frame above and then click the cancel option you sometimes don't get to the menu where you were before (that was too complicated)(If I have time in the future I'll make a Java Applet). On the real thermometer you always get to the menu where you were before, and the menu item which is marked as the current one is always the one you chose the last time. So if the idle screen is shown and you push a button you get to the home menu. The current menu item is >Choose list to view< (except for its marked with real arrows). If you the choose Settings followed by Cancel you get back to the home menu. But now >Settings< is marked since you chose Settings last. The different types of lists are explained below: (I only allow one new reading per day per list.)
The different types of lists
Today
Today's highest reading between 00 am and 12 pm (or so far),
Today's lowest reading between 00 am and 12 pm (or so far) and
Today's lowest reading between 10 am and 6 pm (or so far) (Added since the
lowest readings usually occurs during the nightly hours.)
Today + the past 7 days
Today + the past 7 days 8 highest readings between 00 am and 12 pm,
Today + the past 7 days 8 lowest readings between 00 am and 12 pm and
Today + the past 7 days 8 lowest readings between 10 am and 6 pm (Added since
the lowest readings usually occurs during the night.)
This month
This month's 10 highest readings between 00 am and 12 pm (or so far),
This month's 10 lowest readings between 00 am and 12 pm and
This month's 10 lowest readings between 10 am and 6 pm
2 months back
The 59-62 highest readings between 00 am and 12 pm during the past 59-62 days.
(E.g. from the 12th of May to the 11th of July, the minimum number of days in 2
months is 59 and the maximum is 62),
The 59-62 lowest readings between 00 am and 12 pm during the past 59-62 days and
The 59-62 lowest readings between 10 am and 6 pm during the past 59-62 days.
If the list would be shorter than the number of days you would experience marginal effects. (If it's colder in May than in June, but warmer in July than in June the June readings will never enter the lists since they're blocked out by the May readings. But when the May readings are out of date by the end of July (They are gradually phased out.) it won't show in the lists that it was cold in June.)
6 months back
The 181-184 highest readings between 00 am and 12 pm during the past 181-184
days.
(E.g. from the 12th of May to the 11th of December, the minimum number of days
in 6 months is 181 and the maximum is 184),
The 181-184 lowest readings between 00 am and 12 pm during the past 181-184 days and
The 181-184 lowest readings between 10 am and 6 pm during the past 181-184 days.
The past 12 months
The 10 highest readings between 00 am and 12 pm for every month of the past
year,
The 10 lowest readings between 00 am and 12 pm for every month of the past year and
The 10 lowest readings between 10 am and 6 pm for every month of the past year.
At 00:00:00 am the 1st of every month the lists of this month is moved to the proper past month
All Time
The 100 highest readings between 00 am and 12 pm since the recordings started,
The 100 lowest readings between 00 am and 12 pm since the recordings started and
The 100 lowest readings between 10 am and 6 pm since the recordings started.
The long menus are setup in such a way the if you reach the bottom and press the DOWN button you get to the top menu item. (The top menu item is marked and at the bottom, while the bottom menu item is at the top. So it's perfectly circular.). The LCD I used had 4 rows and 16 characters for each row. In the set-time-and-date menu you change entry with the select button, you increase and decrease an entry (like hours e.g.) and you leave with the cancel button.
The different temperature
scales
The thermometer can show
the temperature including all of the lists in five different temperature scales:
Celsius
(given the symbol
c
in the program code),
Fahrenheit
(given the symbol
f
in the program code),
Kelvin
(given the symbol
k
in the program code),
Rankine
(given the symbol
r
in the program code) and
Réaumur
(given the symbol
é
the program code since r was already busy).
Various Notes
Concerning the LCD & Push
Button connector (situated on the lid of the eurocard box): I saved 3 pins by
interconnecting all GND wires of the Push Buttons. So I only use 15 pins of my
2x8 connector. I could have saved one more pin by connecting GND of the push
buttons and GND of the LCD, but I was already below 16.
The sensor-in-the-sun-function is advanced. It can even handle the thermometer being mounted in a house in the southern hemisphere with the sensor being in the sun between e.g. 9pm and 3am between the 10th of November and the 1st of February.
XRAM is just an abbreviation for external SRAM.
This was the first and last project I develop without an emulator. The process of debugging was enormously time consuming.
I dropped it on the floor
once but it still works.
You control the contrast of the display by turning the knob of the
potentiometer.
The sensor was prepared
for outdoor use the following way:
First I soldered the wires, 3×2 meters of 55-408-03, to the sensor 73-088-10.
The solder joints was isolated with heat shrink tubing 55-061-00. On top of that I put glass silicon
to make it waterproof (be sure to get the silicon in
between the wires). To get the thermometer to perform well both in bright (no
direct sunlight though) and dark conditions I had to put on some aluminum foil
outer most. I cut a hole at the bottom of the aluminum foil cover so water can
seep out.
Connect the fuse in series between the +9V pin of the DC-Jack and the input pin of the power regulator. When the jumper is mounted on the OFF header the fuse is out of function.
Fuses and Lock Bits
The
lock bits
are set accordingly in the ATMega32-PI:
(The following are all checked. All others are not checked.)
Mode 1:
No memory lock features enabled
Application Protection Mode 1:
No lock on SPM and LPM in Application Section
Boot Loader Protection Mode 1:
No lock on SPM and LPM in Boot Loader Section
The
fuses
are set accordingly in the ATMega32-PI:
(The following are all checked. All others are not checked.)
Boot Flash section size=2048 words Boot start address=$3800; [
BOOTSZ=00
];
default value
Brown-out detection level at VCC=2.7 V; [
BODLEVEL=1
]
CKOPT fuse (operation dependent of CKSEL fuses); [
CKOPT=0
(programmed in other words. Fuses which are unprogrammed are set to 1.)]
Ext. Crystal/Resonator High Freq.; Start-up time: 16K CK + 64 ms; [
CKSEL=1111
SUT=11
]
Pictures
Here are some pictures from the development process
and the finished system.
(
Note
I:
To download a picture right-click on it and choose "save target as")
(
Note II:
After I took the pictures of the cheap SRAM mounted I put all of the short
white wires in a socket with turned legs/pins (circular holes for the pins
unlike the bent tin sockets) so I wouldn't have to go through the lengthy
process of putting all of the 28 wires in the right holes of the socket. After
that I had one socket stacked on top of an other one, which unfortunately led to
the holes widening. So when I put the NV-SRAM back in the socket it didn't fit
as tight as it used to.)
(
Note III:
The different colors of the solder side pictures are explained below:
Red Vcc +5V
Black GND 0V
White Data to the LCD and to the shift registers
Brown Data I/O for the NV-SRAM
Orange address bus from the shift registers to the NV-SRAM
Purple push button output from the header to the AND gate to the MCU
Purple ISP bus
Green special. Separate lines, which didn't fit any other color.)
Software packages
And
here's the software for the English version of the thermometer.
(
Note
I:
I didn't find out until very late that you could use foe->xxx instead of
*foe.xxx in C. I thought that was C++.)
(
Note
II:
The file tools contains a function ftoa, which converts floats = doubles to
strings.)
(
Note
III:
It's 5'160 lines long or 178 kilobyte of c-code. It uses 28 kb of flash
program memory.)
And
here's the software for the Swedish version of the thermometer.
(
Note
I:
I didn't find out until very late that you could use foe->xxx instead of
*foe.xxx in C. I thought that was C++.)
(
Note
II:
The file tools contains a function ftoa, which converts floats = doubles to
strings.)
(
Note
III:
It's 5'160 lines long or 178 kilobyte of c-code. It uses 28 kb of flash
program memory.)
List of development
tools used to develop
the thermometer
(Subject to any changes in
ELFA part numbers and prices. The
ELFA prices do
not include VAT or the Swedish Moms. If you don't understand my interpretations
just go to
ELFA and enter e.g. 73-666-77 in the search
box and you will get to the page of that special product. kr stands for Swedish
kronor the currency in Sweden.)
The XX-XXX-XX number is the ELFA part number. (e.g. 73-766-01)
1
pcs. 73-666-77 á
964:00
kr
ATSTK500 starter kit
AVR-PG1B
from
www.olimex.com
is a much cheaper alternative if you're just
looking for a programmer. Be aware that the AVR-PG1B uses the standard 10 pin
ISP-header (only 6 of them are used). In the schematic I used the 6 pin
header. The
STK500
User Guide
(which you should be able to find in different places on the web)
describes both headers in the section "In-System Programming of an External
Target System". (page 6-1) Just connect MOSI of the MCU to MOSI of the ISP10PIN
header, RST of the MCU to RST of the ISP10PIN header, SCK of
the MCU to SCK of the ISP10PIN header, MISO of the MCU to MISO of the
ISP10PIN header, VTG of the ISP10PIN header to Vcc of the thermometer and
GND of the ISP10PIN header to GND of the thermometer. Below is the pinout of
both headers:
ISP6PIN
1 2
MISO VTG
SCK MOSI
RST GND
ISP10PIN
1 2
MOSI VTG
NC GND
RST GND
SCK GND
MISO GND
List of parts used for
the thermometer
(Subject to any changes in
ELFA part numbers and prices. Subject to
any changes in prices at Stelios Cellar. The
ELFA prices do not include VAT or the
Swedish Moms. If you don't understand my interpretations just go to
ELFA and enter e.g. 73-666-77 in the search
box and you will get to the page of that special product. kr stands for swedish
kronor the currency in Sweden.)
The XX-XXX-XX number is the ELFA part number. (e.g. 73-766-01)
1
pcs. 73-766-01 á
261:00
kr DS1230Y-200 Sram with socket and battery
32K×8 200ns
1
pcs. 75-550-63 á
252:00
kr 16 characters by 4 rows alphanumeric LCD-display L1634-00J
Vendor Seiko
1
pcs.
73-088-10 á
79:10
kr LM 35C °Celsius temperature sensor Vendor National
Semiconductor
1
pcs.
73-385-02 á
13:40
kr LM 385
adjustable voltage reference Vendor National
Semiconductor
1
pcs.
74-515-29 á
22:90
kr Microprocessor crystal, HC49/4H, low profile, for parallel resonance
4.0000 MHz
55-254-07, 55-254-15, 55-254-23 etc. etc. Hook-up wire of as many colors as
possible. Solid condutor strand, cross section area app. 0.25 mm2
(should be about AWG 23) about 18
meters
(60 feet) should be enough. (Note: If
you order 55-254-07 from ELFA you get a reel with 100 meters of hook-up wire.
Your local supplier of electronics components may sell hook-up wire by the meter
or foot for that matter. My local supplier charged me
1:50
kr per meter for any
color.)
1
pcs. 67-008-01 á
1:63
kr 10 µF 50 V Electrolytic capacitor general purpose,
Vendor
Jamicon, type SKR
2
pcs. 67-013-12 á
1:44
kr 1 µF 50 V Electrolytic capacitor general purpose,
Vendor Jamicon, type SKR
11
pcs.
65-656-59 á
2:23
kr 0,1 µF Ceramic plate capacitor Vendor Hitano Raster metric (RM) 5 mm
(0.2" between the pins)
2
pcs.
65-848-74 á
00:873
kr 27 pF ceramic plate capacitor Vendor Hitano +-5% Raster
metric (RM) 2,5 mm (There ar no 30pF, rather less than more.) (called load
capacitors)
4
pcs. 60-734-23 á
2:41 kr 10 k
Ω
Metal film
restistors, 0,6 W Vendor Firstronics,
type RM0207S
2
pcs. 60-745-61 á
2:41 kr 100 k
Ω
Metal film
restistors, 0,6 W Vendor Firstronics,
type RM0207S
1
pcs. 60-736-39 á
2:41
kr 16 k
Ω
Metal film
restistor, 0,6 W Vendor Firstronics,
type RM0207S
1
pcs. 60-726-07 á
2:41
kr 2 k
Ω
Metal film
restistor, 0,6 W Vendor Firstronics,
type RM0207S
1
pcs. 60-729-12 á
2:41
kr 3,65 k
Ω
Metal film
restistor, 0,6 W Vendor Firstronics,
type RM0207S
1
pcs. 60-736-70 á
2:41 kr 17,4 k
Ω
Metal film
restistor, 0,6 W Vendor Firstronics,
type RM0207S
1
pcs. 60-744-54 á
2:41
kr 80,6 k
Ω
Metal film
restistor, 0,6 W Vendor Firstronics,
type RM0207S
1
pcs. 48-137-54 á
14:00
kr 28 pin 0.6" wide DIP socket with turned pins Fabr Scott Electronics
SA
1
pcs. 48-138-12 á
19:60
kr 40 pin 0.6" wide DIP socket with turned pins Fabr Scott Electronics
SA
4
pcs. 48-135-64 á
7:12
kr 14 pin 0.3" wide DIP socket with turned
pins Fabr Scott Electronics
SA
1
pcs. 48-135-49 á
4:42
kr 8 pin 0.3" wide DIP socket with turned
pins Fabr Scott Electronics
SA
1
pcs. 48-135-23 á
3:37
kr 6 pin 0.3" wide DIP socket with turned pins Fabr Scott Electronics
SA
(for the crystal oscillator and the load capacitors)
Or you could just use all bent tin sockets like e.g. 48-162-03 if your local
supplier of components sell single pieces of them. If you order 1 piece of
48-162-03 from ELFA you get 1 pipe of 17 sockets. For the crystal and load
capacitors you should probably use a socket with turned legs/pins like 48-135-23
1
pcs.
73-420-58 á
48:30
kr MCP 3204
4-channel Serial 12-bit A/D with sample and hold Vendor Microchip
1
pcs. 48-320-10 á
62:90
kr 100×160 millimeters or any other Europa Card, which
has the dimensions 100×160 millimeters. It should have solder islands and the
hole spacing should be 2.54×2.54 mm = 0.1 inch. I can't seem to find the ones I
bought. I just bought 3 of the cheapest Eurocards my local supplier had on the
shelf. (In english books they are called general purpose sea-of-holes printed
circuit boards.) I was not able to use outer most rows of holes. (see the
picture "Solder side final.JPG" in the
pictures
directory
) The two horisontal de-isolated wires are respectively the +5V
line and the GND line. Otherwise it wouldn't fit into the slots of the box.
1
pcs.
64-414-30 á
4:13 kr 1,0 k
Ω
Trimpotentiometer
Vendor Piher, type PT-6
1
pcs.
64-418-02 á
2:33
kr Axis for PT-6 Vendor Piher (turning knob)
You control the contrast of the display by turning the knob of the
potentiometer.
2
pcs. 43-717-79 á
10:60
kr
Straight
header spacing 2,54mm (0.1"), gold plated
2×10 Pins Vendor AMP, type AMPMODU ll 1-0826632-0. You only need 2×5 or 2×3
depending on which ISP header you're using and ten 2×1 headers to be able
to measure the current consumption of each subsystem. You may damage some
jumpers before you get the hang of it if you're a newbie. Use pincers and put
the jaws on each side of the header and clip it off. (see picture below)
9
pcs. 43-710-43 á
2:73
kr Jumpers spacing 2,54 mm (0.1") Blue Vendor Perlos
1
pcs. 42-051-59 á
12:60
kr Adaptor connector
(DC-jack) for circuit board mounting with pin
diameter 2,1 mm and 5,5 mm insertion plug diameter
6
meters
of 55-408-03 á
4:14
kr/meter 19 strands black hook-up wire 0.25
mm^2 free from Halogens 155 °C Vendor HUBER+SUHNER type RADOX® 155 (to connect
the sensor with the rest of the thermometer with)
2
pcs.
35-525-02 á 18:50
kr Black push button Vendor Miyama, series DS-663.
Press it in place into a hole of 15 mm diameter.
1
pcs. 35-525-36 á
18:50
kr White push button Vendor Miyama, series DS-663.
1
pcs. 35-525-10 á
18:50
kr Red push button Vendor Miyama, series DS-663.
1
pcs. 55-061-00 á
76:20
kr Heat shrink tubing FIT-300 melting inside 1.2
m/piece (4 foot/piece) Shrinking temperature: 135 °C for outdoor purposes or
where good tightness is needed. Temperature range 110 °C to -55 °C (230 °F to
-67 °F)
1
pcs. 50-268-44 á
187:00
kr Instrumentbox for eurocard (100×160 mm cards)
Vendor Teko
2
pcs. 73-527-35 á
10:10
kr 74HC164 8-bit parallell-out serial shift register
Vendor Philips
1
pcs. ATmega32-16PI á
164:00
kr (18:20 € from
Stelios
Cellar
) DIL40 8-bit AVR-RISC one chip computer with USART
Vendor Atmel
1
pcs. 69-808-17 á
97:00
kr Stabilized(regulatede output) battery-eliminator(adaptor) 9 V 1,5-3,0
W (negative center). 300 mA
2
meter
55-264-21 red Hook-up wire. 7 condutor strands, cross section area app.
0.25 mm2
(should be about AWG 23)
(Note: If
you order 55-264-21 from ELFA you get a reel with 100 meters of hook-up wire.
Your local supplier of electronics components may sell hook-up wire by the meter
or foot for that matter. My local supplier charged me
1:50
kr per meter for any
color.)
2
meter
55-264-21 black Hook-up wire. 7 condutor strands, cross section area
app. 0.25 mm2
(should be about AWG 23)
2
meter
55-264-21 white Hook-up wire. 7 condutor strands, cross section area
app. 0.25 mm2
(should be about AWG 23)
1
meter
55-264-21 green Hook-up wire. 7 condutor strands, cross section area
app. 0.25 mm2
(should be about AWG 23)
1
pcs. 73-508-12 á
6:42
kr 74HC21 Dual 4-input AND gate Vendor Philips
Semiconductor
15
pcs. 43-833-78 á
2:31
kr contact-elements for Ampmodu (for crimping. The
crimping tool for the contact-elements is very expensive. You can crimp them
with a regular pair of flat pliers. I bought a pair of cheap cord end crimping
pliers ment for auto repair. The smallest cord ends were meant for 0.50 mm2
wire, but I ended up not using tha smallest notch of the pliers. I soldered the
wire and contact-elements together first and then I crimped the isolated part of
the wire and the contact-element. The part of the contact-element, which was in
contact with the de-isolated part of the wire was full of solder and too hard to
crimp. I think the upper ends just got a little bent.)
1
pcs. 43-835-01 á
24:50
kr
Header for straight PC-mounting 2×8 pins for Ampmodu 0-0280385-2
1
pcs. 43-833-11 á
5:02
kr Receptacle-house 2×8 pins for Ampmodu 0-0280366-0
3
pcs. single á
5:00
kr Fast glassTubeFuse 50 mA 5×20 mm Vendor Littelfuse
217.050 33-100-18
1
pcs. 33-160-98 á
11:20
kr Fuseholder PTF/50 circuitboardholder 5×20 mm Vendor Stelvio Chiapponi
1
pcs. 73-001-07 á
4:12
kr Fixed positive voltage regulator 78L-series, +5 V TO92-package TS78L05CTTR
Vendor Taiwan
Semiconductor
1
pcs. 65-742-48 á
16:60
kr Ceramic plate capacitor 0,33 µF, multilayer Vendor
Kemet, type CK06BX
2
pcs. 70-008-70 á
1:96
kr 1N914 Switchdiodes,
low current Vendor Philips
Emacs
If you plan on using
Emacs to edit your files you may want to use my
.emacs-file
. (Install Emacs, create the environment variable HOME, give it
the value C:\home after first creating that
directory. Put the file .emacs in that directory. Open the Emacs editor. If you open a
C-file the code will be displayed in different colors. Look in the .emacs-file
for the altered key-bindings (Press Alt-e to open it)).
Below follows a summary of the key-bindings of my .emacs-file:
Press ctrl-z to undo a
command
(define-key global-map [(control z)] 'undo)
Press ctrl-f to open a
file or just use the menus. If you want to create a new file just press ctrl-f
and write the name of the file. (You'll havce to change the directory to what
you want it to be. Otherwise the new file will end up in C:\emacs-21.3\bin/.
When you're writing the path of the file you can press tab to complete a name.
(if you know there's only one file that starts with e.g. auto... in a directory)
If there are more files than one you will end up in a menu where you can choose
by left-clicking (I fixed that too. Before you had to mark a directory and press
return. Remember Emacs was made long before Windows even before the use of the
computer mouse got more wide spread back in 1975.)
(define-key global-map [(control f)] 'find-file)
Press ctrl-s to save a
file (It prints out where it was saved.)
(define-key global-map [(control s)] 'save-buffer)
Put the cursor in the
window you want to keep and press ctrl-w to delete other windows. Sometimes
(e.g. when you open emacs with a corrupt .emacs-file) the window is split in
two.
(define-key global-map "\^w" 'delete-other-windows)
Press esc-: to evaluate a LISP-expression (e.g. (global-set-key [(control c)] 'copy-and-show) and don't forget the parenthesis).
Press ctrl-g to cancel if you pressed e.g. ctrl-h and you want to stop
Press ctrl-h, [release and wait for emacs to print 'C-h'... at the bottom of the window], press a, type rectangle and press return to get a summary of all functions having to do with rectangles. This goes for all other functions as well. A stands for apropos. Cut, copy and paste is called kill, save and yank in Emacs-termonology.
Press ctrl-q to find and
replace. You can use it just to find a certain sequence of characters as well.
Just mark the string you want to serch for, press ctrl-q, ctrl-y to paste,
return, up-arrow (the four cursor keys)(to enter the same string again), return
and then each time a new instant of that string is found press: del to not
replace, space to replace and return to stop. Instead of pressing ctrl-y to
paste you can just type the word you want to search for.
(define-key global-map "\^q" 'query-replace)
You can cut, copy and
paste vertically in Emacs
Use ctrl-d to copy a rectangle
(global-set-key '"\^d" 'save-rectangle)
Use ctrl-r to paste a rectangle
(global-set-key '"\^r" 'yank-rectangle)
Use ctrl-b to cut a rectangle
(global-set-key '"\^b" 'kill-rectangle)
I've even fixed it so that if you mark a rectangle, copy or cut that rectangle,
mark another rectangle and press ctrl-r to paste that rectangle, the marked
rectangle is overwritten.
Windows style copy ctrl-c
(local-unset-key [(control c)])
(local-set-key [(control c)] 'copy-and-show) ; COPY-KEY.
Windows style cut ctrl-x
;;Comment out the two lines below if you need ctrl-x. (The character to comment
with in LISP is ;)
(local-unset-key [(control x)])
(local-set-key [(control x)] 'cut-and-show) ; CUT-KEY.
Windows style paste ctrl-v
(local-unset-key [(control v)])
(local-set-key [(control v)] 'paste-and-show) ; PASTE-KEY.
Mark a region or put the
cursor on a specific line and press tab to indent respectively that region or
that line.
(define-key c-mode-base-map [(tab)] 'indent-funktionen)
Display files of different types in different colors so it's easier to program
(turn-on-font-lock)
Make the del-key and backspace-key work as in windows applications
(local-unset-key [DEL])
(local-set-key [DEL] 'backspace-funktionen)
Press alt-e to open the .emacs-file
(global-set-key [(meta e)] 'load-the-emacs-file)
The file has to here:
(find-file "c:/home/.emacs")
Paste in overwrite-mode
(global-set-key [(control t)] 'tie-yank-overwrite) ;
Press ctrl-left_windows_button (the one between ctrl and alt) to switch to the
previous buffer.
(define-key global-map [(control lwindow)] 'switch-to-previous-buffer)
Press ctrl-tab to switch to the next buffer among those, which are open.
(define-key global-map [(control tab)] 'bury-or-raise-buffer)
Here's an Emacs tutorial:
http://www.lib.uchicago.edu/keith/tcl-course/emacs-tutorial.html
Or if they move that page just search for Emacs tutorial on the web. Just
remember that pressing ctrl-x as well as some other standard Emacs key-strokes
wont work. To get back the original Emacs key-bindings just make a new directory
c:\home\NewDir and move the .emacs-file there or
somewhere else where Emacs wont find it.
The contents of this website may not be used for commercial purposes without the consent of the Author. Use the information at this website at your own risk. I'm not taking any responsibilities for the trouble it may cause you or your company.
I intentionally put everything on the same page so it would be possible search the page for a string of text. Otherwise I would have to rely on Google and the other search engines scanning truogh this site, which is not very likely.