By:
Category:
Comments Off

QRSS+CW+PIC research

Tonight after getting back from our Mother's day trip I decided to do some research. I am working on writing some code for a PIC 16F628A to send CW and QRSS CW. I am trying to get some notes pulled together on the various speeds and spacings.

Dit = Dot
Dash = Dah

QRSS 3 - One dit is 3 seconds
QRSS 10 - One dit is 10 seconds
QRSS 30 - One dit is 30 seconds
QRSS 60 - One dit is 60 seconds

One dah is equal to 3 dits
The space between part of a letter are equal to one dit
The space between letters in the same word are equal to three dits
The space between two words is seven dits

http://en.wikipedia.org/wiki/File:International_Morse_Code.svg

http://www.qsl.net/on7yd/136narro.htm#QRSS

By:
Category:
Comments Off

PIC+LCD = Fun

Another hour or so of fun tonight.


The other day I  had some startup problems getting MikroBasic to interface with the LCD libraries. I chalked it up to me being new with the tool. I pinged my buddy Mike in Hartford to see if he could give me a code fragment to test my LCD.

Part of my initial challenge was that most of the examples that I was looking at were for 16F877 and I am working with a 16F628A. Trying to figure out code + the difference in chips + a development tool was bit much. 

Mike sent me some code today and then I translated the pin layout of his system with a 16F877 to my 16F628A demo board. (I am using a PIC-EL III for this exercise.) I then had an issue with the MikroBasic libraries not playing properly again. I ended up refreshing the libraries and that solved my problem.

After playing with Mike's code I started to adapt it a bit to get a feel for how to work with it. My final project for tonight is 37 lines long with spaces and comments.

I am pretty excited about this. I am going to need to bond with my development platform a bit before I am fully comfortable with it. It is looking like a reasonable tool for developing my QRSS beacon keyer with.

Development: Ubuntu 10.4 64bit running MikroBasic under WINE.
Programmer: WinXP --> PIC-EL III (looks like a PICkit2 clone)

----Basic for tonights demo app----


program LCD04

'LCD Module Connections
dim LCD_RS as sbit at RB6_bit
    LCD_EN as sbit at RB4_bit
    LCD_D4 as sbit at RB0_bit
    LCD_D5 as sbit at RB1_bit
    LCD_D6 as sbit at RB2_bit
    LCD_D7 as sbit at RB3_bit
    LCD_RS_Direction as sbit at TRISB6_bit
    LCD_EN_Direction as sbit at TRISB4_bit
    LCD_D4_Direction as sbit at TRISB0_bit
    LCD_D5_Direction as sbit at TRISB1_bit
    LCD_D6_Direction as sbit at TRISB2_bit
    LCD_D7_Direction as sbit at TRISB3_bit
'End LCD module Connections

main:

'PIC setup
TRISB = 0     ' Set PORTB as OUTPUT
PORTB = 0     ' Set PORTB all pins to 'off'
'End Pic Setup

'LCD Setup Section
LCD_Init()               'Initialize the LCD library
LCD_Cmd(_LCD_Clear)      'Clear the LCD display
LCD_Cmd(_LCD_Cursor_Off) 'Turns blinking cursor off
'End LCD Setup Section

LCD_Out(1, 6, "NG0R")         'Write text starting from row 1, column 6
LCD_Out(2, 2, "QRSS Beacon")  'Write text startfing from row 2, column 2
LCD_Cmd(_LCD_Cursor_Off)      'Turns blinking cursor off

end.

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