Mon panier
0 article0,00 $US

PIC Microcontrollers - Bert van Dam

 

Download package related to the book  PIC Microcontrollers by Bert van Dam 

Download the book index here.

On this page you'll find all the software which is discussed in the PIC Microcontrollers book.

All software is free of charge, you do not have to pay anything to download and use it.

Reselling of the software is prohibited, check the license agreements for more information.

The software is intended for Windows XP, or similar Microsoft(TM) operating systems. Follow the instructions with care! Especially if this is new to you it is important to follow the steps exactly.

 

Installation instructions:

  1. Download the complete package here (click with the right mouse button, choose 'save as', the file is approximately 10 Mb).
  2. Save the package to your c drive in the root directory c:\ (Once you have verified that everything works as it should, you could move the package anywhere you want. By starting out in c:\ on the c-drive you do not need to change configuration files, everything is pre-configured).
  3. Unzip while maintaining the directory structure, (use "extract to here") you will need about 20 Mb of free space available (If you don't own an unzip program you can download one here for free. You can also go to the official website of Winzip and download a paid version.
  4. Run the setup program in the c:\picdev\vb50\setup directory (This will install some dll and ocx files required by some of the additional programs. You can accept the default directory or choose one yourself. Verify that the path is indeed c:\picdev\vb50\setup. If it isn't you have performed either step two or three incorrectly.)
    In the book the Wisp628 programmer is discussed. Meanwhile a newer version, the Wisp648, has been released. For the programs in the book it doesn't make any difference which model you purchase.
  5. If you intend to connect the de Wisp628 programmer to another port than port 1 please read the "Frequently asked questions" section for instructions (if you use port 1 you do not need to take any action, so you're done with the intsallation).
  6. Time to get started! Read the tutorial in the PIC Microcontrollers book (and discover the fascinating world of microcontrollers).
  7. Check out the Hardware section below so you can download the latest and most up-to-date versions of the datasheets directly from the suppliers. Downloading the datasheet is not a requirement to work with the book, all relevant pages are in copied in the book itself.

 

Changes, additions  

If you use the Wisp648 instead of the Wisp628 the following changes apply to you:

1. Everywhere in the book read Wisp648 instead of Wisp628.

2. Page 12: A separate stabilized power supply is no longer necessary: you can use the stabilizer of the Wisp648. The DC transformer or Wall Wart that you need to connect to the Wisp648 has to be 9..18 volt DC. If you use the built in power supply you cannot connect other power supplies to your breadboard at the same time.

3. Page 23, 346, 348, 352: The programmer dongle is no longer needed: use the jumper on the Wisp648 instead. Do remember to remove the jumper after use!

 

Page 401: Footnote 194 elsif

This footnote suggests that elsif may be used as a substitute for else if. That is correct, however the syntax is not the same, because you only need to use one single end if statement. So it resembles the case statement as can be seen in this example (courtesy Rob Hamerling):

if a==1 then
      b = 2
elsif a == 2 then
      b = 4
elsif a == 3 then
      b = 8
else
      b = 16
end if


As of July 1st 2010 the download contains a new version of JALedit. On page page 36 this text:

Hopefully it starts with:

jal 2.0.4 (compiled Aug 16 2006)
0 errors, 0 warning

Following these two lines are many others...

Should be replaced by this text:

Hopefully this ends with:

Errors :0      Warnings :0
Code   :154/8192    Data:9/368  Hardware Stack : 0/100  Software Stack :96

This is preceeded by many more lines...


Errors in the first edition:

Figure 60.

Pin 17 should be pin 24. The picture and program are correct.

 

Project 7.2.

Pin 25 should be pin 26, in the program pin c6 should be c7. The source in the download is correct.

 

Page 142: registername

The statement serial_sw_write(f877_ccpr1l) should be replaced byserial_sw_write(ccpr1l). The source in the download is correct.

 

Figure 133, 135, 138.

The arrows on pin 39 and 40 both point in the wrong direction. This is relevant only if you are not using a Wip628 or Wisp648 programmer.

 

Pagina 208: Tc calculation

Tc is correct, but the calculation is not entirely correct. The time that a pin will be high at 9766 Hz is 1/9766 = 1.02 10-4. In order to calculate the time constant for BTc8 it needs to be divided by 0.1393. So Tc = 1.02 10-4 / 0.1393 = 7.35 10-4.

 

Pagina 212: Codec

The 14th bit is number 13 (because counting starts at 0), so the correct definition of codec is:

var bit codec at value : 13

The same applies for the program itself on that same page. The program will work with the incorrect definition, but 1 out of every 14 bits (7%) will be incorrect. Due to the sound quality of BTc8 the impact is limited.

 

Hardware package

 

An overview of the required hardware for the PIC Microcontrollers book, and suppliers for these materials. Please note: all links open in a new window.

 

Using the bill of materials at the bottom of this page you can purchase the required hardware for this book. For the 16f877 you can use the A version or the non-A version. Note that you need to use the 16f877A_bert library for the A version and 16f877_bert for the non-A version. For the 12f675, 16f876A and 16f628 you cannot use other versions!

For your convenience internet shop Voti has a special hardware package for you as reader of this book, that you can order here. In it you will find a selection of parts which enable you to make a large part of the projects in the book Voti is a reliable Dutch webshop which specializes in PICs and other electronic parts. The package, a quick way to get started, contains the following parts:

1 x 16f877 or 16f877A (please note: for the de A version use the 16f877A_bert library!)
1 x socket for this PIC
1 x 20MHz crystal
2 x 20 pF capacitor
5 x 100 nF capacitor
1 x 220 nF capacitor
8 x 330 ohm resistor
1 x 2k2 resistor
1 x 3k3 resistor
4 x 10k resistor
2 x 33k resistor
1 x 1 k lin variable resistor
1 x 10 k lin variable resistor
8 x led (1 x green, 1 x blue, 1 x yellow, 5 x red)
2 x pushbutton switch
1 x LDR
1 x NTC
1 x mini speaker
1 x solderless breadboard
1 x roll of wire (6 colors)
1 x 16f628
socket for this PIC
1 x LM741
socket for this chip
1 x 100k lin variable resistor
1 x max202 or compatible 
socket for this chip
5 x 1 uF capacitor, electrolyte
1 x 10uF capacitor, electrolyte
1 x rs232 plug female
1 x UA7805
1 x 9v battery clip

 

If you want to use the programmer that is described in the book, the Wisp628 you can only order it at Voti. The owner of the shop, Wouter van Ooijen (teacher at the Utrecht University and owner of a software and electronics consultancy firm) has designed this very popular programmer himself. The programmer is not a part of the download package so you have to order is separately in the webshop. Optionally you can purchase the newer version of this programmer, the Wisp648. For the projects in this book it doesn't matter which of these two programmers you select.

 

A power supply is also not a part of the hardware package. The 9 volt clip is meant for the SkyWriter project. You can built one yourself with a kit for a Wall Wart, or buy a ready made one. Power supplies are sold in many different shops, including Voti. Whatever you buy make sure it is properly stabilized, for example with a UA7085 or similar. Note that if you use the Wisp648 programmer you can optionally use the built-in 5 volts power stablizer to power your breadboard (in that case you need a 9..18 volts DC Wall Wart). If you do then don't use a separate power supply at the same time! If you use a separate power supply (as discussed in the book) then don't use the built-in one.

 

Tip 1

Put a sticker underneath each pic with the type (including the A if applicable). This way you will still know what it is, even when the ink on top has faded.

 

Tip 2

If parts don't fit in the breadboard (for example variable resistors or speakers) solder short wires to it.

 

 

Links to manufacturers for datasheets and other information:

Please note: all links open in a new window.

 

Microchip Technology Inc (manufacturer of PIC microcontrollers and auxiliary equipment). On this website you can search and download the datasheets for the PICs that you use. Often some numbers will be replaces by an X to indicate that the datasheet describes multiple types. For example 16f87X for 16f877. Note that the A and non-A versions have some small difference. Do not purchase PIC that are not in this list:

12f675
16f628
16f876A
16f877 of 16f877A

 

Emerging Display Technologies Corporation (manufacturer of LCD displays).

 

Dallas Semiconductors (manufacturer of RS232 and memory chips). You are looking for this datasheet: MAX220-MAX249

 

Philippe (Philo) Hurbain (data of Lego motors)

 

Daventech (manufacturer of ultrasonic sensors)

 

ON Semiconductors (manufacturer of mosfets)

 

Hitachi (LCD displays). Here you can download the general datasheet. If the LCD display you purchased is compatible the datasheet will contain all relevant information. You are looking for this datasheet: Hitachi HD44780U LCD Controller

 

Bill of Materials by project (download the spreadsheet):

Special thanks to Rob Overton who color coded my Bill of Materials so you can understand exactly what projects could be constructed from the Voti kit

 

 

Frequently Asked Questions

 

Questions from readers of the PIC Microcontrollers book that could also be interesting for other people.

 

0. I have purchased the Wisp648 instead of the Wisp628.

No problem, see the section " changes, additions"  for instructions.

 

1. Is there a difference between the 16f877 and the 16f877A

Yes, but most differences are internal, so you won't notice them. The libraries however do note them, and therefore they are different. So for the 16f877 you need to use the 16f877_bert library and for the 16f877A the 16f877A_bert library.

 

2. I can't read the writing on the PIC anymore, so I don't know of it is a 16f877 or a 16f877A.

The best thing to do is put a sticker on the bottom of a PIC when you purchase it. It's a bit too late for that now, so put the following program in your PIC:

 -- JAL 2.1 
include 16f877_bert 
 
var volatile byte CMCON at 0x9C 
 
-- define variables 
var byte resist 
 
forever loop 
 
 cmcon = 7 
  resist = 0 
  resist = cmcon 
   
  serial_sw_write(resist) 
  delay_100ms(1) 
   
end loop

Start your terminal program in the PC. If you get seven as an answer the PIC is the A version, if you get a zero, it is the non-A version. The reason for this is that CMCON = 7 switches the two comparators in the PIC on. The non-A version doesn't have comparators, so the command fails. Note that in this case (as an exception!) you can use the 16f877_bert library regardless of the PIC you are testing (16f877 of 16f877A).

 

3. Is there a difference between the 16f628 and the 16f628A

Yes, only the non-A version has the variable clockspeed as discussed in section 13.2.5. There is no library in the software package for the A version.

 

4. Did Bert van Dam write other books

Yes, but most are in Dutch. The PIC Microcontroller book was originally published in Dutch also, and translated due to an abundance of requests for an English version to the publisher. More information on Bert van Dam's books (and on him) can be found here.

 

5. Is the shareware version of CoolEdit still available

Yes, you can still find it on the internet. A link is posted on the links page under "other interesting sites". You can use this program for the BTc supercompression in section 9.6.

 

6. I own Visual Basic 5.0 but some of the sources give a loading error on gauge.ocx

This is the control that takes care of the gauge in for example the voltmeter. Gauge.ocx is on the Visual Basic CD but it is not automatically installed. Download this package, unzip it, and follow these instructions:

1. Copy gauge32.ocx to a suitable directory, for example

c:\windows\system32

2. Add gauge32.ocx to the registry by executing this command (in "run" under the start button)

regsvr32 c:\windows\system32\gauge32.ocx

3. Add the development license by executing this command (in "run" under the start button)

vbusc.exe

The sources in the download package will now work. If you want to use gauges in your own programs add the ocx to your projects using 'add components'

 

7. Where should I turn to if I have questions?

Many JAL users are member of the JAL Yahoo Usergroup. Membership is free and the members are friendly and supportive. It is an international group, all communications must be in Englishhttp://groups.yahoo.com/group/jallist/

 

8. I moved JALedit to another directory and now it doesn't work anymore. The program hangs and gives strange errors. I did adapt the directories in the settings of JALedit.

JALedit can't handle long directory names or names with a space. Keep the names short and make sure they contain no spaces. This applies to the directory of JALedit itself, but also to the ones it uses, such as the directory of the libraries, JALv2, the support files, your sources.

 

9. Where can I get the most recent version of JAL.

The easiest way is to download a starterpack. This contains the latest versions of JAL, JALedit, the _bert libraries and all support files. If you use a new version make sure to use all files in the starterpack, not just upgrade an individual file. By using all files you can be sure you have a fitting and working combination.

1. Make a backup copy of the directory that contains your JAL stuff. The easiest way is to zip the directory, or copy it to a CD or USB stick. Make a note of any changes you made to the settings of JALedit (if you didn't change anything you don't need to do this).

2. Download the most recent starterpack here (the download is at the top of the page).

3. Unzip the file and distribute the contents over the appropriate directories (libraries goes with libraries etc). Overwrite any files already present.

4. Start JAL edit, and adapt the settings according to your notes of step one (if required). Compile a small test program to see if everything is still working. Keep your backup untill you're 100% sure that everything is working as it should.

5. As an alternative you can follow the instructions of the starterpack to set up a separate development environment at c:\PICjal. This is convenient when the new JAL version is not completely backwards compatible. This is the way I have done it myself.

 

10. My program doesn't compile, and I get Windows error messages.

There is a space in the name of your program, or in the path,. Keep the names short and make sure there are no spaces in them. This applies to the directory of JALedit itself, but also to the ones it uses, such as the directory of the libraries, JALv2, the support files, your sources.

 

11. I have downloaded the software package but I can't find MICterm.

In section 14.6 you will find an overview of the location of all files in the download. This way you can easily find programs that the book mentions.

MICterm is in the c:\picdev\vb50\MICterm directory. You will find both the executable and the Visual Basic sources there.

 

12. I don't want to connect the Wisp programmer to com port 1 but to another port.

Open JALedit and select the menu opties "Tools", "Environment Options","Programmer". The bottom line in this window is currently

port com1 wait err go %F 

Change the 1 in com1 to the number of the port you use. For example: if you connected the Wisp programmer to com port 4 the bottom line would read port com4 wait err go %F (note that there is no space between com and 4).

 

13. I want to simulate my programs before I put them into a PIC, is that possible?

Yes it is possible; with a program called PicShell. With this program you can write and download sources to your PIC, but you can also simulate them on-screen. Check the PicShell page regularly and download the most recent version. The program is in development but already very powerful!

 

14. The 9 volt Lego motor 71427 is difficult to find, can I use another motor?

Yes you can, many small motors can be used without difficulties. Do pay attention to the voltage of the motor (9 volts, if not you need to adapt the voltage on the 9 volt rail) and the maximum current the TC4427A can supply (1,5 A peak). Harm Schutte has tested the following motors: DC motor 1V - 12V ak-Modul MOTDC112, DC motor 3V - 9V ak-Modul MOTDC39 , both sold by www.ak-modul-bus.de and the Copal HG16-030-AA-00 motor with gearbox 6V 450 mA -Voti MOT-11 sold by www.voti.nl. He also took the pictures below of the Voti motor in action.

 

 Picture: Harm Schutte

 

And one with the QRB1134 sensor of project 7.3

 

 Picture: Harm Schutte

 

18. Which file do I need to use in the VB directory.

If you want to use the program you can double click on the file that ends with .exe If you own Visual Basic 5.0 you can modify these programs yourself if you want, in that case you need to double click on the file that ends with .vbp

   

19. I use Win 7 64 bit and now counter doesn't work.

In the tools directory you will find the WinOscillo program. This program can be used as oscilloscope and analyser (switch between these functions using F2 and F3. The analyser doesn't look as nice as counter but it does work in W7/64bit. The oscilloscope on the other hand is much nicer than the original version (which is still part of the download.

 

PIC microcontroller links

A list of locations on the internet where you can find more information, other PIC microcontroller users etc. Please note all links open in a new window.

Join in

Did you put your work on a website? Send me a message so I can add your page. Many people make their wesbites in English, but other languages, such as Dutch, are welcome as well. 

Picture: Dave Beebe (Pictures of Light project)

Groups

Many JAL users are a member of the Yahoo JAL group (recommended), and subscribed to the mailing list. This is the ideal place to discuss JAL programming, and pose questions you might have. There is a friendly and open atmosphere, also towards beginners. Please note: the group is international, the mandatory language is English!

For microcontrollers in general you can find a lot of information on the piclist. It comes with an extremely active mailing list.

The latest version of JAL V2 can be obtained at the JAL v2 homepage. The easiest way is to download the latest version of JAL however is by downloading a starterpack. This contains the latest versions of JAL, JALedit, the _bert libraries and all support files. If you use a new version make sure to use all files in the starterpack, not just upgrade an individual file. By using all files you can be sure you have a fitting and working combination of files.

 

1. Make a backup copy of the directory that contains your JAL stuff. The easiest way is to zip the directory, or copy it to a CD or USB stick. Make a note of any changes you made to the settings of JALedit (if you didn't change anything you don't need to do this).

2. Download the most recent starterpack here.

3. Unzip the file and distribute the contents over the appropriate directories (libraries goes with libraries etc). Overwrite any files already present. 

4. Start JAL edit, and adapt the settings according to your notes of step one (if required). Compile a small test program to see if everything is still working. Keep your backup until you're 100% sure that everything is working as it should. Or follow the instructions in the starterpack to setup a completely different environment.

 

Other interesting sites

 Roman Black  Kelsey Park Sports College
 Claudiu Chiculita  James Clar
 Cool Edit shareware  

CONTACTEZ-NOUS