Author Topic: The Z as a PIC Programmer / Oscilloscope  (Read 7244 times)

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« on: August 16, 2004, 04:38:34 am »
Hi,

I am thinking of doing a project based around a PIC 16F877 microcontroller. This chip has a 8 channel 10 bit ADC, runs @ 20Mhz and has a UART. It will basically be an advanced multimeter with several interesting functions depending on my time.

I intend to make a serial programmer for it, and to program it using my Z.  As a portable device i will be using a LCD with it.

My next step would be to implement a software based solution on the Z and communicating with the microcontroller via the serial port.  This would allow me to have all the data displayed on the Z and also to perhaps implement a oscilloscope. The data could then be logged and exported as necessary.

I would ideally design the software so that it would run on a PC with little / no modifications.

Does anyone have any pointers relating to any of this?  I would like to find some data / programs that take data from the serial port on the Z. I also would especially like to find some guides on programming the 16F877 as i have never handled pics before, but i'm starting.
« Last Edit: August 16, 2004, 04:39:34 am by omega »
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #1 on: August 17, 2004, 10:06:36 am »
Hi,

Can someone please see if this relates to the above post? I see PIC & Zaurus, but the translations on the web are terrible

http://www.geocities.co.jp/Technopolis/385...urus/zau008.htm
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #2 on: August 19, 2004, 02:59:36 am »
never mind, it's about a palm keyboard to a z conversion... might use someday.

have my pic16f877 running, reading an adc and doing so i/o. Now i have to work on my assembly skills to make something useful with it.
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.

Tyris

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #3 on: August 19, 2004, 03:15:46 am »
I've used the 16F877 before, nice microcontroller.

I program mine in C and use the CCS compiler (they have linux and dos versions available). My compiler is like 4 years old and Im running the old dos verison under dosemu (runs and compiles fine).

There is a linux package called "odyssey" (do a google search for "pic odyssey") which can be used to program various different pics from linux via parallel port programmer. Unfortunately I havent got this working yet, in windows the parallel port runs 13.7V, in linux, only 7.2V.

Never thought about using the PIC to do either job though. Let us know how it goes.

-T

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #4 on: August 19, 2004, 06:03:01 am »
Tyris parallel port is only TTL, how could you get 13.7? Or you mean the signal from the parallel port only gives you a lower voltage than necessary from the PIC?

Apparently the PIC F877 can be programmed with only 5v, once you set the appropriate flag during high-volt (13) programming.  I agree, it is a very nice microcontroller!

I thought you had to buy the CCS compiler?   I've started to use JAL (Just Another Language) , and JALss has a built in circuit simulator so that's very handy. I think there is also a linux version of that, so i may be looking for someone to help me compile for x/qt! 8-)   JAL also seems to be nice, because if there are any limitations in the language, or of my understanding you can use the assembler directive and start to write assembly in the middle of the code.

I intend to build a serial port programmer for the Zaurus. Someone told me on another of my posts that the serial port is only TTL - if this is the case, it's perfect and i don't have to do logic level translations to true RS232.

I need to learn more assembly, but it's going well. Have digital i/o working and also reading a A/D port - i just have to work out the middle parts to get it to do something interesting!
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.

tumnus

  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
    • http://www.cpinkney.org.uk
The Z as a PIC Programmer / Oscilloscope
« Reply #5 on: August 19, 2004, 07:32:35 am »
Not that I have much experience with PICs, but have you seen this:

http://www.killefiz.de/zaurus/showdetail.php?app=721

and this:

http://www.killefiz.de/zaurus/showdetail.php?app=720 ?

Both are GPLed
# Search the Zaurus Howtos ## Search the Zaurus FAQs ## Find Z software at ELSI #
--------------------
UK SL5500 with Sharp ROM 3.13, SL5600 with Sharp ROM 1.32 - SuSE 9.0 Pro, Windows XP Home
Qualendar for Calendar and Todo
Socket Bluetooth CF Card (Rev F), Kingmax 512MB MMC Card, Palm Tungsten T Stylus,
Pretec CF->Smartmedia Adapter, Semsons Universal Battery Extender

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #6 on: August 19, 2004, 10:22:43 am »
I'm just laughing. Excellent, thanks tumnus. I googled looking for pic and zaurus and didn't find anything useful.

I'm intending to develop a pc link for this project as well (which should be simple in terms of components, and I will be publishing the schematic somewhere), I'm just wondering something that maybe the experience of you all can help...  What language should i develop the PC display application in? I would ideally like to be able to compile and run it on both the Z and PC (windows) with same code [obviously different compiler].   Does anyone have a suggestion?  

The program requirements will be a graph and some dialog boxes with numbers and a few options, so nothing pretty fantastic. The big issue though is that they will have to be able to access the serial port on both machines.   Can this be done in java on either / both platforms.  Thanks for the help!
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.

Tyris

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #7 on: August 22, 2004, 06:14:40 pm »
Quote
Tyris parallel port is only TTL, how could you get 13.7? Or you mean the signal from the parallel port only gives you a lower voltage than necessary from the PIC?

I thought you had to buy the CCS compiler? 

I intend to build a serial port programmer for the Zaurus. Someone told me on another of my posts that the serial port is only TTL - if this is the case, it's perfect and i don't have to do logic level translations to true RS232.
I think my memory may be fuzzy, it could have been 12.7V on my work laptop using windows.
Unfortunately running Odyssey on my linux server I only got 7.2V out of it -- which was not enough to progarm the PIC. Note that I measured the voltage at the programming pin of the pic itself, not the parallel port directly. I am using the EPIC PIC programmer which runs great in windows. I still have not root caused this problem under linux. I cant really do a clean comparison between linux/windows on the same machine as none of my computers dual-boot.

Yes, I bought CCS's PCW years ago, so I've got a relatively stale copy, but it works well for 16F877s. I've been very happy with it as it supported all of the native functions of the PIC, in addition to supporting lots of internal routines and supporting LCDs etc. The manual which came with it was superb. I'll probably get their compiler specific for PIC18 series, as I dont think the 16 series has enough ram to be able to write to compact flash cards (need 512 bytes for a sector), but I may be able to pad it with zeros or figure something out.

Please keep us informed on how your serial programmer effort goes. I'd love to be able to ditch the windows machine needed to program the PIC.

-T
« Last Edit: August 22, 2004, 06:17:09 pm by Tyris »

castlebbs

  • Newbie
  • *
  • Posts: 1
    • View Profile
The Z as a PIC Programmer / Oscilloscope
« Reply #8 on: August 23, 2004, 02:51:17 am »
I've started a 16F873 based voltmeter :
http://ombrepixel.com/drobert/electronic.html.en

It was just to learn the micro and the LCD, I'm not sure that using the pic internal
ADC is accurate enought.

But I think about using my Zaurus (SL5500) as a digital oscilloscope. Some projets use the soundcard as input :

http://xoscope.sourceforge.net/

I have to find a way to protect the sound input of my zaurus

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #9 on: August 23, 2004, 02:59:00 am »
castlebbs - do you have a schematic. What specs is your voltmeter / what are you using for a ADC and how much resolution do you have?
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #10 on: August 23, 2004, 03:04:26 am »
One of the next things i will be doing is looking into getting a serial programmer assembled and working with the Z. Anybody got those serial pinouts / more information on the serial port for me?

I have it reading the 10-bit value and displaying it on 4 digit 7 segments. It's soo cool having 3 full 8 bit ports (not connected with last sentence).

My current attention is to get a nokia 5510/3210/3310 lcd screen working with the pics. I will provide links to the relevant information so others can have a look. All feedback on this project is welcome!
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #11 on: August 23, 2004, 03:07:10 am »
Links about nokia lcds interfacing to the pics (those based on the pcd8544 controller)

http://www.100acre.org/elec/nokia_lcd/
http://serdisplib.sourceforge.net/ser/pcd8544.html
http://users.skynet.be/bk317494/index.htm
http://sandiding.tripod.com/Bertys.html

Does anyone know / can find what the specs / driver chip of the siemens s25 are? I have one of these 4 colour screens with white backlight and it would be fantastic to be able to use it.
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.

Joeboo

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #12 on: August 26, 2004, 04:40:29 pm »
Ever considered using LabVIEW (www.ni.com)?  It lets you create a virtual instrument for pretty much anything you can come up with.  They have versions for windows, linux, mac, sun, and PPC/Palm.  Perhaps someone could port this thing?  I'd love to see it done, we use it at work, and I want a reason for my company to buy me a work Z  

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #13 on: August 27, 2004, 09:07:02 am »
Sorry Joeboo, i want to do this as a final year project.


I've gotten the pinout of the serial port from devnet, but it seems that the serial port is a little annoying regarding its specification. I will attempt to get the pic to communicate with a pc before i look at the Z...  If not the serial then i should be able to send the same information over IR?  Is there a different protocol, does anyone have an experiece?  Can i load minicom and point it to the IR port as a standard serial port?
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
The Z as a PIC Programmer / Oscilloscope
« Reply #14 on: November 10, 2004, 06:20:20 am »
So, can i read the IR as a standard serial port?

No doubt, you've seen that i'm trying to compile octave. I hope to use it as i'm using matlab on my desktop - to display traces using gnuplot of the input waveforms from my project.

My question is - is there an alternative program that would do this? It doesn't need to do much computation, only to take the values from the serial port and plot.  Can gnuplot directly take values from the serial port?
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.