By:
Category:
Comments Off

PIKLAB + PICkit 2

I am making some progress on trying to get PIKLAB to program my 16F628A under Ubuntu.

I decided to install PIKlab on my Linux Netbook (Ubuntu 9.10 32bit) and compare the results with my desktop (running Ubuntu 10.4 64bit.) Sure enough there is a difference.

On Ubuntu 9.10 I have PIKLAB v0.15.4 installed which has support for the PICkit2 firmware v2
On Ubuntu 10.4 I have PIKLAB v0.15.7 installed with has support for PICkit2 firmware v1

The newer version of PIKLAB on the newer version of Ubuntu does not support the newer PICkit with v2 firmware. Whatsup' with that?

My Netbook (with Ubuntu 9.10) seems to be able to talk more with my programmer than my desktop but it is still not working properly. When I reboot my Netbook over to XP it programs the PICkit2 just fine.  --argh.

Messing with the programmer eats up time that could be spent writing code and working on schematics. (I should be working on my keyer software for the QRSS rig.)

73 de NG0R

By:
Category:
Comments Off

Hello world with the PIC!

As much as I wanted to dump the hex file into the PIC 16F628A using my Linux PC I decided that I would try to dump it from my Netbook which dual boots between Ubuntu and XP. Sure enough I had problems getting this work in XP as well. It found the programmer on the USB port right away just like Linux did but the software was problematic. --Argghhh

I ended up loading the PICkit 2 programmer from Microchip which required .NET to be installed on the Netbook  under XP.  (It has been a LONG time since it was dual booted to XP)

I wrote some really bad code to do a quick hello world with the LEDs on my demo board. I am using the eval of Mikro Basic compiler.


The code is pretty simple. I initialize the Port B bus, tickle the pins, and then loop through once a second turning ports RB1 and RB3 on and off in alternating fashion.

I will need to spend some time troubleshooting why I am having so much trouble getting these loaders to work properly. In the mean time I am now able to write code and push the hex files into the PIC.

Thanks to my buddy Mike W in Connecticut for helping to get me going. He is playing with an 16F877 for his robotics projects.

Now the real adventure begins... I need to start writing real code for this little beast and swimming in the deep end.

73 de NG0R

By:
Category:
Comments Off

PICkit2 Ubuntu Blues

I thought that I would try one more idea before dinner.
http://sync-signal.com/2010/01/getting-started-with-pickit2-on-ubuntu-9-10/

So I downloaded the PK2CMD utility for MAC/Linux from the Microchip website.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en023805&redirects=pickit2

Next I extracted and moved the files into place:
tar xzf pk2cmdv1-20Linux2-6.tar.gz
cd pk2cmdv1-20Linux2-6

sudo cp pk2cmd /usr/bin/
chmod -x PK2DeviceFile.dat
sudo cp PK2DeviceFile.dat /usr/bin


Let's try to do something:
pk2cmd /PPIC16F628 /Fc:PK2V023200.hex /M

Hmmm...permissions issues again:
sudo pk2cmd /PPIC16F628 /Fc:PK2V023200.hex /M
sudo pk2cmd /PPIC16F690 /Fc:PK2V023200.hex /M

Ok... that gets around the permissions issues but reveals a new issue:
PICkit 2 found with Operating System v2.01.00
Use -D to download minimum required OS v2.32.00 or late
r


Arghhh..... it appears that it wants me to upgrade the Microcode on my two programmers.

I am taking a break and going to go eat dinner with the family an ignore this for a while. Back in a bit.

By:
Category:
Comments Off

PICkit2 Ubuntu Blues

As I try to work through this initial configuration here is some more dedug info:

sudo lsusb

Bus 007 Device 003: ID 04d8:0033 Microchip Technology, Inc. (PICkit 2 + 16F690)
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 003: ID 04d8:0033 Microchip Technology, Inc. (PICkit 2 clone + 16F628A)
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 014: ID 046d:c00c Logitech, Inc. Optical Wheel Mouse
Bus 005 Device 003: ID 049f:0083 Compaq Computer Corp.
Bus 005 Device 002: ID 0557:7000 ATEN International Co., Ltd Hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 007: ID 0fca:8004 Research In Motion, Ltd. (crackberry)
Bus 003 Device 006: ID 059b:0370 Iomega Corp. (1tb USB drive)
Bus 003 Device 005: ID 03f0:6c11 Hewlett-Packard
Bus 003 Device 002: ID 050d:0224 Belkin Components F5U224 USB 2.0 4-Port Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 0bda:0151 Realtek Semiconductor Corp. Mass Storage Device
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


I added the notes in parentheses for clarity of the post.

So clearly my machine is seeing the PICkit2 devices. I think that I still have a security issue plus something else that I can't identify yet.

I will poke around more after dinner.

73 de NG0R

By:
Category:
Comments Off

PICkit2 Ubuntu Blues

I am working on trying to get my Linux machine talking to a couple of PICKit2 interfaces.

I installed piklab on my Ubuntu 10.4 workstation. When I configured it to look at a PICkit 2 interface it was not seeing the interface. After googling a bit saw several references to adding some USB auto detection rules.

sudo gedit /etc/udev/rules.d/026_microchip.rules

#PICKit
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="0032", MODE="0660", GROUP="microchip"
#PICKit2
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="0033", MODE="0660", GROUP="microchip"
#ICD2
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="8000", MODE="0660", GROUP="microchip"
#ICD21
SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="8001", MODE="0660", GROUP="microchip
"


Save that.

sudo addgroup microchip
sudo gpasswd -a YOURUSERID microchip



In theory that should let it auto detect my interface. It is still not working correctly but now I got an error that looks like a permissions issue. When I kill piklab and then relaunch it with SUDO (yeah... I know.. that is bad.. but I am trying to troubleshoot the problem)  I am able to find the PICkit2 and the proper PIC.

I have two different configs that I am using for this test:
PICkit2 + 16F690
PICkit2 (clone) + 16F628A

I am seeing on someone else's blog that indicates that I might need to reboot before this works properly. This is Unix... not Windows so why would I need to reboot?  --It might be worth a try.


Connecting PICkit2 Firmware 1.x on USB Port with device 16F628A...
Firmware version is 2.1.0

The firmware version (2.1.0) is higher than the version tested with piklab (1.20.0). You may experience problems.
set Vdd = 5 V and Vpp = 12 V
USB Port: Error receiving data (ep=0x81 res=-110) (err=could not get bound driver: No data available).
---------------
Connecting PICkit2 Firmware 1.x on USB Port with device 16F690...
Firmware version is 2.1.0

The firmware version (2.1.0) is higher than the version tested with piklab (1.20.0). You may experience problems.
set Vdd = 5 V and Vpp = 12 V
USB Port: Error receiving data (ep=0x81 res=-110) (err=could not get bound driver: No data available).
---------------
I am making progress... but it is not working yet.  I need to figure this out so that I can get my "Hello World" program loaded on the 16F628A.

Here is what I might look at tomorrow:
http://sync-signal.com/2010/01/getting-started-with-pickit2-on-ubuntu-9-10/
http://mcuee.blogspot.com/2008/04/pk2cmd-linux-port-under-ubuntu.html
http://mcuee.blogspot.com/2009/07/piklab-wiki-page-usb-port-permission.html

73 de NG0R

By:
Category:
Comments Off

Lots of computer upgrades this weekend

Over the past couple of days I made a lot of changes.. probably more than is safe to push into one long series of upgrades/changes.

  • I looked at the couple of the Virtual Machines that I had running on one of my Linux servers and decided that I no longer needed them or I could move that functionality someplace else. The VMs are now gone and that machine is being repurposed.

  • My main Linux machine was running on a dual core laptop with 4gb of RAM. I had so much stuff plugged into it that it was no longer a laptop. The performance was ok but starting to become noticeable.

  • The repurposed desktop has 8gb of RAM and a dual core AMD processor. It is not a smoking machine by any stretch of the imagination but it is decent machine. It got reformatted and I installed Ubuntu 9.10 64bit on it. (10.4 was not quite out when I started this project.) I then migrated the data from the laptop over to the desktop. I had a couple initial issues; the swap drive was not correctly configured, the audio was extremely low, etc.

  • Once Ubuntu 10.4 LTS was released I upgraded the machine.

  • Next I installed a cheap Sound Blaster PCI sound card, 5 port USB PCI card, DVD RW drive, and a multi function card reader. (The machine already has 3 internal hard drives + some external USB drives)

  • Now my audio issue is resolved. I resolved a weird error about my second hd saying: "/110 is not ready yet or not present"   --I updated fstab with: nobootwait
I have a couple of other minor issues to tackle. Most of this stuff would never be an issue for an average user installing this as a clean installation. This is a migration+upgrade+hw additions.

I am feeling better about my ability to troubleshoot my configuration. I am total neophyte on Linux but finding that it is not really that difficult to work with. This 8gb system with full size drives is quite a bit faster than my dual core laptop.

So far I do not really like the Ubuntu 10.4 color scheme a some of the menu changes. This is probably the first release where I can say that changes bother me. I am taking it with a grain of salt by assuming that there are some features that I will really like once I dig into them or that it is even more stable than my previously stable systems.

I want to get through these upgrades so that I can go back to working on figuring out how to my 16F628A say "hello world."

By:
Category:
Comments Off

PIC 16F628A Notes

Here are some notes for my own reference as I starting with with the PIC 16F628A

Standard Pin out:



Here is the pin out for the PIC-EL III demo board:


I am trying to work up a flashing LED and some hello world code for the LCD using Mikro Basic. I would like to find a couple of spare hours this weekend to bond with the 16F628A.

73 de NG0R

By:
Category:
Comments Off

QRSS on a breadboard... figuring out the FSK shift

At the workbench......





I have a nice VXO for that will become a QRSS rig at some point in the future. One of the things that I needed to figure out was how much capacitance was needed to move about 5 hertz for my desired FSK shift.

So tonight I started experimenting with some different capacitors. Initially it took about seven 3.3pF capacitors in series to get the 4-7 hertz shift that I was looking for. I was not happy with that approach (too many parts) but it gave me some ideas and an approximate range to work with.

I did some more testing and confirmed that I was going to need something smaller than 1pF. I was figuring about .5pF. Where do I get that kind of part? (Yeah... could make a gimmick capacitor but it lacks reproducibility.)

I start looking through my parts boxes without much luck. I don't have any 1pF caps on hand. So I started looking through the variable capacitors. Eventually I found some .5 - 1.5pF variable mica capacitors. I hooked up two in series and that was the magic. (The capacitors are probably older than I am.)

It looks like 0.54pF while move the circuit about 5 hertz. (Sweet!)

I need to think about how to approach this from a commodity component point of view so that it is reproducible for other builders. I have some ideas that I will try as I do some more prototyping in the near future.  My approach might get tweaked as I start to work on the PIC 16F628A integration in the near future.

I am still amazed at that the stability. I am seeing 1-2 hertz of of shift in the couple of hours on the work bench tonight. That is pretty good in my book.

73 de NG0R

By:
Category:
Comments Off

Fun Schematics

I enjoy looking at hand drawn schematics....

http://soldersmoke.blogspot.com/2008/10/i-shift-to-fsk-on-30-meter-qrss.html

Here is "gimmick capacitor" in a simple oscillator circuit. Bill over at Soldersmoke is playing with FSK keyed QRSS. This is an old post explaining about "gimmick" capacitors compared to today where he is using an LED as a varicap in a different QRSS rig.

Fun home brew stuff.

73 de NG0R

By:
Category:
Comments Off

Putting parts away

My electrical workbench is in a different room than where my radio gear is located. I decided about 2 years ago to separate my spaces as they have different requirements.

I like to be able to work on projects for several days and need the ability to be able to stop and walk away as other commitments come up and the come back to a project later. The workbench is a small room in the basement largely unused/visited by the rest of the family. (Perfect for leaving a project on the bench for several evenings.)

Image below shows a portion of the room that hosts my workbench.


Tonight I spent a couple of hours sorting some more capacitors, LEDs, and resistors.


I have a lot of these medium sized plastic parts containers.


I have a lot more parts boxes than what is in this picture. I am trying to sort everything and label the containers with basic information about what "category" of parts they contain. Eventually I am going to need to build a couple of shelves that are dedicated to holding the parts boxes.

12 months ago you probably would have laughed because I had virtually no parts on hand. I had a very small junk box. I would call N0FP to "borrow" 1 or 2 pieces of x or y. I have made point recently of acquiring a lot of standard components. When I started to look at the kinds of projects I am building I noticed a HUGE amount of overlap in the common components.  Mouser, Digikey and eBay have been my friends recently.

It is nice to be able to do some design work in the shack/office and then take the schematic to workbench, grab a couple of parts boxes, and then melt some solder to make a circuit.

Yeah... my bench is mess... I was sorting parts and boxes tonight when I took the pictures while cleaning.

73 de NG0R