Searching \ for '%[PIC%%' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: '[PIC'.

_Sub string match.
PICList Thread
'[PICLIST] Sensing RC receiver impulses & PWM motor'
1995\11\07@091938 by Valehrach Roman

flavicon
face
Hi to all PICers out there!

In an attempt to reduce the amount of 'reinfented wheels' (esp. my own's)
I'm looking for some code (preferable with application notes for the circuits)
concering radio control and motor control - preferable with PICs (but no
exlusive):

1. Decoding the servo impulse/s from a RC receiver:
  * preferable a 'self learning' application
  * determination of multiple levels of modulation (centre, and max. would
    certainly be of help for the beginning)
  * 'fail save'-state whilste there is a signal loss/no signal

2. Controlling of a model motor (car/aeroplane):
  * multiple steps of speed/fine control of revolutions
    preferably PWM (pulse width modulation) with a high frequenzy
  * acceleration/deceleration slope (programable)
  * high currents of 50A (standard, with shorttime current of up to 100A)
  * single/dual direction control
  * motorbrake
  * current sensing to detect shorts/blocking motor

I thing it's obvious that I'm trying to build a RC motor controller. Since I
know that many commercial products nowadays have a PIC (I know of 54 or 84)
inside, it should be possible to build such a thing.
my draft for such a device:
  combination of the above (1., 2.)
  PIC 16C84 (still the only one I can program) with information storage
  in internal EEPROM (receiver impuls, slew rate, motor data)
  modular final stage for cars or planes (brake, single/dual direction,
  etc.)

Since there are so many (aren't there?) RC modellers on the list it would be
interesting to share informations/experiences on the subject of using PICs in
RC models (in the whole and motor controllers especially).

With the minimal research I have done so far I also encountered some questions:
* What is the best way to do multiple tasks with a PIC (esp. 16C84)?
 Ex.: In a motor controller I would have to watch for the incomming impulses
      whilst pulse width modulating a motor, sensing the current, etc.
      To bad if I'm stuck in a wait loop... (If you know what I mean :-)
      Since I want to use the 84 - How do I put the interrupts to best use?
* Which (power) transistors should I use in the final stage?
  BUZ11 looks promissing.. but SIPMOS TEMPFETs/PROFETs/TOPFETs also look good
  (though a much higher price, but temperature/shorts protection)
  What would be the "best" transistor for my task ? (low Rds[on] <50mOhm,
  Id[max] >20A, reasonable pricing/pice, etc.)

  BTW: I bought some BUZ11 which have an 'A' mark on the cooling metal.
       Does that mean that those FETs are in fact BUZ11As and not BUZ11s.
       The plastic housing has printed 'BUZ11' on it (NO A) but what about
       the mark on the metal... ???
       What's the best way to measure the Rds[on] with hobbiest equipment
       (some DVMs [not acurate in mOhms-Measuring], Scope [10MHz])?


Finaly you might ask yourself, why I don't buy one of those commercial juwels
(Ahh.. controllers)?
A. Inflexibility: ('Please define [in-]flex-i-bil-i-ty... Ahh')
  Commercial controllers are trimmed for a single task. If I want to
  control a model car and a model aeroplane I would have to buy two
  controllers <cliiing>, although I wouldn't use both models at the same time.
  It's allmost impossible to find a controller which is really adequat for the
  given task. 'Testing a controller ? - Impossible - buy it first!' <cling>
  I also want to control the slew rate ('Expensive... 8-]' <cling,cling>) of
  the motor with my PC ('Impossible... :-(').

B. The Price: (Isn't it allways ?)
  As I wrote above - RC motor controllers are sold at the price of juwels.
  But a diamond wouldn't explode/burn out if you connect the power supply
the     wrong way - And who didn't/doesn't make mistakes. Such controllers also
  age at a rapid speed (Every year there is something new). If the nowadays
controller is damaged nobody but the manufactorer will repair it (time delay,
  prohibitive cost). So it's off to the bank to get a new loan.

C. Experience:
  I'm still very new to the PICs. I know it will be a hard way to a functinal
  unit but I certainly will learn my share.
  With the knowledge gained I could easily repair the RC motor controller :-)
  Thus *no more garbage collection* for high tech stuff! ;-)
  And ... 'What you know You KNOW.'

Thanks in advance for your response(s)!

****************************************************************************
*   Roman VALEHRACH               eMail-to: spam_OUTe8927070TakeThisOuTspamstudent.tuwien.ac.at  *
*   student of technical university vienna     (subject of annual change)  *
*                                                                          *
*  "SHARE AND ENJOY, SHARE AND ENJOY... "               furry creatures  ->*
*  "The EARTH: ..... (ed., revised: MOSTLY) HARMLESS"   from alpha-centaur *
*  "Say.. is there ANY tea on THIS ship ?"              (footprints)       *
****************************************************************************

1995\11\07@114331 by Conny Andersson

flavicon
face
At 15.16 1995-11-07 +0100, Roman VALEHRACH wrote:

>Hi to all PICers out there!

Oh my, what a letter, almost as long as a spam ;)

-- chop --- chop --

>* What is the best way to do multiple tasks with a PIC (esp. 16C84)?

Use a "state" variable to control where you are in each task and execute
each task in turn via some time sharing scheme, e.g. 2ms for you, 5ms for
you and so on. To control time, you can setup a timer to count down to zero
and then generate an interrupt - set a flag and the current task will finish
what it's doing when the task checks this flag. Each critical input (such as
waveform period measurements) could generate interrupts on selected edges
and store these measurements for further processing in the appropriate task(s).

Just some thoughts ... hope it gives you some new ideas ...

>* Which (power) transistors should I use in the final stage?

I say, read the specifications and look at some examples in the data sheets.
Then try it out on a protoboard (maybe not 20A though).

To measure Rds[on] you can setup a test circuit with high power resistors
and try it out in practise. I did so when I started to build a mega led
display with over 1000 leds and controlled by the well-known Z80-processor.
(The project is currently on halt, I wonder why?)

-- chop --- chop --

>C. Experience:
>   I'm still very new to the PICs. I know it will be a hard way to a functinal
>   unit but I certainly will learn my share.

A small advice ... start with a simple project to learn the basics. I
started with the '54 and I was surprised how much code you actually could
fill it with.


-- Conny

1995\11\07@120021 by Mark A. Corio

picon face
What kind of RC model needs 50 or 100 Amps of current?  Even at 9-volts thats
into the horsepower range!!!

Mark A. Corio
Rochester MicroSystems, Inc.
200 Buell Road, Suite 9
Rochester, NY  14624
Tel:  (716) 328-5850
Fax:  (716) 328-1144
e-mail:  .....McorioKILLspamspam@spam@aol.com

***** Designing Electronics For Research & Industry *****

1995\11\07@135127 by Scott Stephens

picon face
>What kind of RC model needs 50 or 100 Amps of current?  Even at 9-volts thats
>into the horsepower range!!!

The Kalt Whisper electric RC helicopter takes around 35 Amps (average), at
9.6 volts. It only flies for 6 minutes. People I've talked with say
performance just isn't comparable to gas motors. Maybe soon Zinc-air or some
other fuel-cell technology will make electric airplanes and helicopters a
bit more practical. The speed controller in the helicopter ad has 8 TO-220
power FET tabs protruding from its case.

1995\11\07@135134 by Scott Stephens

picon face
>I'm looking for some code (preferable with application notes for the circuits)
>concering radio control and motor control - preferable with PICs (but no
>exlusive):
>
The Circuit Cellar BBS (860) 871-1988, has the file SERVOPIC.ZIP in File
Area 1 from the October 1994, Issue #51
magazine. You may be able to get it from their web site. The code is for PWM
multiple servo's.

>1. Decoding the servo impulse/s from a RC receiver:
>   * preferable a 'self learning' application
>   * determination of multiple levels of modulation (centre, and max. would
>     certainly be of help for the beginning)
>   * 'fail save'-state whilste there is a signal loss/no signal

It might be better to use PIC to modulate and demodulate your signal,
tapping the receiver's comparator output and your transmitters modulation
input. That way, you can employ error detection and correction codes in
firmware.

>* What is the best way to do multiple tasks with a PIC (esp. 16C84)?
>  Ex.: In a motor controller I would have to watch for the incomming impulses
>       whilst pulse width modulating a motor, sensing the current, etc.
>       To bad if I'm stuck in a wait loop... (If you know what I mean :-)
>       Since I want to use the 84 - How do I put the interrupts to best use?

Read Microchip's AP-Note AN-585 "A real-Time Operating System for PIC16/17".
Read about state-machine design in a textbook. The April 92 Computer
Applications Journal has a good article on state-machine design.

>        What's the best way to measure the Rds[on] with hobbiest equipment
>        (some DVMs [not acurate in mOhms-Measuring], Scope [10MHz])?

I would observe the voltage drop across the FET, motor and batteries in
operation. Then use the series current to determine where the power is going.

I'm interested in a good power FET too. I don't like high-side drives &
charge pumps.

1995\11\07@135319 by Timothy McDonough DIAL UP1

flavicon
face
Many of the high performance airplanes such as the sailplanes flown in
F5B competition and even larger sport models use 18-26 cells and draw
50 amps plus. Some of the F5B racers will drain a 20+ cell pack of 1700
mAh batteries in 20 seconds or so.

Tim

On Tue, 7 Nov 1995, Mark A. Corio wrote:

{Quote hidden}

1995\11\07@135935 by Maurizio Conti

flavicon
face
At 15.16 07/11/95 +0100, you wrote:

>.....* What is the best way to do multiple tasks with a PIC (esp. 16C84)?

I have done much experience with the multitask problem .
The good results have obtained them using the technique of the finite state
machine.

Maurizio Conti                           / __  __  __       / ___ ____
.....mcontiKILLspamspam.....iper.net                         / /__)/_  /__) /\  / /_    /
http://www.iper.net                    / /   /__ / \  /  \/ /___  /
                                                    /
------------------------------------------------------------------

1995\11\08@023210 by SONY-OD

flavicon
face
>I'm looking for some code (preferable with application notes for the circuits)
>concering radio control and motor control - preferable with PICs (but no
>exlusive):
>

I have built a small RX-FM receiver with synthetized frenquency for RC-model.
This receiver use RF and PLL MOTOROLA chip, for RF part and a PIC16C57 with
a small EEPROM to decode the RC signal. This circuit run in 2 meters glider
since 2 months - no crash !!! -
If you are interested in PIC code, schematic and PCB, I will be happy to post
you the whole document.
I 'm now developping a TX-FM synthetized tranceiver with LCD panel and a
8031.

 Philippe TECHER at "EraseMEsonyedespam_OUTspamTakeThisOuTiway.fr"

1995\11\08@040340 by Clyde Smith-Stubbs

flavicon
face
G'day,

> If you are interested in PIC code, schematic and PCB, I will be happy to post
> you the whole document.

I'd indeed be very interested in seeing this. Please post it - or if you like
you can upload it to our ftp site (ftp.hitech.com.au) and we can make
it available from there.

Regards, Clyde

--
Clyde Smith-Stubbs       | HI-TECH Software,       | Voice: +61 7 3300 5011
clydespamspam_OUThitech.com.au      | P.O. Box 103, Alderley, | Fax:   +61 7 3300 5246
http://www.hitech.com.au  | QLD, 4051, AUSTRALIA.   | BBS:   +61 7 3300 5235
                   HI-TECH C: Compiling the real world...

1995\11\08@085013 by SONY-OD

flavicon
face
From:
 Philippe at "@spam@sonyedeKILLspamspamiway.fr" FRANCE.


>I'm looking for some code (preferable with application notes for the circuits)
>concering radio control and motor control - preferable with PICs (but no
>exlusive):
>

I have built a small RX-FM receiver with synthetized frenquency for RC-model.
This receiver use RF and PLL MOTOROLA chip, for RF part and a PIC16C57 with
a small EEPROM to decode the RC signal. This circuit run in 2 meters glider
since 2 months - no crash !!! -
If you are interested in PIC code, schematic and PCB, I will be happy to post
you the whole document.
I 'm now developping a TX-FM synthetized tranceiver with LCD panel and a
8031.

1995\11\09@203714 by William D. McMillan

picon face
I'd be interested.  What formats are the documents in?

1995\11\10@115230 by Valehrach Roman

flavicon
face
William D. McMillan wrote:
>I'd be interested.  What formats are the documents in?

Did I miss something here ? After my original REQUEST FOR code I only got
William's response. Did someone else respond with a message saying that he
actually HAS code? Please enlighten me on that matter. (William ?) :-)


BTW I solved the BUZ11 (with 'A'-mark) problem...
To make a long story short - They ARE BUZ11s <hurray>

(the 'a bit longer' story... ;-)
One might be suprised what hobbyists have in their most hidden drawers.
I remembered that I build a constant current regulator (from a printed article)
and actually found it in it's hidding place :-)
So I but the current regulator in between a strong power source and the drain
of the BUZ11. After applying the sufficient ON-voltage at the BUZ's gate I
set the regulator to 1 Amp. and measured the voltage between Drain and Source...
35 mV -> 35 mOhm (plus 10% error with my DMV make less than 40 mOhm)
=> BUZ11 specs
(First I measured the voltage with about 2 cm of wire in between, only got
72 mV, my... what 2 cm can do to measurment :-[ )

Bye for now...
Have a nice weekend :-)
I'm going to bug my RC receiver to determine if I can't decode some pulses...
:-)

****************************************************************************
*   Roman VALEHRACH               eMail-to: KILLspame8927070KILLspamspamstudent.tuwien.ac.at  *
*   student of technical university vienna     (subject of annual change)  *
*                                                                          *
*  "SHARE AND ENJOY, SHARE AND ENJOY... "               furry creatures  ->*
*  "The EARTH: ..... (ed., revised: MOSTLY) HARMLESS"   from alpha-centaur *
*  "Say.. is there ANY tea on THIS ship ?"              (footprints)       *
****************************************************************************

1995\11\10@120511 by Preben Granberg

flavicon
face
>>I'm looking for some code (preferable with application notes for the circuits)
>>concering radio control and motor control - preferable with PICs (but no
>>exlusive):
>>
>
>I have built a small RX-FM receiver with synthetized frenquency for RC-model.
>This receiver use RF and PLL MOTOROLA chip, for RF part and a PIC16C57 with
>a small EEPROM to decode the RC signal. This circuit run in 2 meters glider
>since 2 months - no crash !!! -
>If you are interested in PIC code, schematic and PCB, I will be happy to post
>you the whole document.
>I 'm now developping a TX-FM synthetized tranceiver with LCD panel and a
>8031.
>
>  Philippe TECHER at "RemoveMEsonyedeTakeThisOuTspamiway.fr"
>

Please, one copy to me to !!!

Preben
Creative Micro
Hinbjerg 38
DK-2690 Karlslunde
Denmark
Tel +45 4615 4655
Fax +45 4215 3977

1995\11\16@073047 by Tony Chilton

flavicon
face
>
> I have built a small RX-FM receiver with synthetized frenquency for RC-model.
> This receiver use RF and PLL MOTOROLA chip, for RF part and a PIC16C57 with
> a small EEPROM to decode the RC signal. This circuit run in 2 meters glider
> since 2 months - no crash !!! -
> If you are interested in PIC code, schematic and PCB, I will be happy to post
> you the whole document.
> I 'm now developping a TX-FM synthetized tranceiver with LCD panel and a
> 8031.
>
>   Philippe TECHER at "spamBeGonesonyedespamBeGonespamiway.fr"
>

I would appreciate a copy

regards

Tony Chilton

1995\11\16@090619 by EFBRYA

flavicon
face
>
> I have built a small RX-FM receiver with synthetized frenquency for RC-model.
> This receiver use RF and PLL MOTOROLA chip, for RF part and a PIC16C57 with
> a small EEPROM to decode the RC signal. This circuit run in 2 meters glider
> since 2 months - no crash !!! -
> If you are interested in PIC code, schematic and PCB, I will be happy to post
> you the whole document.
> I 'm now developping a TX-FM synthetized tranceiver with LCD panel and a
> 8031.
>
>   Philippe TECHER at "TakeThisOuTsonyedeEraseMEspamspam_OUTiway.fr"
>

I like a copy

Thanks!

Eric Bryan
RemoveMEefbryaspamTakeThisOuTacxiom.com

1995\11\16@232936 by Joel Carvajal

flavicon
face
>
> I have built a small RX-FM receiver with synthetized frenquency for RC-model.
> This receiver use RF and PLL MOTOROLA chip, for RF part and a PIC16C57 with
> a small EEPROM to decode the RC signal. This circuit run in 2 meters glider
> since 2 months - no crash !!! -
> If you are interested in PIC code, schematic and PCB, I will be happy to post
> you the whole document.
> I 'm now developping a TX-FM synthetized tranceiver with LCD panel and a
> 8031.
>
>   Philippe TECHER at "sonyedeEraseMEspam.....iway.fr"
>

I like a copy

Thanks!

Joel R. Carvajal
EraseMEjoelspamtds.pfi.net

1995\11\18@100402 by wurmfeld

picon face
Hi, I am looking for just a link, I am currently modifing my son's toy
school bus with a motor and lights... I was looking at infrared to control
it. Perhaps what you have can also do the trick. Please EMAIl me the details
to RemoveMEdavidwEraseMEspamEraseMEggx.com.


Many Thanks,
David.

1995\11\18@104216 by Mohamad Shalan

flavicon
face
I am interested in the infrared control. Let me know if u
get anything

       bye,
       shalan.

1995\11\18@213711 by A.Perkins

flavicon
face
At 08:30 AM 11/8/95 +0100, you wrote:

>I have built a small RX-FM receiver with synthetized frenquency for RC-model.
>This receiver use RF and PLL MOTOROLA chip, for RF part and a PIC16C57 with
>a small EEPROM to decode the RC signal. This circuit run in 2 meters glider
>since 2 months - no crash !!! -
>If you are interested in PIC code, schematic and PCB, I will be happy to post
>you the whole document.
>I 'm now developping a TX-FM synthetized tranceiver with LCD panel and a
>8031.
>
>  Philippe TECHER at "RemoveMEsonyedespam_OUTspamKILLspamiway.fr"
>

I'd love to get a copy.

Thanks  AP


'[PICS] Simulator vs. Actual'
1996\03\23@032109 by Andrew Warren
face
flavicon
face
Rob Martin <RemoveMEpicsTakeThisOuTspamspamparallaxinc.com> wrote:

> I know this is rather extensive but I know I must be missing
> something fundamental here or something.
> ....
> Once a signal occurs, the RTCC is started and the program goes back to
> sleep
> ....
> I used Parallax coding (mostly) and assembler to generate the object
> file. I also use the Parallax simulator to check to code out and it
> does exactly what I think it should do when I step through the
> instructions.  When I program the 16C71 and put it on the PIC proto
> board and change the level on on of the PortB pins, it acts nothing
> like I expect !
>
> Can somebody HELP !

   Sure, Rob, although I normally ignore messages containing code
   written with Parallax's assembler...

   The main problem with your code is that you expect RTCC/TMR0 to
   run while the processor's asleep.  It doesn't.

   There are LOTS of other issues, but they're sorta superfluous
   when compared to this one.

   -Andy

Andrew Warren - EraseMEfastfwdspamspamspamBeGoneix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499

1996\03\25@090300 by Rob Martin

flavicon
face
Actually, I know the RTCC does not interrupt while sleeping.  My intent is to
wake up the system with an interrupt from a pin on Port B and then start the
RTCC, and then reset the RTCC after a task is complete and go back to sleep.

Thanks, for looking into this.


At 12:21 AM 3/23/96 -0800, you wrote:
{Quote hidden}

Rob Martin
Association of American Railroads
Transportation Technology Center
Pueblo, CO 81001
spamBeGonerobSTOPspamspamEraseMEwheels.aar.com


'[PIC]Definition of CALL?'
1996\04\13@215359 by Xaq
flavicon
face
I have a question about the definition of the CALL instruction(on the '74 if
that makes any difference).  I have read in the MICROCHIP data book that the
instruction "CALL K" would be valid as long as K is not zero and is less
than 2048.

In the Parallax documentation, it says that:
" The ninth bit of the program counter will be cleared to 0. Therefore,
calls are only allowed to the first half of any 512-word page, although the
CALL instruction can be anywhere."

Which is correct?  There is no mention of clearing the ninth bit in the
MICROCHIP manual.

If the Parallax manual is correct, than I have another question.  How can
one find out where there program's instructions are positioned in memory.  I
looked at the .LST file created by the Parallax assembler, but I was not
sure if the hex numbers numbers (the second column) where the actual
position of each instruction.  It does not appear so because because it
lists all of the ram declarations (example: ram_space ds 1) as actual
instructions.  I assumed that the ram declarations where strictly for the
assembler and were not actual code.



Thanks in advance

Zach Radding

PS I have been getting weird anomalies in my programs, but I just re-arrange
my functions being called and then everything works.  I want to know why.

1996\04\14@004809 by Clyde Smith-Stubbs

flavicon
face
Xaq <KILLspamxaqspamBeGonespamINDIRECT.COM> wrote:

> In the Parallax documentation, it says that:
>  " The ninth bit of the program counter will be cleared to 0. Therefore,
> calls are only allowed to the first half of any 512-word page, although the
> CALL instruction can be anywhere."
>
> Which is correct?  There is no mention of clearing the ninth bit in the
> MICROCHIP manual.

This clearing of the bit applies only to the 16C5x chips, not the 16C74 or
any other 16C6x or 7x chips.

Clyde

--
Clyde Smith-Stubbs       | HI-TECH Software,       | Voice: +61 7 3300 5011
EraseMEclydespamEraseMEhitech.com.au      | P.O. Box 103, Alderley, | Fax:   +61 7 3300 5246
http://www.hitech.com.au | QLD, 4051, AUSTRALIA.   | BBS:   +61 7 3300 5235
----------------------------------------------------------------------------
For info on the World's best C cross compilers for embedded systems, point
your WWW browser at http://www.hitech.com.au, or email @spam@info@spam@spamspam_OUThitech.com.au

'[PIC]Anyone use swapcode.exe?'
1996\04\17@110832 by Xaq

flavicon
face
I tried using swapcode.exe to convert some Parallax code to MPASM.  I got
about 300 errors from swapcode.exe and then a bunch from MPASM(The code
works fine when I use the Parallax assembler).  Any hints on getting it to work?



Zach

'[PIC] Oscilloscopes???'
1996\04\29@013008 by Xaq

flavicon
face
Does any one know how the horizontal retrace (trigger) works on an
oscilloscope?  If you just use level triggering then how can you stabilize a
digital signal like this one:

     ____     ____              ____     ____
    |    |   |    |            |    |   |    |
    |    |   |    |            |    |   |    |
_____|    |___|    |____________|    |___|    |________


sometimes it would trigger off of the first pulse and sometimes of off the
second.  This would cause the wave to jump around.  I have used an analog
scope were this signal is rock solid.  How does it work?

Zach

1996\04\29@140604 by Martin J. Maney

flavicon
face
On Sun, 28 Apr 1996, Xaq wrote:

> Does any one know how the horizontal retrace (trigger) works on an
> oscilloscope?  If you just use level triggering then how can you stabilize a
> digital signal like this one:
>
>       ____     ____              ____     ____
>      |    |   |    |            |    |   |    |
>      |    |   |    |            |    |   |    |
> _____|    |___|    |____________|    |___|    |________
>
>
> sometimes it would trigger off of the first pulse and sometimes of off the
> second.  This would cause the wave to jump around.  I have used an analog
> scope were this signal is rock solid.  How does it work?

The key is "hold off": the trigger circuit ignores edges during the
sweep, of course, and in better scopes for a controllable time after the
active part of the sweep is finished as well.  In fact, a waverform like
the above may or may not sync solidly: it depends on the relationship
between the waveform's periodicity and the period from the trigger that
begins the sweep until the time when the trigger circuit is once more "live".

Does this make sense?  What you need for that signal is to make the
active sweep period (plus any hold off) such that the trigger does NOT
see the wrong rising edge when it's active.  The jumping around you
describe can happen with an analog 'scope too...

1996\04\29@161003 by Eric Strauts

flavicon
face
Zach,

After the oscilloscope sweep ends there is sometimes a variable delay
time called the "holdoff" period. This is usually a control knob. By
adjusting the holdoff time you can wait until the second pulse in the
train has passed and the next signal that triggers the following
sweep will then be the first pulse.

If there is no sweep holdoff control you can also adjust the sweep
vernier control to make the length of the sweep such that it displays
an integral number of pulse groups. Again the first pulse following
the end of the sweep can be made to be the first pulse in the group.

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
| Eric Strauts                         |
| TEEM Electronics                     |
| Park Ridge, IL 60068                 |
| Email: spamBeGoneestrautsspamKILLspamix.netcom.com        |
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

1996\04\29@190332 by Ken Parkyn

flavicon
picon face
>Does any one know how the horizontal retrace (trigger) works on an
>oscilloscope?  If you just use level triggering then how can you stabilize a
>digital signal like this one:
>
>      ____     ____              ____     ____
>     |    |   |    |            |    |   |    |
>     |    |   |    |            |    |   |    |
>_____|    |___|    |____________|    |___|    |________
>
>
>sometimes it would trigger off of the first pulse and sometimes of off the
>second.  This would cause the wave to jump around.  I have used an analog
>scope were this signal is rock solid.  How does it work?
>
>Zach
>
If the signal is data, it'll dance around anyway...
If the signal is repetitive, you should be able to lock to it by
synchronising your cro with the clk2 output of the PIC

my tuppence worth
Cheers,
Ken Parkyn
Grandma always said: "Don't eat blue food"

'[PIC]PortB Interrupt on change?'
1996\04\30@194040 by Xaq

flavicon
face
I have read through the MC data book and app notes and have not found much
info on PortB interrupt on change.

Do all of the pins (b4-b7) have to be used as interrupts when they are enabled?
Can you, for example, use bits b4 and b5 as external interrupts and use b6
and b7 as regular outputs?  Will outputs on those lines trigger an interrupt?

Also I am little confused about a line in the MC app notes (an566).  In
every example they use the following command as one of the first in the
interrupt service routine:

movf portb,1    ;Read portB (into itself) to end mismatch condition

What mismatch condition?  Why is this necessary?  What is really going on?


Thanks

Zach

1996\04\30@220620 by John Payson

flavicon
face
> movf portb,1    ;Read portB (into itself) to end mismatch condition
>
> What mismatch condition?  Why is this necessary?  What is really going on?

For various design reasons, the interrupt-on-change circuitry uses a
"current state" latch-word (4-bits) which is compared with the actual
signals on port B.  Any time such values are different, the PIC will
set RBIF.  While it might have been possible to use synchronizers so
that the "current-state" latch-word would be updated automatically
after setting RBIF, such a design would have been a little tricky in
a context where there's no guaranteed clock (the CPU might be sleeping).

To force the "current-state" latch-word to match the port-pin values,
you must either read or write to PORTB.  Note that if FSR is pointing
to portB, a NOP or CLRW instruction may also have this function.  I
don't know whether a skipped instruction which [tried to] read PORTB
would or not; I don't know how the skipping logic works.


'[PIC]PortB Interrupt on change?'
1996\05\01@011458 by Andrew Warren
face
flavicon
face
Xaq <.....PICLISTspam_OUTspamMITVMA.MIT.EDU> wrote:

> I have read through the MC data book and app notes and have not
> found much info on PortB interrupt on change.
>
> Do all of the pins (b4-b7) have to be used as interrupts when they
> are enabled? Can you, for example, use bits b4 and b5 as external
> interrupts and use b6 and b7 as regular outputs?  Will outputs on
> those lines trigger an interrupt?

> Also I am little confused about a line in the MC app notes
> (an566). In every example they use the following command as one of
> the first in the interrupt service routine:
>
> movf portb,1    ;Read portB (into itself) to end mismatch condition
>
> What mismatch condition?  Why is this necessary?  What is really
> going on?

Zach:

Don't know how you missed this in your reading...

PIC16C7X Data Sheet, section 5.2 ("PORTB and TRISB Registers"):

   "Four of PORTB's pins, RB<7:4>, have an interrupt on change
   feature.  Only pins configured as inputs can cause this
   interrupt to occur (i.e., any RB7-RB4 pin configured as an
   output is excluded from the interrupt on change comparison).
   The input pins (of RB7-RB4) are compared with the old value
   latched on the last read of PORTB.  The "mismatch" outputs of
   RB7-RB4 are OR'ed together to generate the RBIF interrupt (flag
   latched in INTCON<0>."

-Andy

Andrew Warren - TakeThisOuTfastfwd.....spamTakeThisOuTix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499

1996\05\01@015445 by Xaq

flavicon
face
Thanks Andy,  for some reason I looked in the section on interrupts and
skipped the section about TRISB.  Next time I will try to look more thoroughly.

Thanks

Zach

'[PIC] A math problem?'
1996\05\06@152224 by Xaq

flavicon
face
I need to solve this simple equation using a 16C74:

       ans = (X*Y)/Z

ans, X, Y, and Z are all one byte variables (0-255)
Z is ALWAYS greater than Y, but X can be ANY number except zero.
None of the numbers are ever zero.

I know this will usually produce a non-interger number, but I need a "close"
approximation so the ans will fit into one byte.  I would rather not deal
with any 16-bit numbers(or floating point routines), so multiplying X*Y
first would not work because it risks an overflow.  Also, by doing Y/Z
first, will give a number less than one.

It also needs to be done in under a few hundred instruction cycles.

I have not had much experience with writing math routines in assembly so any
help would be appreciated

Thanks for your help,


Zach

1996\05\06@161425 by rdmiller

picon face
On Mon, 6 May 1996, Xaq wrote:

> I need to solve this simple equation using a 16C74:
>
>         ans = (X*Y)/Z
>
> ans, X, Y, and Z are all one byte variables (0-255)
> Z is ALWAYS greater than Y, but X can be ANY number except zero.
> None of the numbers are ever zero.
>
> I know this will usually produce a non-interger number, but I need a "close"
> approximation so the ans will fit into one byte.  I would rather not deal
> with any 16-bit numbers(or floating point routines), so multiplying X*Y
> first would not work because it risks an overflow.  Also, by doing Y/Z
> first, will give a number less than one.

I think your best bet would be to do the 8 x 8 multiply first, then do
the 16 / 8 division "long-wise" as two 8 / 8 operations with a carry.

Rick Miller
<TakeThisOuTrdmillerKILLspamspamspamexecpc.com>

1996\05\06@173356 by Bob Fehrenbach

picon face
Xaq <.....xaqspamRemoveMEINDIRECT.COM> wrote:

>I need to solve this simple equation using a 16C74:
>
>        ans = (X*Y)/Z
>
>ans, X, Y, and Z are all one byte variables (0-255)
>Z is ALWAYS greater than Y, but X can be ANY number except zero.
>None of the numbers are ever zero.


Zach,

Since Z > Y, the answer should always fit in one byte.  You will,
however, need a two byte intermediate result.   Try the following.
I think you will find the code reasonably compact.



  movf    X, w
  movwf   mulplr
  movf    Y, w
  movwf   mulcnd
  call    mpy                     ;-> accHI:accLO
  movf    Z, w
  call    div8                    ;Final result in accLO


          ;Divide 16 bits by 8 bits, 8 bit result.
          ;Conventional shift and subtract
          ;Result MUST fit in 8 bits, otherwise erroneous result.
          ;110 clock cycles.
          ;Source: Bob Fehrenbach
          ;   accHI : accLO / dvsr  -> accLO, rem in accHI


div8:
  movlw   8
  movwf   count
div_loop:
  rlf     accLO, f
  rlf     accHI, f
  rlf     temp, f                 ;save "borrow"
  movf    dvsr, w
  subwf   accHI,w
  btfss   temp, 0                 ;Save result if borrow = 1
  skpnc                           ;Else, save only if positive
  movwf   accHI
  btfsc   temp, 0                 ;Make sure carry is a 1 if
  rrf     temp, f                 ;borrow = 1
  decfsz  count, f
  goto    div_loop
  rlf     accLO, f                ;quotient in accLO
div_exit:                          ;remainder in accHI
  return

;**************************************************************************

;                   8x8 Multiply, 16 bit Result
;
;  mulplr * mulcnd ->  accHI:accLO
;  71 clock cycles
;  (From Microchip app note AN526)
;
mpy:

  clrf    accHI
  clrf    accLO
  movlw   8
  movwf   count
  movf    mulcnd,w
  bcf     STATUS,C
loop
  rrf     mulplr, f
  btfsc   STATUS,C
  addwf   accHI, f
  rrf     accHI, f
  rrf     accLO, f
  decfsz  count, f
  goto    loop

  retlw   0

--
Bob Fehrenbach    Wauwatosa, WI     RemoveMEbfehrenbspamspamBeGoneexecpc.com


'[PICS] Audio Spectrum Analizer'
1996\07\16@213303 by Gerald Joseph Durand
flavicon
face
----------
>I'm trying to do a audio spectrum analizer using a 16C73 and the only
>problem I have is how to measure the amplitude of the incoming signal.
>I have to measure the amplitude at 32Hz, 64Hz, 125Hz, 250Hz, 500Hz,
>1000Hz, 2000Hz, 4000Hz, 8000Hz and 16000Hz.
>I don't want to do a separate bandpass filter for each frequency, I just
>want to dos this by software.
>Does any one have any ideas?

Filter the input at slightly higher than 16KHz, sample at slightly higher
than twice the filter frequency, and then run an FFT.  Simple (at least
with a DSP).

>
>Octavio
>--
>
>Octavio Nogueira
>spamBeGonenogueira@spam@spamspam_OUTmandic.com.br
>http://ourworld.compuserve.com/homepages/tato

-------------------------
Jerry Durand
Durand Interstellar, Inc.
tel:  +1 408 356-3886
fax:  +1 408 356-4659
TakeThisOuTjdurandspamspaminterstellar.com


'[PICS] CAD/PCB software'
1996\08\14@140640 by H.G. Hindriks
flavicon
face
{Quote hidden}

Hello Hans,

I'm using ULTIboard for about 10 years. A very good program to design PCB's!
It is possible to use single layers in ULTIboard. I don't know which version
you are using, but in the newer versions you can route on a single layer.

When i'm right you have to click in the menu :

AUTOROUTING
 SETUP
   LAYER DIRECTION
     TOP = -- or (BOTTOM = --)

In other versions (I'll use 4.70 and 4.80demo) the menu-items can be
situated at other places in the menu's.
I hope it will help you, so you can make your PCB's on an easy way!

PS
At the moment ULTImate has a special offer. ULTIboard Challenger Lite
(500pins) costs at the moment US$79 excl. VAT. See WWW.ULTIBOARD.COM

Greetings from the Netherlands,




Harry Hindriks (PE1OXP)
Electronics Engineer


            *****  Life is too short for QRP  *****

-----------------------------------------------------------------
    H.G. Hindriks
    Purmerlaan 11                       P.O. Box 334
    9501 AW  Stadskanaal                9500 AH  Stadskanaal
    Tel. +31-599-618462                 The Netherlands
-----------------------------------------------------------------

'[PICS] Touchscreen'
1996\08\23@114444 by karlq

flavicon
face
>
> Does any one know how can I do a touchscreen?
> I'm planning to use a PIC to do this, Any idea?
>
> Octavio
>
> --
> ========================================================
> Octavio Nogueira
>    e-mail:   nogueiraEraseMEspammandic.com.br
>  homepage: http://ourworld.compuserve.com/homepages/tato
> voice/fax: +55 11 240-6474
> ========================================================

Depends on the type of touchscreen!

Resistive technology is the easiest and cheapest, it has a maximum
usable resolution of 256 x 256 points.

It is basicly two sheets of plastic glued together at the outside
rim but held apart by very tiny glass beats or bumps.

One is coated with a very low resistance transperent coating, (plane A)

the other has a higher resistance of about 80 to 120 ohm depending
on the distance between the outside edges. (plane B)

The actual value doent matter, You are dealing in ratios here.

Use some cmos switches to apply com and +5V to the horizontal outside
edges of plane B and use an 8 bit A/D input to read the voltage from
plane A.

Do the same thing in the other direction and you have your X,Y position.

You have to use a calibration routine match the physical values received
to your screen layout.

Try a company called ELOGRAPHICS INC. Oakridge Ten. for screens.

I used theirs in Bowling Alley Systems about 5 years ago on an 80C31
and they worked fine as long as people dont use sharp objects to poke
at the screen.

Capacitive screens are better in a public application.
They usualy have a solid glass front and cant be damaged as easyly.
They require analog circitry to drive them, but have a minimum
resolution of 1024 x 1024 points.

Karl
.


'[PICS] LT1298'
1996\10\21@011215 by pics
flavicon
face
Hi All,

Does anyone know wher I can find informations about the Linear
Technology AD converter LT1298? It's used in PicStick.

Talking about PicStick, the new ProPic programmer v2.4 can
read and write the PicStick.

Cheers,

Octavio
--
========================================================
Octavio Nogueira
e-mail:   RemoveMEnogueiraEraseMEspamspam_OUTmandic.com.br
homepage: http://ourworld.compuserve.com/homepages/tato
voice/fax: +55 11 240-6474
========================================================
"ProPic" The first Production PIC Programmer running in
Windows and under US$ 20.00.
Avaible at http://ourworld.compuserve.com/homepages/tato


- To subscribe -or- unsubscribe send e-mail to @spam@majordomoRemoveMEspamEraseMEparallaxinc.com and
- put SUBSCRIBE pics -or- UNSUBSCRIBE pics in the body of the message

'[PICS] New ProPic Software'
1996\10\21@011219 by pics

flavicon
face
The new ProPic software V2.4 is ready, it fixes several small
bugs and added some new PICs like 12C5XX, 14000, etc.

I sugest to anyone using it to upgrade.

Octavio
--
========================================================
Octavio Nogueira
e-mail:   EraseMEnogueiraspam@spam@mandic.com.br
homepage: http://ourworld.compuserve.com/homepages/tato
voice/fax: +55 11 240-6474
========================================================
"ProPic" The first Production PIC Programmer running in
Windows and under US$ 20.00.
Avaible at http://ourworld.compuserve.com/homepages/tato


- To subscribe -or- unsubscribe send e-mail to @spam@majordomospam_OUTspam.....parallaxinc.com and
- put SUBSCRIBE pics -or- UNSUBSCRIBE pics in the body of the message

'[PICS] Interrupt on change'
1996\10\26@104426 by fastfwd

face
flavicon
face
Bob Blick <spamBeGonepicsEraseMEspamparallaxinc.com> wrote:

> It's my understanding that if interrupt-on-change is enabled, it is
> enabled for all four pins(RB4,5,6,7), no choosing. Let's use a
> PIC16C72 as an example.
>
> I'm not clear on the use of those four pins if some are used solely
> as output pins. My questions are:
>
> If I use two of the pins(RB4,5) for outputs, the other two(RB6,7)
> for inputs, and enable interrupt-on-change, will my manipulation of
> the two output pins cause an interrupt, or otherwise mangle the
> correct operation of the interrupt?

   Bob:

   No.  The change-on-portb interrupt is only triggered when INPUT
   pins change states.

> Second question: will reading port B mess with the use of the
> interrupt-on-change feature?

   Probably.  If a change occurs just as a read operation is being
   performed on port B, no interrupt will be generated.

   Worse, it seems that even WRITING to port B can make the PIC
   miss interrupts, since ALL register accesses (even MOVWF, etc.)
   perform a read first.

> Do I need to use the first four pins(RB0,1,2,3) of port B
> output-only if I enable interrupt-on-change? Must I read port B only
> when servicing the interrupt?

   Doing those things will HELP the situation, but they won't
   guarantee that you'll never miss interrupts.  In general, the only
   time the change-on-portb interrupts are truly reliable is when
   they're used to wake the processor from Sleep Mode.

   As I said in the answer to a similar question posted to my
   company's web page, "Sucks, don't it?"

   Sorry to be the bearer of bad news.

   -Andy

=== Andrew Warren - fastfwdspamBeGonespamix.netcom.com                 ===
=== Fast Forward Engineering - Vista, California          ===
===                                                       ===
=== Custodian of the PICLIST Fund -- For more info, see:  ===
=== http://www.geocities.com/SiliconValley/2499/fund.html ===


'FW: [PICS] SuperCAD Symbol'
1997\02\28@013717 by Troy Powledge
flavicon
face
I just purchased SuperPCB and am about to install it. Have you heard anything
about it. Either good or bad.

~*~*~*~*~*~*
Troy Powledge
TCo. Systems
RemoveMEtpow@spam@spamspamBeGoneeramp.net
*~*~*~*~*~*~

{Quote hidden}

- To subscribe -or- unsubscribe send e-mail to .....majordomoRemoveMEspamparallaxinc.com and
- put SUBSCRIBE pics -or- UNSUBSCRIBE pics in the body of the message

1997\02\28@023309 by David W. Duley

picon face
In a message dated 97-02-28 01:37:50 EST, you write:

<<
I just purchased SuperPCB and am about to install it. Have you heard
anything
 about it. Either good or bad.

~*~*~*~*~*~*
Troy Powledge
TCo. Systems
.....tpowSTOPspamspam@spam@eramp.net
*~*~*~*~*~*~
 >>
Troy,
I use both SuperPCB and SuperCad.  I am happy.  Library parts are easy to
create (once you figure it out).  I have found a few quirks but you won't
find any of the big packages that don't have some bugs.  They have been very
responsive to my gripes and they even sent me a fix via Email.  I got the Pro
package which has everything except the circuit simulator.  I do mostly
digital CPU type stuff.  Simulators don't work too well for micro processors.

out of 5 stars I would give it 3 1/2.
It is a perfect package for low end to moderate use.  I have made six layer
boards with out any problem.  The gerber file generation all seems to work
OK. My final films come out great.

Hope this reasures you
Dave Duley
V.P. DreiTek Inc.

1997\02\28@093703 by Andy Kunz

flavicon
face
At 01:34 AM 2/27/97 -0600, you wrote:
>I just purchased SuperPCB and am about to install it. Have you heard anything
> about it. Either good or bad.

I like it.  The SuperCAD is not fully understood in my cranium yet, and I
hear that the design rule checker and some other utilities are a bit weak.

I've used the PCB package for about a year and am rather pleased.  It isn't
as fancy as HiWire, but it gets the job done.

Andy
==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
         Hardware & Software for Industry & R/C Hobbies
       "Go fast, turn right, and keep the wet side down!"
==================================================================


'sorry Re: [PICS] Fw: Virus Warning'
1997\05\23@142730 by Eric Martens
flavicon
face
Sorry guys (and girls !?!) They fooled me and i bought it, sorry. I should
have read it better and i should know better.


Greetings Eric Martens.

----------
> From: Eric Martens <emarEraseMEspam@spam@knoware.nl>
> To: RemoveMEpicsspamspamBeGoneparallaxinc.com
> Subject: [PICS] Fw: Virus Warning
> Date: vrijdag 23 mei 1997 14:39
>
> I received this email from a friend on another mailing list. Read it
> carefully it can save you alot of trouble.
> For those who can't read german there's a english translation at the end
of
> the mail.
>
> Greetings Eric Martens
>
>
>
> ***************************
> *  Eric Martens           *
> *  spamBeGoneemarKILLspamspam@spam@knoware.nl  *
> **************************

1997\05\23@145455 by Martin McCormick

flavicon
face
       The first time I heard one of those stories, I bought it also and
posted a message to our company Email and looked like a total idiot.  It
happens to the best of us.  It's a pretty good virus.  It runs on the most
powerful computers on Earth.

Martin McCormick

In message <199705231825.UAA25510spam_OUTspam@spam@utrecht.knoware.nl>, Eric Martens writes:
>Sorry guys (and girls !?!) They fooled me and i bought it, sorry.

1997\05\23@162514 by e

flavicon
face
Martin McCormick wrote:
>
>         The first time I heard one of those stories, I bought it also and
> posted a message to our company Email and looked like a total idiot.  It
> happens to the best of us.  It's a pretty good virus.  It runs on the most
> powerful computers on Earth.
>
> Martin McCormick
>
> In message <spamBeGone199705231825.UAA25510@spam@spamutrecht.knoware.nl>, Eric Martens writes:
> >Sorry guys (and girls !?!) They fooled me and i bought it, sorry.

Don't worry ! The System Administrator at our University
is posting such warnings every month :-)

I woul'd realy like to see such a Virus !

St.


--
     _______________________________________________________
    |                                      _____________    |
    | Dipl.-Ing. Stefan M. Ranguelov      /____________/|   |
    |                                     |||||||||||||     |
    | tel.:    +49 (30) 20 181 251                          |
    | priv.:   +49 (30) 513 66 23                           |
    | s-mail:  D-10319 Berlin, Mellenseestr. 39/10          |
    | ----------------------------------------------------  |
    | e-mail:  RemoveMErangueloEraseMEspamKILLspaminformatik.hu-berlin.de             |
   /) WWW:     http://www.informatik.hu-berlin.de/~ranguelo (\
  / ) PGP key: on request or from WWW-page                  ( \
_( (|_______________________________________________________|) )  />
(((\ \)  /,)                                            / )  / //))/
(\\\\ \_/ /                                             \ \_/ /////
\       /                                               \       /
 \    _/

'[PICS] LCD interface'
1997\05\28@161506 by bennett

flavicon
picon face
part 0 78 bytes
Thanks





Attachment converted: wonderland:TEST9.ASM (TEXT/MSIE) (00002028)

1997\05\29@130059 by Bruce Cannon

flavicon
face
First double-check the wiring, be sure your wiring and the code agree on
interface mode (4 or 8 bits, hi or lo nybble, ect), then try the code from
one of the mchip app notes.  If it works compare code, if not try another
display unit.  I've had luck with mchip's app note code, parallax's app
note code, and CCS C compiler LCD driver.  I use a part called the LCD
Backpack by Scott Edwards Electronics to quickly test display modules, it
allows you to plug your module into it with a ribbon cable, then send rs232
data from PC, PIC, BASIC Stamp, whatever.  Very useful for eliminating
hardware problems.  He doesn't have a web site but Parallax sells them.
----------
Bruce Cannon
Style Management Systems

Remember: electronics is changing your world...for good!

----------
> From: Wayne Bennett (by way of Wayne Bennett <spamBeGonew.bennettspam_OUTspamRemoveMEsct.gu.edu.au>)
<.....w.bennettspamRemoveMESCT.GU.EDU.AU>
> To:
> Subject: [PICS] LCD interface
> Date: Wednesday, May 28, 1997 1:02 PM
>
> Has any one had much success with interfacing the 16C74 with an
LCD(hitachi
> LM016L).  I'm not sure if I've fried the display or have an error in code
> (attached). If any one is willing to share code or pseudo code I'd
> appreciate the help
>
> Thanks
>
>
>
>
>


'[PICS] LCD interface'
1997\06\02@182418 by Steve Smith
picon face
I have used '84 to drive LM016 with no problems the code is easy to transport
Mail me with request and I will send code segments which work 8 data bits E
and RS lcd is permantly in read mode. There are few constraints except text
should not exceed one half of a page of rom.
Steve.....


'[PIC] Re: *.COD file format why I want it'
1997\08\10@125556 by Fred Thompson
flavicon
face
On Sat, 9 Aug 1997, Mike Keitz wrote:

>
> The binary data to program the chip with is also contained in the .HEX
> file, in a very simple format.  For your programmer to be compatible with
> more software, it should (also) be able to use .HEX files which are
> supported by all PIC assemblers/compilers and used by all PIC
> programmers.  There is no certainty that Microchip .COD files will match
> Hitech, will match CCS, etc.
>

       Good point, I could easily modify the portion for reading the
data.  If the input file has the HEX extension it reads HEX.  If it has a
COD extension; well you get the picture.

{Quote hidden}

       I do this.  Before Walter sent me the file format, I had to scan
for a long series of 0000s then switch to a mode to scan for variable
names.  Now that I have the format, I can do this with greater elegance.
       The symbols that I scan for are
#ChipID:   -   marks the address of special chip ID address
#LastLine: -   marks the end of the program (so I only burn the locations
              actually containing code.

The # is the lowest printable ASCII letter that doesn't mean something to
the MPASM assembler.  This helps push the locations to the top of the list
and lowers the time required to scan for them.  These variables set
default values for questions which ask where to modify and where to stop
burning.  The part of my program that modifies the ChipID instruction only
modifies the lower 8 bits and is intended to work with retlw or movlw
instructions.

{Quote hidden}

       I suppose I could do that, but I have not.  I guess all I really
need to figure out is which location would be best to store this value (by
way of a standard), and then just copy it there.  Right now I don't ever
program this space.  I do program the configuration word (my circuits use
crystals and those bits need to be set), but I don't like it.  I've
already blown the write protection bit on a 16C74 and had to buy another.
I can kind of understand why you can't erase that bit, but I can't
understand why you can't blindly program the rest of the chip with a new
program.  Maybe I'm just not trying hard enough.

1997\08\10@143439 by John Payson

picon face
>         I do this.  Before Walter sent me the file format, I had to scan
> for a long series of 0000s then switch to a mode to scan for variable
> names.  Now that I have the format, I can do this with greater elegance.
>         The symbols that I scan for are
> #ChipID:   -   marks the address of special chip ID address
> #LastLine: -   marks the end of the program (so I only burn the locations
>                actually containing code.

While simulation, etc. might benefit from #LastLine, I think it's better to
look at the hex file to see what locations need burning.  For the 14-bit
parts, I find it easy to simply fill my buffer with $FFFF [not a valid code]
and then use one of four modes when processing those addresses:

[1] Don't blank-check that address; simply ignore it.

[2] Blank-check it and require it to be blank.

[3] Unconditionally program a zero there.

[4] Blank-check it; if blank or zero, leave alone; otherwise burn all zeroes.

Given that $3FFF at the start of a program is essentially a do-nothing opcode,
using option #4 makes overburning (i.e. using excess code-space in the chip
to hold multiple versions of the code without having to erase) much easier.
For example, if my program is 512 bytes or less and I'm programming a 16C622
(2K), then I burn my first program at address zero.  If that doesn't work, I
modify my code, change the start address to $200, and burn again (same chip,
no erase).  Then $400, then $600.  If I'm using interrupts, things get a
little bit harder (but not too much): on the first burn, $000 is a jump to
start of code, $004 is a jump to start of interrupt, and the rest of the code
starts at address $008.  On the second burn, $001, $005, and $208.  Etc.

For the 16-bit parts, the $FFFF-as-flag-value technique doesn't work (though
CALL $1FFF is an unlikely instruction, $FFFF could be part of a data table).
Consequently, I had to make my hex-loader take note of the last byte loaded,
but this wasn't too hard (actually, I may subdivide memory into 16-byte chunks
and make the loader set the flag for every chunk that's used.  If any code
has gaps in the middle this should speed up programming a bit).  Has anyone
else used techniques like this in burners?  I've found them to be quite help-
ful at times.

1997\08\11@080745 by Fred Thompson

flavicon
face
> Given that $3FFF at the start of a program is essentially a do-nothing opcode,
> using option #4 makes overburning (i.e. using excess code-space in the chip
> to hold multiple versions of the code without having to erase) much easier.
> For example, if my program is 512 bytes or less and I'm programming a 16C622
> (2K), then I burn my first program at address zero.  If that doesn't work, I
> modify my code, change the start address to $200, and burn again (same chip,
> no erase).  Then $400, then $600.  If I'm using interrupts, things get a
> little bit harder (but not too much): on the first burn, $000 is a jump to
> start of code, $004 is a jump to start of interrupt, and the rest of the code
> starts at address $008.  On the second burn, $001, $005, and $208.  Etc.

       Thats a good idea!  I'm just writing short test programs right now
and this trick would save a great deal on erasing.  I'm not clear on why
the HEX file is a benefit here unless you take advantage of its text
nature and modify your hex code before running the programmer.  I should
probably add a "Modify Data" feature to my programmer as this would be
easy.

{Quote hidden}

       I'm not yet into 16 bit parts.  I'm sure the day will come.

Thanks for the tips
Fred
fthompsospam@spam@mail.win.org

1997\08\11@114405 by John Payson

picon face
>>Given that $3FFF at the start of a program is essentially a do-nothing op
>>using option #4 makes overburning (i.e. using excess code-space in the chip
>>to hold multiple versions of the code without having to erase) much easier.
>>For example, if my program is 512 bytes or less and I'm programming a 16C622
>>(2K), then I burn my first program at address zero.  If that doesn't work, I
>>modify my code, change the start address to $200, and burn again (same chip,
>>no erase).  Then $400, then $600.  If I'm using interrupts, things get a
>>little bit harder (but not too much): on the first burn, $000 is a jump to
>>start of code, $004 is a jump to start of interrupt, and the rest of the
>>code starts at address $008.  On the second burn, $001, $005, and $208. Etc.
>
>         Thats a good idea!  I'm just writing short test programs right now
> and this trick would save a great deal on erasing.  I'm not clear on why
> the HEX file is a benefit here unless you take advantage of its text
> nature and modify your hex code before running the programmer.  I should
> probably add a "Modify Data" feature to my programmer as this would be
> easy.

I use the .hex files because I understand them, I had code lying around from
another application, they're universal, and THEY WORK JUST FINE.  Perhaps a
.COD file would work better, but I can't see any "problem" with .HEX that it
would fix (for emulation, that would be a different story of course).

Personally, I'm waiting for the day when someone adds the following features
to compilers/assemblers:

[1] The ability to take information about starting address, etc. from a file
   that would be updated (by the burner) whenever a chip was burned, thereby
   automating the overburn process (perhaps it could use an old copy of the
   .HEX/.COD files to find out exactly what needed to be overburned and what
   routines could be left as-is.  The .COD could be *extremely* helpful for
   that.

[2] A "#strike"/"#endstrike" directive which would cause the compiler/assembler
   to emit NOPs instead of the struck code.  When striking out moderately long
   routines, it's a pain having to insert precisely the right number of NOPs
   to make everything else line up.  An automated directive could simplify
   this.

Anyone else like these ideas?


'Fw: Dumb Question [PIC vs AVR for begginners]'
1997\09\04@220746 by Antti Lukats
flavicon
face
At 08:31 AM 5/9/97 +1000, you wrote:
>This is part of a private coversation that I have thrown open for group
> discussion.
>I have put this thread out into the PIClist so others may comment & learn from
> the discussion.
>I hope you don't mind Don.
>I also hope no one else minds newcomers asking dumb questions on the public
> forum.
>I personally think it's the best place to get a mix of opinions.

this is the place to be.
somebody almost always minds, but this possible cant be avoided on any list.

>----------
>> From: Don McKenzie
>> To: Cliff Rogers
>> Subject: Re: Dumb Question

[snip]

>1. Where do I find the manufacturers' home pages?
http://atmel.com
>2. Is the AVR better than the PIC?
No definite YES/NO answer. AVR is faster, cheaper simpler to use
to program it is all flash better instruction set so many plusses.
it has not been on the market more than from 9th June 1997 so it
does not have as much source code and application notes as PIC's

>3. Are there development tools for Both and where do I find them?
from atmel site are available free assembler and simulator
only high level compiler for the only currently shipping AVR (AT90S1200)
can be found at http://avrbasic.com
C Compiler and debbuger is made by IAR http://www.iar.com
more info and links on http://sistudio.com/avr.html

>4. What do you recommend to a beginner to microcontrollers?

its up to the beginner to decide. take a long webwalk to see
what is offered and available.

with low cost Basic Compiler and top speed (16 MIPS) AT90S1200 is pretty
hard to beat. AT90S1200 will always be capable to more than say as example
would Basic Stamp I. Well yes it is little smaller than PIC16F84.

>I do not have a particular project in mind at this stage however I am
interested
> in enviroment control for horticulture &
>hydroponics, engine monitoring & management, & general process control.
>More than just your average PC controled sprinkler system or security system.
>I am a technician, not just a hobbiest. I am testing the water before I
bite the
> bullet.
>
>Thanks, Cliff.

you are welcome. to visit our site and look at the appnotes.
http://avrbasic.com/appnotes

do it frewuently as we will add new ones all the time.

antti



AVR Basic Light NOW Available - Look for September Specials
http://avrbasic.com    Free AVR Basic Compiler Demo Edition


'Opto-isolator Question [PIC@alliedpress.co.nz]'
1998\05\26@220352 by John La Rooy
flavicon
face
You could try two opto-isolators in a bridge. Turn one on with the
3-30V and the other one on with your PIC circuit. When the bridge is
balanced, the current through both diodes should be about the same.

Obviously the accuracy will depend on how similar the optos are.

John

{Quote hidden}


'[PICS] Strobes'
1998\10\28@081940 by Andy Kunz
flavicon
face
>circles of patterns, one for each desired speed.  If you figured out how
to make
>the patterns, you could print up anything you like on your laser or inkjet.

Some more info on the problem might help...

I'm looking at an 1/8" dia shaft with a 1.25" propeller on the end,
rotating between 1K and 60K RPM.

Andy


==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

1998\10\28@103112 by Roger Marin

flavicon
face
A stack of super bright (2000mcd) red LED's with along with a high
current pulse driver/oscillator combo may be quick, dirty and cheap ...
just a thought.

--
Roger Marin
8825 S.E. Hawthorne Blvd.
Portland, OR, 97216-1821
voice: 503.253.3195
fax  : 503.253.0488

1998\10\28@125947 by Peter L. Peres

picon face
On Wed, 28 Oct 1998, Andy Kunz wrote:

> >circles of patterns, one for each desired speed.  If you figured out how
> to make
> >the patterns, you could print up anything you like on your laser or inkjet.
>
> Some more info on the problem might help...
>
> I'm looking at an 1/8" dia shaft with a 1.25" propeller on the end,
> rotating between 1K and 60K RPM.

Why didn't you say so ;) Is it going to be wet ? If so, a twin plastic
optical fiber arrangement with an IR laser and a common IR photodiode will
likely help you a lot. Prop blades are reflective enough for this in my
experience and the flexible twin fibers can be taped to a convenient place
for temporary use ;). You can probably use an IR led if pulsed fast. In
this case some trickery is required to get rid of the beat frequency. PICs
are as good as made for this. The input amplifier for the photodiode needs
to be a better one, probably a faster FET op-amp with the detector wired
as current generator (connect polarized photodiode to - input). 60,000 rpm
is only 1000 rot/sec or 4000 Hz for a 4-blade prop (not likely, more like
2 or 3 blades). If the LED is pulsed with 1 Amp pulses at 30 kHz as for IR
remote applications it should work ok.

The audio tach can be of two kinds: The one where you hear the speed as a
tone and the one where a tone is to be displayed as speed. The 1st method
is easy, connect an audio amp to the IR circuit described above. With 3
blades you get 50 Hz for 1k and 3000 Hz for 60,000. The 2nd method
involves a microphone and a Schmitt Trigger amplifier that supplies a
frequency to a counter. If the amplifier has some AGC, it will lock on the
loudest frequency around (such as, a nitro engine running full throttle
near it).  This last method works very well as I can confirm ;)

Peter

1998\10\28@141645 by Andy Kunz

flavicon
face
>Why didn't you say so ;) Is it going to be wet ? If so, a twin plastic

Not while I'm balancing it.  It's for a dynamic balancer along the lines of
what is used in full-size cars.  I'm sure some heli guys will like it.

>2 or 3 blades). If the LED is pulsed with 1 Amp pulses at 30 kHz as for IR
>remote applications it should work ok.

1A in an LED - what a concept!  What kind of duty cycle do you propose, the
standard 30%?

>tone and the one where a tone is to be displayed as speed. The 1st method

I want digital RPM display based upon frequency the boat is putting out.

>frequency to a counter. If the amplifier has some AGC, it will lock on the
>loudest frequency around (such as, a nitro engine running full throttle
>near it).  This last method works very well as I can confirm ;)

These are electric, but the idea is the same.  We are much quieter!

Do you have a schematic for an audio AGC which will give me the pulsing I
need?  That's the real hangup for me - converting it to RPM is just software.

Andy

==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

1998\10\28@165511 by Sean Breheny

face picon face
At 01:37 PM 10/28/98 -0500, you wrote:
>>Why didn't you say so ;) Is it going to be wet ? If so, a twin plastic
>
>Not while I'm balancing it.  It's for a dynamic balancer along the lines of
>what is used in full-size cars.  I'm sure some heli guys will like it.

What does balance have to do with RPM? Please enlighten me! <G> It would
seem to me that prop imbalance causes the engine to wobble, but doesn't
significantly change the RPM.

Sean

+-------------------------------+
| Sean Breheny                  |
| Amateur Radio Callsign: KA3YXM|
| Electrical Engineering Student|
+-------------------------------+
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
EraseMEshb7RemoveMEspamSTOPspamcornell.edu  Phone(USA): (607) 253-0315 ICQ #: 3329174

1998\10\29@002823 by shadedemon

picon face
Andy Kunz wrote:

> Do you have a schematic for an audio AGC which will give me the pulsing I
> need?  That's the real hangup for me - converting it to RPM is just software.

 Not sure if you need AGC here.  I've been toying with a
simple way for a light based similar idea.  You have a high
peak sound pressure when the exhaust first hits.  Just
compare that against a reference that is generated from the
peak but decays from the last peak.  But the ref is still
well above background noise when the next peak hits so only
peaks count.  And have a comparator that fires when the
input goes above the reference to indicate your next peak..

 MIC--gain--signal--->|---RC network
               |               |
               V               |
               -               |
               |               |
               +               -        lm339 inputs

The incoming peaks charge the RC network through the diode
to get a "near peak" average level.  But make the time
constant short enough that even if the next peak is a little
quieter the RC will have fallen a bit and you get a pulse
comparing the two.  Imagine an LED instead of a normal
diode.  RC should drop enough to make sure the LED lights
when the next peak arrives.  But should stay high enough
that other background noise won't be close to lighting the
LED.  Only problem with this way is is making decay enough
to detect 60khz pulses and not too much for 1khz where it
falls too much and other background noise can register.
 So just suit time constant to how fast boat will move away
from you..  And compare incoming signal vs a voltage divided
2/3 or 3/4 of whats on the cap.  Then you get your wide
frequency range, but still only register pulses near your
average peak.  And if your peaks fall, the level they're
compared to will as well, just slowly.
 I'm doing something similar using an IR LED and photo to
index a rotating system vs the not rotating part.  This way
is a simple circuit and the value held in the C for
comparison is so close to the peak that changes in ambient
lighting/IR will be ignored.  If you want a really long
constant just use two caps in series for the voltage divider
and no R..
 Gain doesn't matter since the other peaks are the
reference, and peaks from the initial exhaust opening are so
high it should ignore other sounds.  When you get a peak,
ignore anything else for 1/120000th second (halfway to your
next possible peak) and you should be noise immune..

Take with a grain of salt, since I'm working on a different
part of the system and have only done a little testing on
this, but that part seems to be ok so far..

Alan

1998\10\29@005137 by tjaart

flavicon
face
Alan King wrote:

{Quote hidden}

I've used this with great success on electret mic's. You want
to have good gain, but no tuning. The non-inv input of a
TL074 was hooked to the tail end of an RC network with a
time constant of 2s. The inv input was hooked to the positive
side of the electret. It worked pretty well. If you divide the
non-inv input, you can get away with a single supply and LM324's.

If you want to get really fancy, you can use an intrumentation
op-amp setup with the two inputs taken from the positive and
negative sides of the mic. Use a series resistor between the
negative side of the mic, and ground.

If what I said didn't make sense, tell me, and i'll try again ;)

--
Friendly Regards

Tjaart van der Walt
RemoveMEtjaartKILLspamspamTakeThisOuTwasp.co.za

|--------------------------------------------------|
|                WASP International                |
|R&D Engineer : GSM peripheral services development|
|--------------------------------------------------|
|SMS spamBeGonetjaartspam@spam@sms.wasp.co.za  (160 chars max)|
|     http://www.wasp.co.za/~tjaart/index.html     |
|Voice: +27-(0)11-622-8686  Fax: +27-(0)11-622-8973|
|          WGS-84 : 26¡10.52'S 28¡06.19'E          |
|--------------------------------------------------|

'Andy's space shuttle, was Re: [PICS] Strobes'
1998\10\29@080103 by cousens

flavicon
face
Alan King wrote:
 SNIP
>  Only problem with this way is is making decay enough
> to detect 60khz pulses

I think Andy meant 60K pulses per minute for the optical tachometer
(three bladed propeller ?)

If the prop's in the water I don't think the engine will be doing
much over 15krpm

The tacho would only need to measure up to 20krpm = or 333hz
(unless you use 25% fuel <G>)

--
Peter Cousens
email: RemoveMEcousensspam_OUTspamher.forthnet.gr  phone: + 3081 380534
snailmail:  Folia, Agia Fotini, Karteros, Heraklion  Crete, Greece.

Is it true that they have, on the new version of windows
managed to increase the MTBF from 95 to 98 minutes ?
(That's why they called it 95)

'[PICS] Strobes'
1998\10\29@115758 by John Payson

flavicon
face
|At 01:37 PM 10/28/98 -0500, you wrote:
|>>Why didn't you say so ;) Is it going to be wet ? If so, a twin plastic
|>
|>Not while I'm balancing it.  It's for a dynamic balancer along the lines of
|>what is used in full-size cars.  I'm sure some heli guys will like it.

|What does balance have to do with RPM? Please enlighten me! <G> It would
|seem to me that prop imbalance causes the engine to wobble, but doesn't
|significantly change the RPM.

I think the idea is that the strobe should run at a right a few
hertz faster or slower than the motor's rotation speed; this would
have the effect of visually slowing the wobble to the point that
it could be usefully seen.  If there is a marking at one spot on
the shaft, the user could see how the direction of the wobble com-
pares with that mark; he could then (after stopping the motor of
course!) adjust the weight distribution to correct for the obser-
ved wobble.

Without such a device, a user might notice that the rotor is wob-
bling quite badly but still have no clue where weight needs to be
added or removed to solve the problem.

1998\10\29@132122 by Peter L. Peres

picon face
On Wed, 28 Oct 1998, Sean Breheny wrote:

> At 01:37 PM 10/28/98 -0500, you wrote:
> >>Why didn't you say so ;) Is it going to be wet ? If so, a twin plastic
> >
> >Not while I'm balancing it.  It's for a dynamic balancer along the lines of
> >what is used in full-size cars.  I'm sure some heli guys will like it.
>
> What does balance have to do with RPM? Please enlighten me! <G> It would
> seem to me that prop imbalance causes the engine to wobble, but doesn't
> significantly change the RPM.

Unbalanced devices cause vibration in the structure at various rpms. This
can be bad enough to make things fall apart. So one reason for balancing
is to get rid of the worst vibration points and to learn the others so as
not to run the boat on one of them and have it come back with a 1mm play
in the prop bearing and without the keel (if used).

Peter

1998\10\29@132132 by Peter L. Peres

picon face
On Wed, 28 Oct 1998, Andy Kunz wrote:

> >Why didn't you say so ;) Is it going to be wet ? If so, a twin plastic
>
> Not while I'm balancing it.  It's for a dynamic balancer along the lines of
> what is used in full-size cars.  I'm sure some heli guys will like it.

What do you use for accelerometers and do you index it or what ? Because
if you index the axis position to determine which way the inbalance vector
pulls then you already have a speed-related signal that you can tap into.

> >2 or 3 blades). If the LED is pulsed with 1 Amp pulses at 30 kHz as for IR
> >remote applications it should work ok.
>
> 1A in an LED - what a concept!  What kind of duty cycle do you propose, the
> standard 30%?

IR remote control leds run at that power level with a duty cycle of 10%
(3us on in 30us or so). They are quite happy with it. A PIC can easily do
that by flipping an output bit with a nop or two between the on and off
commands. And where did you get the standard 30% from ? Is it an American
standard ?

{Quote hidden}

I don't know what the sound level is, that you start out with. By the way,
did you say ELECTRIC ? Multi-pole electric motors with a switched
collector draw current in gobs as the collector switches coils, and there
is a way to build even electronic stabilizers like this. No, you don't
need a pickoff resistor, use the length of cable of the '+' wire from the
regulator f.ex. A LM358 wired 1/2 as x 100 AC amplifier with differential
input and 1/2 as pulse shaper (comparator) should do what you want. Try
this, with 2 crocodile clamps to attach to the engine wire and a scope as
output (before the shaper). Some tinkering may be required. The crocos
attach one to the regulator '+' output and one to the motor '+' input. The
wire between them acts as sense shunt. Some amount of low-passing the 358
will be required.

Another way to get at the frequency of a running DC motor is to put a
pickup coil on it. A phone suction cup coil should work and so should a
vrac-wound ferrite rod antenna. The amplifier is the same. This should
work through the boat body (fiberglass or carbon I presume). Magnetic
pickups do not like to be in the same room with variacs and other mains
operated large transformers and motors, so maybe try the shunt method
first.

hope this helps,

Peter

1998\10\29@154230 by Sean Breheny

face picon face
At 06:57 PM 10/29/98 +0000, you wrote:
>Unbalanced devices cause vibration in the structure at various rpms. This
>can be bad enough to make things fall apart. So one reason for balancing
>is to get rid of the worst vibration points and to learn the others so as
>not to run the boat on one of them and have it come back with a 1mm play
>in the prop bearing and without the keel (if used).

Hi Peter,

I understand WHY unbalance causes vibration. What I don't understand is how
a Tachometer helps you to determine the degree of imbalance.

John Payson suggested that it helped by allowing the use of a strobe which
was synchonized with the rotation to allow the prop to seem to stand still,
so that we could see the wobbling. I'll have to think about this a bit, but
I'm not convinced that strobing will make the wobbling rate seem slower to
the eye.

Sean


>
>Peter
>
+-------------------------------+
| Sean Breheny                  |
| Amateur Radio Callsign: KA3YXM|
| Electrical Engineering Student|
+-------------------------------+
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
shb7spamspamcornell.edu  Phone(USA): (607) 253-0315 ICQ #: 3329174

1998\10\29@160727 by Andy Kunz

flavicon
face
>Without such a device, a user might notice that the rotor is wob-
>bling quite badly but still have no clue where weight needs to be
>added or removed to solve the problem.

Thanks, John.  Your explanation sure beat mine!

Andy


==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

1998\10\29@160730 by Andy Kunz

flavicon
face
>What do you use for accelerometers and do you index it or what ? Because

Not that far along yet.  I'm still using an Eye, Mark I.

>IR remote control leds run at that power level with a duty cycle of 10%
>(3us on in 30us or so). They are quite happy with it. A PIC can easily do

No, a std 38KHz IR is 8uS on and 26 off.  Check the NEC documentation, or
just about any IR chip.

>commands. And where did you get the standard 30% from ? Is it an American
>standard ?

Japanese --> universal <G>

>I don't know what the sound level is, that you start out with. By the way,
>did you say ELECTRIC ? Multi-pole electric motors with a switched

Yes.  We race them at about 50mph around an oval.  We dump 2 AH in 90 seconds.

>is a way to build even electronic stabilizers like this. No, you don't

Stabilizer?  ?

>Another way to get at the frequency of a running DC motor is to put a
>pickup coil on it. A phone suction cup coil should work and so should a

The motor is 100' away traveling at 50mph.  Sound is the only possibility.

I have a tach in my data logger (on board some boats, but not all have
enough room), now I need an external one.

Thanks.

Andy

==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

1998\10\29@163355 by Andy Kunz

flavicon
face
>I understand WHY unbalance causes vibration. What I don't understand is how
>a Tachometer helps you to determine the degree of imbalance.

The tach isn't used for balancing, it's used to measure performance.
Slightly related, but as a measurement of increase, not to balance per se.

>I'm not convinced that strobing will make the wobbling rate seem slower to
>the eye.

Yes, it does.  Actually, the strobe light is to be run either off a pot or
by watching the rotation of the propeller, under user selection.

Andy


==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

1998\10\30@005119 by Andy Kunz

flavicon
face
>What does balance have to do with RPM? Please enlighten me! <G> It would
>seem to me that prop imbalance causes the engine to wobble, but doesn't
>significantly change the RPM.

Have you ever been to a speed shop?  You need to get your tires balanced
for operation at the expected speed.  Harmonics.

Oh, it does!  When you're spinning at 60K RPM especially.

You can be perfectly balanced dimensionally (same outline both blades) and
statically (it stays level on the balancer), but until you spin it you
don't know for sure.

Andy

==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

1998\10\30@014151 by Sean Breheny

face picon face
Hi Andy,

At 09:41 AM 10/29/98 -0500, you wrote:
>Have you ever been to a speed shop?  You need to get your tires balanced
>for operation at the expected speed.  Harmonics.

So, you're saying that they actually listen for harmonics generated by the
wobbling? I would think that the wobbling would be at the same or less
frequency then the rotational frequency of the object.

>
>Oh, it does!  When you're spinning at 60K RPM especially.

Andy, are you using jet powered boats? <G> I have never heard of a model
engine that spins a prop at 60,000 RPM in AIR let alone WATER!!!!!

I have an RC plane with a .40 cu in engine and it tops out at 16,000 RPM
with a 10x6 prop (well, I never measured it, but that's what the specs say).

>
>You can be perfectly balanced dimensionally (same outline both blades) and
>statically (it stays level on the balancer), but until you spin it you
>don't know for sure.

Well, I have never worried about anything other than static balancing on my
prop. The only other way that it could be unbalanced (as far as I can see)
would be if there were more mass toward the back of one blade and toward
the front on another. If you get this advanced, how do you adjust your
props? I just sand the outer edge of the flat side of mine to remove moment
from that side.

Sean


>
>Andy
>
>==================================================================
>Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
>==================================================================
>
+-------------------------------+
| Sean Breheny                  |
| Amateur Radio Callsign: KA3YXM|
| Electrical Engineering Student|
+-------------------------------+
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
spam_OUTshb7spam_OUTspamspam_OUTcornell.edu  Phone(USA): (607) 253-0315 ICQ #: 3329174

1998\10\30@061958 by Peter L. Peres

picon face
On Thu, 29 Oct 1998, Andy Kunz wrote:

> >IR remote control leds run at that power level with a duty cycle of 10%
> >(3us on in 30us or so). They are quite happy with it. A PIC can easily do
>
> No, a std 38KHz IR is 8uS on and 26 off.  Check the NEC documentation, or
> just about any IR chip.

You can use 3 usec with the same parts. The range is slightly better, and
RFI is harder to control, but the FCC is far away from here ;)

> >commands. And where did you get the standard 30% from ? Is it an American
> >standard ?
>
> Japanese --> universal <G>

Ah, ok. ;)

> >I don't know what the sound level is, that you start out with. By the way,
> >did you say ELECTRIC ? Multi-pole electric motors with a switched
>
> Yes.  We race them at about 50mph around an oval.  We dump 2 AH in 90 seconds.

So dump 80 Amps into a 0.005 ohm connection wire. Gives 0.4V and it's not
DC ;)

> >is a way to build even electronic stabilizers like this. No, you don't
>
> Stabilizer?  ?

I mean regulator.

> >Another way to get at the frequency of a running DC motor is to put a
> >pickup coil on it. A phone suction cup coil should work and so should a
>
> The motor is 100' away traveling at 50mph.  Sound is the only possibility.
>
> I have a tach in my data logger (on board some boats, but not all have
> enough room), now I need an external one.

Radio. Get one of those wireless data module pairs and do something smart
with it. I guess the simplest way would be to buy a 'bug' transmitter kit
for FM and connect the mike input directly on the motor wire as described.
A pot may be required to get the volume down. A bug with AGC is better.
Then listen with a FM radio tuned to it. This should be small enough to
fit anywhere.

Peter

1998\10\30@062008 by Peter L. Peres

picon face
On Thu, 29 Oct 1998, Sean Breheny wrote:

> At 06:57 PM 10/29/98 +0000, you wrote:
> >Unbalanced devices cause vibration in the structure at various rpms. This
> >can be bad enough to make things fall apart. So one reason for balancing
> >is to get rid of the worst vibration points and to learn the others so as
> >not to run the boat on one of them and have it come back with a 1mm play
> >in the prop bearing and without the keel (if used).
>
> Hi Peter,
>
> I understand WHY unbalance causes vibration. What I don't understand is how
> a Tachometer helps you to determine the degree of imbalance.

The tachometer can be used to determine where the vibration occurs (minor
vibration that is not to be corrected) and then make a chart to tell the
pilot what engine setting NOT to use.

> John Payson suggested that it helped by allowing the use of a strobe which
> was synchonized with the rotation to allow the prop to seem to stand still,
> so that we could see the wobbling. I'll have to think about this a bit, but
> I'm not convinced that strobing will make the wobbling rate seem slower to
> the eye.

;) The axis wobbling will be at the rate of rotation in most cases so if
the strobe flashes in sync with the rotation the whole picture appears
frozen, with the axis bent out in the direction of mass imbalance. If
there is a colored mark on the axis or on a blade, you can reference the
direction of imbalance to this, stop the motor and correct, then redo from
start.

Peter

1998\10\30@090708 by Keith H

flavicon
face
On Thu, 29 Oct 1998, Andy Kunz wrote:

> >IR remote control leds run at that power level with a duty cycle of 10%
> >(3us on in 30us or so). They are quite happy with it. A PIC can easily do
>
> No, a std 38KHz IR is 8uS on and 26 off.  Check the NEC documentation, or
> just about any IR chip.

IR handsets are anything but standard.

Carrier modulation can be from around 33 to 40 kHz, and sometimes 60 kHz.
I analysed handsets from my house, and found 7us on 21 us off was common
though one handset used 7us on 14 us off.

I wrote some PIC code to transmit various handset signals, and it worked.

The commonly quoted website
       falcon.arts.cornell.edu/~dnegro/IR/REMOTES/
is full of bugs!

BTW, anybody know what phosphor is used to convert IR to white light
in white LEDs? Is it cheap, non-toxic, and robust outside LED pacakging?

1998\10\30@093803 by Andy Kunz

flavicon
face
>So, you're saying that they actually listen for harmonics generated by the
>wobbling? I would think that the wobbling would be at the same or less
>frequency then the rotational frequency of the object.

"Listen" is the wrong word, but yes, the balance of your tire will change
at different RPMs.  How that affects your driving is also dependent upon
the suspension of your car.

>Andy, are you using jet powered boats? <G> I have never heard of a model
>engine that spins a prop at 60,000 RPM in AIR let alone WATER!!!!!

Motor, not engine.  60K isn't hard for a DC motor.  Check out the
advertisements from Model Electronics for their War Emergency Power series.
I use their Turbo 10+ motor in my scale boats, but with the timing cranked
to the physical limits (to boost RPM).

>Well, I have never worried about anything other than static balancing on my
>prop. The only other way that it could be unbalanced (as far as I can see)

At 16K it isn't as important, but with the mass your spinning it could be.

Get yourself a Top Flight magnetic balancer and give the prop a spin.
You'll see.

>the front on another. If you get this advanced, how do you adjust your
>props? I just sand the outer edge of the flat side of mine to remove moment

Boats use metal props, and I just oil sand the thickness of the blade,
usually.

You ought to try dimensional balancing first.  Press the image of the prop
into Play-Doh, rotate prop 180 degrees, and see how they line up.

Some props are horrendous.  APC's are good, imho.

Andy

==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

1998\10\30@093807 by Andy Kunz

flavicon
face
>You can use 3 usec with the same parts. The range is slightly better, and
>RFI is harder to control, but the FCC is far away from here ;)

Good idea!

>Radio. Get one of those wireless data module pairs and do something smart

I'm investigating that angle, but I don't have room in all the boats.

Andy

==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================


'[PICS] Strobes'
1998\11\03@140318 by Peter L. Peres
picon face
On Tue, 3 Nov 1998, Andy Kunz wrote:

> Do you have a schematic for this as well?  I think I'm missing something ...

Schematic to work with LM324/LM358:


                      Switch
                         /
+ Battery O-------------o/ o-------------O + Motor





- Battery O-*--------------------------*-O - Motor
           |                          |
           |                          |
           |                          |        1/4 LM324
           |                          |   |\
           |                          +---+ \
           |                              |  >--*-||-O Audio out
          ===                         +---- /   |
          GND 324                     |   |/    |
                                      |         |
                                      +---------+

The 324 receives power from somewhere else (can be +Battery). The output
should be pretty loud in any amp at 80A current. It may be necessary to
turn the direct feedback network into something else to obtain a low-pass
characteristic but the 324 is slow enough at 5V so as not to propagate
spikes.

The output can be fed (through a volume pot) into the mike input of bug Tx
or directly into an amplifier (small guitar amp ?). Start out with a low
volume.

I once used a setup like this to hunt a rusted ground connection bolt in a
large machine so I know it works.

With some cunning you can take this signal and amplify and limit it to
synchronize a PLL that can drive a strobe. A median filter is a good idea
and the PLL can be a PIC. The output frequency is a whole multiple of the
RPM (usually number of coil armatures on rotor x RPM) and depends on the
type of motor.

Peter

1998\11\03@154247 by paulb

flavicon
face
Peter L. Peres wrote:

> Schematic to work with LM324/LM358:

 Peter, that circuit makes no sense at all!  You are using a voltage-
follower with no gain to buffer a signal whose impedance is a few
hundredths of an ohm!  Total waste of time!

 If OTOH you were to provide a *gain* in the op-amp, say 500 times, to
limit and drive a logic gate, it would be useful.
--
 Cheers,
       Paul B.

1998\11\04@112721 by Peter L. Peres

picon face
On Wed, 4 Nov 1998, Paul B. Webster VK2BZC wrote:

> Peter L. Peres wrote:
>
> > Schematic to work with LM324/LM358:
>
>   Peter, that circuit makes no sense at all!  You are using a voltage-
> follower with no gain to buffer a signal whose impedance is a few
> hundredths of an ohm!  Total waste of time!

That is correct, however it was to clarify the idea. The notes explain
why the amp is not used as is but as an amplifier and low pass filter.

Peter

>   If OTOH you were to provide a *gain* in the op-amp, say 500 times, to
> limit and drive a logic gate, it would be useful.

The amp already limits, depending on offset vs. input signal the output
will be rectified or clipped. You don't really need to amplify, just
remove the feedback connection. If the offset is the wrong way swap the +
and - inputs. ;) This yields Vdd size pulses at the output but you need to
low-pass in software.

Peter


'[PICList]: Known Problems: Please read.'
1999\02\02@145645 by Mark Willis
flavicon
face
I'm telling Jory (The list Admin) about these problems, folks.

 Please hold on, for now please assume that ALL your posts to the list
will go through, and assume there's some technical problem at the list
server that's causing these bounce messages once (or more), for each
post you send to the list.

 Please for now DO NOT re-send the same message repeatedly in hopes of
it getting through, or ask again and again whether your post was seen by
anyone else on the list, unless you ask someone off-list;  We have a
configuration problem and until it's fixed, we all KNOW we have a
problem <G>

 I imagine nobody wants to respond to your posts or mine, because
they're tired of getting bounce messages, plus a copy of their response
<G>  It's a bear, we'll get it fixed though!  That's why I'm telling
Jory (I've been way behind, today's e-mail and hardware catch-up day.)

 Mark, "Please don't shoot the messenger", not the list admin
(Fortunately!), and yes I owe the list a Mini-FAQ soon <G>

1999\02\02@145645 by Mark Willis

flavicon
face
I'm telling Jory (The list Admin) about these problems, folks.

 Please hold on, for now please assume that ALL your posts to the list
will go through, and assume there's some technical problem at the list
server that's causing these bounce messages once (or more), for each
post you send to the list.

 Please for now DO NOT re-send the same message repeatedly in hopes of
it getting through, or ask again and again whether your post was seen by
anyone else on the list, unless you ask someone off-list;  We have a
configuration problem and until it's fixed, we all KNOW we have a
problem <G>

 I imagine nobody wants to respond to your posts or mine, because
they're tired of getting bounce messages, plus a copy of their response
<G>  It's a bear, we'll get it fixed though!  That's why I'm telling
Jory (I've been way behind, today's e-mail and hardware catch-up day.)

 Mark, "Please don't shoot the messenger", not the list admin
(Fortunately!), and yes I owe the list a Mini-FAQ soon <G>

'[Piclist] Re: ARGH HELP!: Jory's on it!'
1999\02\03@043600 by Mark Willis

flavicon
face
Jory's going to look at it, folks.

 I'm not sure your guess is right or wrong, Dwayne (Not picking on you,
just commenting.)  The offender would have to "spoof" each poster -
pretend to be the poster and send the message back to the list
pretending to BE that poster.  Otherwise just that person bouncing the
messages would get the bounce messages...  MY guess - right, wrong, or
totally hallucinatory <G> - is some sort of loop in the incoming message
processing where the messages do not get properly deleted or something
(same symptoms, different cause.)  We'll see, when Jory finds the actual
cause & fixes it, what it actually was!

 Mark

Dwayne Reid wrote:
{Quote hidden}

'[OT] Return Reciepts - WAS: RE: [Piclist] Re: ARGH'
1999\02\03@123225 by Shahid Sheikh

picon face
May I also suggest that if anyone has return reciepts turned on on their
mail client to please turn them off when sending mail to the list. Every now
and then I notice in my sendmail log files that my client is trying to send
a read confirmation to the list.

Shahid

----------
From:   pic microcontroller discussion list[SMTP:RemoveMEPICLISTKILLspamspam@spam@MITVMA.MIT.EDU] on
behalf of Mark Willis[SMTP:mwillisspamBeGonespam.....NWLINK.COM]
Reply To:       pic microcontroller discussion list
Sent:   Wednesday, February 03, 1999 4:26 AM
To:     KILLspamPICLISTspam.....MITVMA.MIT.EDU
Subject:        [Piclist] Re: ARGH HELP!: Jory's on it!

Jory's going to look at it, folks.

 I'm not sure your guess is right or wrong, Dwayne (Not picking on you,
just commenting.)  The offender would have to "spoof" each poster -
pretend to be the poster and send the message back to the list
pretending to BE that poster.  Otherwise just that person bouncing the
messages would get the bounce messages...  MY guess - right, wrong, or
totally hallucinatory <G> - is some sort of loop in the incoming message
processing where the messages do not get properly deleted or something
(same symptoms, different cause.)  We'll see, when Jory finds the actual
cause & fixes it, what it actually was!

 Mark


'[PicList] Quarterly Unsubscribe proposal/ideas'
1999\03\13@165035 by Mark Willis
flavicon
face
Having looked up the "How to make the PICList pop out data to everyone
on the list" data in the manuals, we can now go to a Quarterly (or so)
unsubscribe notice to everyone - I don't want to make it TOO often, so
I'm thinking every two months, or Quarterly.

 This notice whould have the e-mail address you're subscribed to the
PICList in it, so you know where you're subscribed through.

 It'll be set so it is a "Ignore this & you'll stay on the list" post -
so when & if we do this, don't reply unless you want off the list!  But
do reply if you do want off the list.

 I'm posting this in case anyone has major objections, etc.;  I think a
posted bi-weekly (or so) "Mini-FAQ" pointer is still a good idea
(Something like "Here's where the PICList Mini-FAQ resides: http : //
blah blah blah" <G> though with a real URL not a mangled one.)  A quick
one-liner, with a pointer to the Mini-FAQ, which'd have pointers to
Tjaarts' "How to unsubscribe/subscribe" etc. info etc. etc. <G>  (Might
incorporate Tjaarts' code inline?  Maybe volunteer him to do the whole
thing?  <EG>)

 Anyways, any major objections/problems/etc with this?  I'm thinking of
having it first fire off on 4/1, then however often sounds best from
there.  4/1 sounds really appropriate for this, somehow, but maybe I
should plan this on 3/29 or something instead lest it be taken wrong...

 Mark

1999\03\14@180422 by Dwayne Reid

flavicon
face
Mark Willis wrote:

>Having looked up the "How to make the PICList pop out data to everyone
>on the list" data in the manuals, we can now go to a Quarterly (or so)
>unsubscribe notice to everyone - I don't want to make it TOO often, so
>I'm thinking every two months, or Quarterly.
>
>  This notice whould have the e-mail address you're subscribed to the
>PICList in it, so you know where you're subscribed through.
>
>  It'll be set so it is a "Ignore this & you'll stay on the list" post
>so when & if we do this, don't reply unless you want off the list!  But
>do reply if you do want off the list.

For what its worth, the STAMPS list sends their 'BOING' message every
weekend.  If it bounces or if the recipient replies to that message, the
recipient is automatically unsubscribed.

>From my point of view, once a week is just fine.  Just be sure that it is
set as you describe (ignore / delete this message and all is well).

Just one person's opinion.

dwayne


Dwayne Reid   <spam_OUTdwaynerspamKILLspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(403) 489-3199 voice          (403) 487-6397 fax

Celebrating 15 years of Engineering Innovation (1984 - 1999)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
My posting messages to Usenet neither grants consent to receive
unsolicited commercial email nor is intended to solicit commercial
email.


'[PIC] Single-button combination lock project'
1999\04\06@171459 by Maris
picon face
  I would like to make a PIC single-button "combination lock" for my
workshop door. This is not a high-security situation (the door is normally
unlocked), I just want to do it for fun and to learn something.
  The way the lock would work is that you would push the button in some
rhythm such as that of "shave and a haircut, two bits". This is only an
example, any rhythm could be used. This and only this would activate the
solenoid lock.
  One problem is that it would have to tolerate some human variation in
the rhythm, such as 5 or 10%.  It should reset immediately if a bad rhythm
is entered and it should time out if the rhythm is not completed. A
desirable added function would be if the lock could operate in a "learn"
mode where you would enter the rhythm manually with the push button and it
would learn it. Accompanying beeps or notes would be a plus.
  Any guidance, thoughts, directions or code snippets would be appreciated.

Thanks,
Maris

1999\04\06@221015 by Harold Hallikainen

picon face
       There is a similar single button combination lock in the Ideas For
Design of a recent EDN.  That was done entirely in hardware, however.
       This sounds like it'd ideally be a Morse Code receiver.  Just key in
your password to open the door.  This could also be a little like bar
code decoding in that we need to judge the width of a pulse in relation
to the width of other pulses in the stream.  Years and years ago I wrote
some 6800 code to save and load files from a tape drive called a "stringy
floppy."  On recording I sent a transition some time period after the
previous transition.  I think a 0 was one time period and a 1 was 2 time
periods.  I established a threshold that was sqrt(T0*T1) where T0 is the
time of a zero "pulse" and T1 was the time of a 1 "pulse" (pulses in
quotes since I timed between a positive edge and the succeeding negative
edge for one bit, and the negative and the next positive for the next
bit).  The duration of each zero and one bit were stored and used to
recalculate the threshold.
       So, in Morse code, a dah is three times the duration of a dit.  I'd
probably force the password to start with a dit so you can get an idea
the speed of the doorbell operator.  Then set a threshold based on this
duration and sort the dits and dahs to figure out the characters being
sent.  As they are being received, the threshold can be adjusted for
operators who speed up or slow down.


Harold



___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]

1999\04\07@014806 by w. v. ooijen / f. hanneman

picon face
I have made a few assignments for the children of the local "young
enginers" group.
One assignment culminates in such a one-button code lock.
The code is below. It is in JAL, my very own programming language.
The compiler is available for free, so you can translate it to 16x84
assembler or hex
(I'm working on SX support). see http://www.xs4all.nl/~wf/wouter/pic/jal
When you use another chip you can use it as starting point.

include 16c84_10
include jlib

pin_a0_direction = output
pin_a1_direction = input

procedure lees_code( byte out x ) is
  for 8 loop

     var byte n = 0
     while pin_a1 == high loop
        delay_1mS( 5 )
        n = n + 1
        if n == 255 then
           x = 0
           return
        end if
     end loop

     delay_1ms( 200 )
     x = x << 1
     if pin_a1 == low then
        x = x + 1
     end if

     while pin_a1 == low loop
     end loop

  end loop
end procedure

var byte code
forever loop
  pin_a0 = high
  if pin_a1 == low then
     lees_code( code )
     if code == 0b_0000_1111 then
        pin_a0 = low
        delay_1s( 5 )
     else
        delay_1s( 10 )
     end if
  end if
end loop

1999\04\07@091515 by Barry King

flavicon
face
I agree with Harold that a Morse-Code detector would be a desirable
way to do this, it makes it easyto remember a non-trivial rhythm.
There is actually lots of good code around to do this, on the various
Ham Radio web sites, since many folks have done Morse code
reciever/sender programs, you should be able to find something to
adapt.

My Dad and I did a home control system which is controlled via voice
output for prompts and data out (via PC based speech
synthesizer and several speakers in the house) and morse-code in (via
buttons near each thermostat).  All the buttons were just parallelled
for simplicity.

The algorithm is pretty simple, it assumes a dot length to start
with, and figures that any press shorter that twice the dot width is
a dot, anything longer than twice the dot width is a dash.  The first
version set the dot width every time a dot was recognized.  Later, we
switched to a running average of the last few dots.

Similarly, you have to recognize when a space between presses is long
enough that the sender means it to be the end of the symbol.  Ideally
is one dash-time (three dot times), but it has to adapt too.

In practice, we found that with the push button you could only
send slowly anyhow, and most of the commands were single morse
letters ("T" for temperature report, e.g.) so the timing was not too
critical, it worked OK.

Now where in the electronic landfill did I put that surplus
solenoid door strike?

-Barry.

------------
Barry King, KA1NLH
Engineering Manager
NRG Systems "Measuring the Wind's Energy"
Hinesburg, Vermont, USA
RemoveMEbarryRemoveMEspamEraseMEnrgsystems.com
"The witty saying has been deleted due to limited EPROM space"

1999\04\07@143250 by Roland Andrag

flavicon
face
Maris,

I have been thinking of the same thing - in this case to enable the fuel
pump in my car - push button once, car will go 3 minutes and then not again
until you tap the correct code. Couple that with the fuel guage showing
empty and you my trick a thief (hijacker?) into thinking the tank is empty.
I have not gotten round to it yet (won't for a while), but I would suggest
that you first implement it on a PC using your favourite high level
language.  That should teach you the in's and out's.

I have done something similar on a PC to figure out the timing of music
(can't remember at the moment why I would have wanted to do that).
Basically, tap in the rythm, PC tells you 8th note, 16th note etc. I had
limited success, partly due to the variability involved.  A good start is
probably expressing the tap durations as fractions of the duration of the
longest tap in the sequence, and limiting yourself to two or three lengths
of taps (say whole, half and quarter notes).  That way the longest (or
first) tap acts as a reference. Better still, make the first tap a half
note, and use only whole and quarter notes in the rest of the sequence.
That way, you measure the first tap, and then just decide if the subsequent
taps are longer or shorter than the first one.  Might make for a strange
rythm though :-).

Come to think of it, the half note could be any note in the sequence, since
you can just wait for it and evaluate the sequence after it (the whole
sequence) is entered.  Other half notes in the sequence could just be
wildcards - their duration doesn't matter, as long as they are present.  Tap
duration should be measured from the beginning of the tap to the beginning
of the next tap, ie. including the spaces. Thus you could just look at
falling edges if your normally open switch leaves the pin input high. Also
debounce the switches etc.

For learn mode, you'd have to tap in the rythm and tell it which tap acts as
the reference (the pic could find a tap that has more or less half of the
other taps longer than itself, and half the taps shorter).  It would have to
decide which taps are wildcards (have the same duration as the reference
tap).  This sort of thing is a lot easier if you can do divides - fractions
close to one would indicate wildcards if you divided an arbitrary duration
by the 'reference' duration.

Have fun
Roland
{Original Message removed}

1999\04\07@144951 by Ron Fial

flavicon
face
Why not just use morse code?  Anybody could learn 2 or 3 letters, and morse code
decode with a PIC is not hard, you only have to deal with ratios, and assume th
e first press is a dot or a dash, because the lock 'knows' what letter to expect
first.

  di di di di   pause    di dit

Regards,
 Ron Fial

At 07:27 PM 4/7/99 +0200, you wrote:
>>   I would like to make a PIC single-button "combination lock" for my
>>workshop door. This is not a high-security situation (the door is normally
>>unlocked), I just want to do it for fun and to learn something.
>>   The way the lock would work is that you would push the button in some
>>rhythm such as that of "shave and a haircut, two bits". This is only an
>>example, any rhythm could be used. This and only this would activate the
>>solenoid lock.

1999\04\07@152507 by Roland Andrag

flavicon
face
>Why not just use morse code?  Anybody could learn 2 or 3 letters, and morse
code decode with a

Because then you couldn't hum your favourite tune to it...

Cheers
Roland

1999\04\07@205724 by Wagner Lipnharski

picon face
What you need is just program the PIC to measure the timming of the
first time the switch is pressed, set it as a default short time, as for
example code Time=1.  It doesn't need to be exactly "time", just a
counter counting loops while you hold the switch pressed.

The next switch pressings would represent another timmings that would be
divided by this first counter as reference, and so on.

For example:  If the first press, make the PIC counter to 20, the second
(you hold twice longer) would be 40 and the third (also twice longer)
would be again 40, your pressing button relation would be:
1st: 1  (20/20)
2nd: 2  (40/20)
3rd: 2  (40/20)

So your inputed code is  "122".

You can do it in any digits size and lengths, and also used to "program"
the unit.

The only tricky is that the first button press should be the shortest
one, to be used as a divisor for the rest...

Wagner.


Ron Fial wrote:
>
> Why not just use morse code?  Anybody could learn 2 or 3 letters, and morse co
de decode with a PIC is not hard, you only have to deal with ratios, and assume
the first press is a dot or a dash, because the lock 'knows' what letter to expe
ct first.
>
>    di di di di   pause    di dit

1999\04\07@210402 by Wagner Lipnharski

picon face
... sorry by the double post... I forgot to say that my previous message
and suggestion allows different speeds of input, since the PIC would
"lock" and use the first button press and the "reference", so different
persons could use it without any problem.  To allow a nice margin of
error, just use the rounding method before division.
Wagner

1999\04\08@102953 by Lawrence Lile

flavicon
face
You can get an electronic door strike for US$21.95 from
http://www.homecontrols.com   or 1-800-266-8765
I've been thinking along the same lines but the one button approach is
really intrigueing.


{Original Message removed}

1999\04\08@110159 by Wagner Lipnharski

picon face
It turns to be more interesting if you take a look at the Dallas iButton
technology at http://www.dalsemi.com/SiteMap/index.html or
http://www.ibutton.com/ using a single wire... used at car keys
(already), door openers and more... really interesting.

Lawrence Lile wrote:
> I've been thinking along the same lines but the one button approach is
> really intrigueing.

1999\04\08@114244 by Ralph Landry

flavicon
face
Another single button proximity detector that can work through wood,
glass, metal etc can be found at http://www.qprox.com and look for the QT110.
It looks like a very interesting 8 pin part that can be used for alot of
different apps.

-Ralph
KILLspamrlandryspamspamBeGonehaywood.main.nc.us
"If they call it Tourist Season why can't we shoot 'em?"
ICQ# 19545315

'[PIC] 4-20 mA current Loop'
1999\04\21@150219 by Bob Drzyzgula

flavicon
face
Can anyone point me to a circuit and/or PIC code (MPASM,
preferably, but I can translate...) to interface with
a 4-20 mA current loop with a PIC?  Preferably something
that used the built-in ADC on a PIC16C7x, but an example
that used an external ADC would still be useful.  I've got
a current transducer (F.W. Bell PC-50) that I want to read
with a PIC.

TIA,
--Bob Drzyzgula

--
============================================================
Bob Drzyzgula                             It's not a problem
bobspamspamdrzyzgula.org                until something bad happens
============================================================

1999\04\21@190907 by Tony Nixon

flavicon
picon face
Try putting a 250R resistor on the output to ground. That should give you a
signal of 1 to 5 volts which can be read by the PIC.

You may have to be careful that the signal does not go above 20mA.
Sometimes a 4-20mA circuit can deliver more that 20mA.

Regards

Tony

1999\04\22@121055 by Wagner Lipnharski

picon face
Tony Nixon wrote:
>
> Try putting a 250R resistor on the output to ground. That should give you a
> signal of 1 to 5 volts which can be read by the PIC.
>
> You may have to be careful that the signal does not go above 20mA.
> Sometimes a 4-20mA circuit can deliver more that 20mA.

A more realistic industrial environment resistor value in this situation
is something low as 10 to 20 Ohms.  Even that several current loop
generators can supply up to 20 or 25 Volts, is not a guarantee that
everyone would do it.  Sometimes there are other equipments (with
resistors in series online) already connected on that loop. Don't forget
about the wires resistance and bad contacts, they exist and this is main
reason to use current loops, in environments where those losses exist.
Steal 5 Volts from the loop is somehow inappropriate when you can do the
same measurement with just 200 mV.

One of our equipment produced to monitor and calibrate current loops
(4-20mA), was planned to use 20 Ohms shunt resistor. We received a round
and loud "NO" from the customer, his maximum allowed resistance, later
specified, was just 10 Ohms.

1999\04\24@064802 by Dr. Imre Bartfai

flavicon
face
Hi,
I have used a simple 250 ohm resistor and I read it with ADC of the PIC.
(20 ma * 250 ohm = 5 Volts). It is a simplest thing anyway. However, 4 mA
means 1 Volts. But it does not matter...
Imre


On Wed, 21 Apr 1999, Bob Drzyzgula wrote:

{Quote hidden}

'[piclist] 1-wire sample code or tips?'
1999\04\30@174049 by Lieven

picon face
I'm working on a PIC project that talks to a Dallas 1-wire part.
Unfortunately, I can't seem to get it to talk to me.  Attaching
a scope shows a presence pulse but no response to my (seemingly
properly formed and timed, per my interpretation of the 1-wire
spec) transmission.

I'm surprised to say that neither the Dallas Semiconductor site,
nor the Microchip site, nor anyplace else I've searched on the
web, have any code samples for an iButton or 1-wire interface.

Can anyone point me to a site, or send me an example?  C, assembly,
even pseudocode would be handy so I could confirm that my bit-level
signaling is correct.  My project uses the deluxe 17C7xx series,
but I'm familiar with the lower end processors as well.

Thanks,
Lieven


'[piclist] 1-wire sample code or tips?'
1999\05\01@011714 by roblid
flavicon
face
Have you seen this? Don't know if that'll help
http://www.dalsemi.com/TechBriefs/tb1.html

Regards,

Guy Robinson

1999\05\01@083611 by goflo

flavicon
face
Check your DS1820 pinout -  The part acts as you describe
when power & gnd are reversed. Note that the TO-39 pinout
in the data sheet is a TOP view.

Guess how I figured this out...  :)

Regards, Jack

Lieven wrote:
{Quote hidden}

1999\05\01@094433 by Bob Drzyzgula

flavicon
face
Lieven,

In addition to Dallas' excellent tech brief mentioned by
Guy Robinson, you might check the following sites, both
of which contain information about and/or code samples
for interfacing the 1-wire devices with a PIC.

www.ccc.nottingham.ac.uk/~cczsteve/pic84.html
http://www.phanderson.com/

The following site offers a PC-based 1-wire to serial
port system; the proprietor is PIC-friendly (he offers
Linux-based PIC programming software) and may have some
tips for what you are trying to do as well:

http://www.nexuscomputing.com/

Also, the following app note contains 8051 assembly
source code for driving a 1-wire bus off a serial port,
which would be more helpful if you were using an 8051 :-)
but at least is a code sample from Dallas... It also
contains source in C and Pascal for driving a 1-wire bus
with an 8250-style UART.

http://www.dalsemi.com/DocControl/PDFs/app74.pdf

--Bob

On Fri, Apr 30, 1999 at 02:30:34PM -0700, Lieven wrote:
{Quote hidden}

--
============================================================
Bob Drzyzgula                             It's not a problem
KILLspambobspamBeGonespamdrzyzgula.org                until something bad happens
============================================================

1999\05\03@020937 by Dr. Imre Bartfai

flavicon
face
part 0 4730 bytes content-type:TEXT/PLAIN; charset=US-ASCII; name="ibutton.src"On Fri, 30 Apr 1999, Lieven wrote:

> I'm working on a PIC project that talks to a Dallas 1-wire part.
> Unfortunately, I can't seem to get it to talk to me.  Attaching
> a scope shows a presence pulse but no response to my (seemingly
> properly formed and timed, per my interpretation of the 1-wire
> spec) transmission.
>
> I'm surprised to say that neither the Dallas Semiconductor site,
> nor the Microchip site, nor anyplace else I've searched on the
> web, have any code samples for an iButton or 1-wire interface.
>
> Can anyone point me to a site, or send me an example?  C, assembly,
> even pseudocode would be handy so I could confirm that my bit-level
> signaling is correct.  My project uses the deluxe 17C7xx series,
> but I'm familiar with the lower end processors as well.
>
> Thanks,
> Lieven
>
>

Content-Type: TEXT/PLAIN; charset=US-ASCII; name="ibutton.src"
Content-ID: <@spam@Pine.LNX.3.96.990503081050.221BSTOPspamspam@spam@prof.pmmf.hu>> Content-Description:

;---------------------------------------------------

; This code fragment handles the Dallas iButton(TM)

;---------------------------------------------------

;

;Line must be equated as a pin

iButOrg        =        $

       Org        iBData

Cnt        DS        1                ; counter

TCnt        DS        1                ; delay counter        

SSave        DS        1                ; STATUS save cell

FamCod        DS        1                ; Family code   \

SerNo        DS        6                ; serial number } do not separate!

CRC        DS        1                ; CRC value        /

Cmd        DS        1                ; command/data cell

Acc        DS        1                ; virtual accumulator

CSave        EQU        SSave.0



iBEnd        EQU        $



       Org        iButOrg

       

iButton Call        _Init                ; reset prom

       Or        W,#0                ; check for zero

       SZ                        ; skip if good

       Ret                        ; otherwise return

       Mov        W,#0Fh                ; Read ROM command

       Call        _SndCmd

       Call        _GetByt                ; receive byte

       Mov        FamCod,Cmd        ; save family code

       Mov        Cnt,#6                ; length of serial number

       Mov        FSR,#SerNo        ; serial number address

:loop        Call        _GetByt                ; Receive SerNo

       Mov        INDF,Cmd        ; received value

       Inc        FSR

       DJNZ        Cnt,:loop

       Call        _GetByt                ; receive CRC

       Mov        FSR,#FamCod

       Mov        Cnt,#7                ; length

       Call        CRC8

;------        now xchg CRC & Cmd

       Mov        W,CRC

       XOr        W,Cmd                ; here change Cmd with W

       XOr        Cmd,W

       XOr        W,Cmd

       Mov        CRC,W

;------

       

       CSE        CRC,Cmd                ; received==calculated

       Retw        2

       Retw        0                ; good



_Init        SetB        RP0                ; select Bank #1

       ClrB        Line                ; turn line to output

       ClrB        RP0                ; Bank #0 again

       ClrB        Line                ; master reset

       Call        _Trst                ; 500 usec delay

       SetB        RP0                ; Bank #1 again

       SetB        Line                ; turn line to input

       ClrB        RP0                ; now Bank #0 again

       Call        _Tpdh                ; recovery

       Clr        Cnt                ; clear counter

:pres        Call        _T12u                ; wait 15 usec

       JB        Line,:eoi        ; if high again, end of init

       Inc        Cnt                ; count length of presence pulse

       CJAE        Cnt,#20,:bad        ; too long: shortcut

       Jmp        :pres

:eoi        CJB        Cnt,#1,:bad

       Retw        0                ; iButton found

:bad        Retw        1                ; iButton not found



_T12u        Mov        W,#3                ; for 1 usec / instruction!

:loop        Add        W,#255

       JNZ        :loop

       Ret



_Tpdh        Mov        TCnt,#2                ; about 30 usec

       Jmp        _Trst:loop



_Trst        Mov        TCnt,#31        ; about 500 usec

:loop        Call        _T12u

       DJNZ        TCnt,:loop

       Ret



_SndCmd        Mov        Cmd,W                ; store command

       Mov        Cnt,#8                ; # of bits

:loop        Rr        Cmd                ; LSB first

       Call        _SendC

       DJNZ        Cnt,:loop

       Ret



_SendC        Mov        SSave,STATUS

       SetB        RP0                ; select Bank #1

       ClrB        Line                ; turn line to output

       ClrB        RP0                ; Bank #0 again

       ClrB        Line                ; low pulse

       Mov        W,#1                ; short pulse

       Call        _T12u:loop        ; tlow1

       JNB        CSave,:Slot

       SetB        RP0                ; Bank #1

       SetB        Line                ; turn to input

       ClrB        RP0

:Slot        Call        _Tpdh                ; sampling window

       Call        _Tpdh                ; sampling window

       JB        CSave,:ret        ; return if 1

       SetB        RP0                ; Bank #1

       SetB        Line                ; turn to input

       ClrB        RP0                ; Bank #0 again

:ret        Ret



_GetByt        Mov        Cmd,#128        ; hibit as exit condition

:loop        SetB        RP0                ; select Bank #1

       ClrB        Line                ; turn line to output

       ClrB        RP0                ; Bank #0 again

       ClrB        Line                ; low pulse

       Mov        W,#1                ; short pulse

       Call        _T12u:loop        ; tlow1

       SetB        RP0                ; Bank #1

       SetB        Line                ; turn to input

       ClrB        RP0                ; Bank #0 again

       Mov        W,#1                ; short pulse

       Call        _T12u:loop        ; tRDV

       MovB        C,Line                ; line state

       Rr        Cmd                ; put received bit

       Mov        SSave,Status        ; save status register

       Mov        TCnt,#4                ; tSLOT

       Call        _Trst:loop        ; time

       JNB        CSave,:loop        ; hibit not reached yet?

       Ret

       

CRC8        Clr        CRC                ; clear initial CRC

:loop        Mov        W,INDF                ; fetch the byte

       Call        CRC8up                ; update CRC

       Inc        FSR                ; next pointer

       DJNZ        Cnt,:loop

       Ret

       

CRC8up        Mov        SSave,W                ; save bits to be shifted

       Mov        TCnt,#8                ; set shift=8bits

       Mov        W,SSave                ;; restore result

:loop        XOr        W,CRC                ; calculate CRC

       Mov        Acc,W                ;; last CRC value

       RR        Acc                ; move it to carry

       JNC        :Zero                ; skip if data=0

       XOr        CRC,#18h        ; update the CRC value

:Zero        RR        CRC                ; position the new CRC

       RR        SSave                ; position the next bit

       Mov        W,SSave                ; use the remaining bits

       DJNZ        TCnt,:loop

       Ret

       

'[PICList Admin] The "No such User!" message some h'
1999\05\04@005044 by Mark Willis

flavicon
face
Well, folks, I tracked the cause down, and am about to ask that the
sitation be fixed.  (CC'ed it to Jory.)

 Fortunately this was only affecting a few people;  If you were one of
the few who received these "No such user: {something} @ winnt.mail", I
predict that the reason you received such an error message was that you
sent a message to the PICList with parentheses () in the subject line,
and that the error you received back had all or part of what you typed
in that subject line, as the e-mail address that was a non-existent user
at winnt.mail - I couldn't get anyone to send full headers my way, but
once I tested this scenario, I got full headers myself, so I can write a
note to the source of the problem.

 (In plainer english, if your subject line was "[OT] Weather!
(foobar)", you would have received an error back that said
"foobarspamBeGonespamspamBeGonewinnt.mail - no such user here.", in the body, with "No such
user!" as a subject line.)

 Probably just a broken internal mailing Daemon or something, I'll let
the person talk with their ISP about fixing it!

 Mark


'[PICList] HELP, OTHER: Sonar underwater'
1999\06\10@140148 by Maris
picon face
At 05:42 PM 6/10/99 +0800, Peter Grey wrote:
>Does anyone have any links to using sonar underwater and possible distance
>measurement?
>

I have done this using a 68HC11 and some fairly simple circuits. I used a
transducer from a boat depth sensor (they can be purchased separately) -
this was a 2" diameter piezo-ceramic disc with a resonant frequency of 192KHz.

I drove this with a 200KHz square wave from the 68HC11 (easier to generate
than 192KHz) -- this drove a mosfet with a step-up transformer connected
from the drain to +12 volts. The step-up ratio was 20:1 and it was wound on
a ferrite toroid. This produced an output of approximately 500 volts
peak-to-peak. This voltage is necessary to produce an adequate output from
the ceramic transducer in order to get a strong return echo, especially
from a muddy lake bottom.

I had to fiddle with the windings a bit to get the transformer to work
right because the ceramic transducer is basically a capacitor and should
roughly resonate with the secondary of the transformer. You should look at
the drive signal to the transducer with a scope, it should look somewhat
like a sine wave. Use some attenuation to your scope in case it might not
like a 500 volt input. I tested the transducer at both 192KHz and 200KHz
and while the output was greater at 192KHz, it was OK at 200KHz and this
was much easier to produce with the 6811.

The transducer should be driven with approximately 25 cycles of the square
wave in each burst, maybe more if you need to receive echoes from greater
depths.

Now for the receiver: The input for the receiver is taken from the ouptut
of the transducer through a 10K resistor so as not to load the transducer
when it is being driven. Then this has to be clamped with a pair of fast
back-to-back diodes since your amplifier might not like getting the full
500 volts from the transmit pulse going into its input.

For amplification I used a couple of fast opamps. The amount of A/C gain
you need will vary with your transmit circuit and transducer, so no figure
can be given. Probably something around 500 max gain will be in the
ballpark. You will also need a 200KHz bandpass filter, preferrably at the
input of your amplifier. A simple LC filter will work well with a Q of
around 10. This filters extraneous noise out of the received echo.

The amplifier is followed by a full or half-wave rectifier going into a
smoothing filter (just a cap to GND with a parallel resistor). This needs
some adjustment also as it affects the speed of response and the noise
resistance of the system. This then goes to a comparator which feeds the
micro input capture port pin which measures the time between the transmit
pulse and the echo.

Since the beam from the sonar pulse spreads as it leaves the transducer,
you need to increase the receiver gain with time. The simplest way to do
this is with a diode attenuator -- this can attenuate the received signal
over a 1000:1 range by changing the current through the diode. The diode
forms a voltage divider with a series resisor; as more current is passed
through the diode, its resistance decreases, attenuating the signal. The
current can be supplied by a DAC controlled by the micro. The rate of gain
increase needs some adjustment because of differences in the beam spread of
different transducers. I didn't find this to be too critical.

Although this sounds fairly complicated, it's relatively straightforward
and the individual sections of the circuit can be set up independently. My
system worked well down to approximately 120 feet (I didn't try it beyond
that) and had a resolution of approximately 2 inches. The accuracy depends
on compensating for the changes in the speed of sound with temperature, the
time delays in your system, etc.

Some other things to note:
1. You need to wait approximately 500 microseconds before enabling the
input capture after the transmit pulse because the transducer and its
housing will "ring" for a while after the transmit pulse ends.
2. The speed of sound is very close to 1500 meters per second. When
figuring the distance to the target, you have to figure the round-trip
time. The round trip time for 100 feet is approximately 44 miliseconds.
3. If you don't get a return echo after a preset time, you should abort the
input capture. Then you should step up the amplifier gain and try again.
Water with floating silt will absorb more sonar energy, air bubbles will
absorb a LOT of energy, etc.

Because of possible reflections from floating debris, fish, etc. it's best
to send about 16 pulses in succession and pick the 8 most valid echoes
(ones that match each other most closely) and average them to get more
accuracy and greater resistance to false echoes. You can also check the
echoes against the time history of the previous echoes to see if they make
sense depending on your application. As an example, if you are looking at a
lake bottom 30 feet down and suddenly get an echo from 5 feet, this should
be probably be discarded.

Sorry I can't furnish a circuit diagram but this was for a commercial
application. However from the above you should be able to brew your own. A
PIC should work great for this; I used a 6811 because of other
considerations. There are a lot of links on the web which should help you
fill in the details.

Maris

'[PICList ADMIN] Someone's bouncing messages back i'
1999\06\22@195112 by Mark Willis

flavicon
face
And I am pretty sure I know who it is, if you get a "Rejected posting
to the PICList" message, it's from this person's copy of your message
being re-directed back to the PICList through fate or a mistake or
whatever.  Thanks for the patience.

 Mark


'[PICList Admin] Mail routing problems (Was Re: Mai'
1999\07\12@192208 by Mark Willis
flavicon
face
Other People seem to be having this problem, Ruben, you're NOT the only
one.  I'm getting list mail just fine, myself, and your posting got to
the mail server just fine...  One other person who was having the same
problem had things get "Stuck" enroute for 4 days, I'd assume that
somewhere a mail server's not sending temporarily, just receiving,
temporarily.

 Mark

Ruben Jšnsson wrote:
{Quote hidden}


'[PICList] Mini-FAQ, Revised Aug. 28, 1999 (Pre-Dra'
1999\08\29@133332 by Mark Willis
flavicon
face
Well, found a copy of this, before mods & so forth.

It needs some serious work!  This is a PRE-Draft, not the real thing <G>

BTW, folks:  I will be changing my e-mail address by the 31st, to
<spam_OUTmwillisSTOPspamspamfoxinternet.net>.  I'm moving 30 miles SE of here, and NWLink
doesn't have a local modem line in Enumclaw.  Should be a nice, serene
place to live.  That new account's active now, BUT, I'm not downloading
e-mail from that account (quite yet.)  I probably will create a second
e-mail address to subscribe to the list from, and use that address for
Admin purposes.

Here's the draft, somewhat edited:

---  Begin  ---
   HOW TO UNSUBSCRIBE

There one ways that works to get off the list.  DO NOT post to the
list.  This might get you off, but is the worst way to do it; A post to
the list goes to all subscribers, is VERY slow and gets everyone angry
with you.  If Jory & Mark miss seeing it (and they may not read all
of every post, and may occasionally take a day off), you don't get off
the list.

The best, fastest way is to post to:

RemoveMELISTSERVspamspamMITVMA.MIT.EDU (i.e. TakeThisOuTLISTSERVspamspamRemoveMEMITVMA.MIT.EDU)

from the address at which you are subscribed containing nothing but

unsubscribe PICList

in the first line of the message, from the address at which you are
subscribed.  This is automatically executed and is the fastest method.
The message must contain the exact words "unsubscribe PICList", no
other spelling works.  You'll get a confirmation e-mail, with directions
on how to confirm (Basically: just reply with the word "ok" in the
body), and you'll be off the list.

 If you are trying to unsubscribe from an address different from the
one you subscribed from, probably best to send an e-mail to
<KILLspamPICList-Requestspamspamspam_OUTMITVMA.MIT.EDU> (E-Mail to that address is copied to
all of the list admins), and clearly ask to have your OLD address
unsubscribed.  I cc my response to your old & new addresses (As a
courtesy), and if I'm not here Jory can catch you, this way.

 If you have difficulties, or do not understand what to do, send an
e-mail message to <PICList-RequestRemoveMEspamMITVMA.MIT.EDU>, and one of us will
try to help you.  Do tell us you want help with the PICList as we both
are on / run more than one list!

   PURPOSE and ETIQUETTE

 This list is for the specific purpose of providing a forum about the
use, learning about, safety with, and enjoyment of MicroChip PICs. Other
support "Glue" chips are acceptable off-topic subjects, to some extent.

 Commercial posts, flaming, spamming, virus warnings, etc. do not
belong in this mailing list, and posting same could result in our
removing you from the list.  Humor happens here, and is welcome so long
as it doesn't result in bodily harm from too many list readers falling
out of their chairs, and so long as it's kept in reasonable bounds.
Humor isn't the purpose of the list, but the good laugh provided
(relevant to PICs especially) is very welcome on occasion!  (At the same
time, too much of a good thing, is too much.)

 Posting messages to the list is restricted to subscribers, who are
defined as anyone posting with a logon name and address identical to one
in the list of subscribers.  You cannot post to the list either from a
different address or if you are unsubscribed.

 [For more information about this mailing list, post to:

EraseMELISTSERVSTOPspamspamRemoveMEMITVMA.MIT.EDU (i.e. spam_OUTLISTSERVRemoveMEspamEraseMEMITVMA.MIT.EDU)

with the text

info PICLIST

in the first line of your message.  Also read
http://www.wasp.co.za/~tjaart/piclist.html, Tjaart's handy web page.
Also, see the Archives at http://www.iversoft.com/piclist.]

 This Mini-FAQ is posted by Mark Willis monthly (early in the month),
to help Jory out.  Suggested updates or changes, Post to:

<TakeThisOuTPICList-RequestRemoveMEspam@spam@MITVMA.MIT.EDU>

 Mark will post this with this EXACT same title [unless revised, then
the revision date will change] to help keep the list uncluttered with
"unsubscribe" requests, and will e-mail it to anyone on request.

---  End  ---

 Mark, EraseMEmwillisRemoveMEspamnwlink.com
 Changing to <spammwillis.....spamspamFoxInternet.Net> in just a few days!

'[PICList Administritiva]: e-mail address change fo'
1999\08\30@144515 by Mark Willis

flavicon
face
I'll be at mwillisspam_OUTspam@spam@foxinternet.net, starting Wednesday (2 days from
now.)  The current NWLink address will be forwarded to that account for
a month;  The account at foxinternet.net exists now, I'll start fetching
mail tomorrow, from there.

Also, I'm about to change the list's default to Repro, for new users;
somehow thought I'd done that, well, it'll be installed in a minute.

 Mark


'Serial Interface Question [PIC related]'
1999\09\05@033141 by kfisk
flavicon
face
I am working on a system (yes, PIC) which uses a serial interface protocol
based on ASCII characters. I'm doing the Embedded side and was wondering if
anyone knows of a terminal program which would send out characters of the
form;

"[STX]A5B8E00[ETX]"      ; no quotes, but the rest applies

this translates to a serial stream

DATA  | ASCII
--------------
0x02    ; [STX] - this is fixed in the protocol
0x41    ; "A"   - could be any ASCII character
0x35    ; "5"   - ditto
0x42    ; "B"
0x38    ; "8"
0x45    ; "E"
0x30    ; "0"
0x30    ; "0"
0x03    ; [ETX] - this is fixed in the protocol

I'm trying to test my code without the serial program (written by another)
but still connected to the computer. One last thing, I don't want any
carriage return(CR) or line feed(LF) until at least after the "ETX".

It's been a while but I seem to recall some old terminals (VT100?) which did
something like above using timeouts on the keyboard?

I would be very appreciative to anyone out there with helpful hints. TIA.

Cheers,

Kevin

1999\09\06@174013 by Mike Keitz

picon face
On Sun, 5 Sep 1999 00:32:40 -0700 Kevin Fisk <.....kfiskspamspam.....WKPOWERLINK.COM>
writes:
I'm doing the Embedded side and was
> wondering if
> anyone knows of a terminal program which would send out characters
> of the
> form;
>
> "[STX]A5B8E00[ETX]"      ; no quotes, but the rest applies

The old "Terminal" program supplied with Windows 3.1 would allow you to
enter a macro that would send several characters each time the user
presses a function key or clicks a button on the window.  This function
seems to not be in the "Hyper Terminal" supplied with Windows 95 and 98,
but it should be in most third-party terminal programs or you could find
a copy of the old Terminal.  Also it would not be hard for someone
familiar with BASIC or C to write a program to do this.


___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: dl.http://www.juno.com/dynoget/tagj.

'[PICList Admin] possible service problems?'
1999\09\21@101343 by Mark Willis

flavicon
face
I've heard a lot of reports of people having problems getting their
e-mail;  I'm sure they won't see this, of course, but apparently a mail
machine or packet router or 10 are having problems.  Everything's
working just fine HERE, fortunately.  (Which is good, I'm sorta cranky
from filling a 27' U-Haul with boxes of computer parts yesterday...)

Patience, if you're affected, and please pass error messages to me if
you get some ("Could not deliver mail" reports tell a lot about what's
wrong on the Internet.)  Now, what was that Internet Traffic Report URL,
I should go look there <G>

 Mark

'[PICList Admin] False "Rejected" messages...'
1999\09\29@005311 by Mark Willis

flavicon
face
One person's ISP is generating these from sirius.com;  If you get one,
you'll see two x-comment lines, in the headers, the upper one being from
mail1.sirius.com (or mail2.sirius.com or some other server there.)

Ignore them, for now;  I've asked them to solve it, if not done soon
I'll possibly solve the problem another way.

 Mark


'[PICList Admin] Coming soon, perhaps: "Pretty Park'
1999\10\03@183526 by Mark Willis
flavicon
face
I'm not sure when or if it'll come to this list, but...  There's a
"c:\coolprogs\Pretty Park.Exe" Win9x virus out, making the rounds, just
like Happy99.Exe did a short while ago.  Be forewarned, not infected!

If you run it, "enjoy" the results;  I am not sure if this one wipes
your HDD or not, but it certainly passes itself as an e-mail to everyone
you know - so we'll know you messed up...

"Let's not and say we didn't", though, folks!

 Mark, "Practice safe Hexadecimal"  (or Octal <G>)

'[PICList Admin] "Houston, we have a problem."'
1999\10\09@031723 by Mark Willis

flavicon
face
We seem to be having doubling of PICList messages, due to some account
or another.  Both my & Jack Shidemantle's 12C50x posts have doubled,
among others I'm sure.  We'll try to track that down & solve it.  If
some of you get "Rejected posting" posts & can pass headers (the
'unreadable junk' in the body of the message) to me, it'll help me
figure out where this is coming from.

 Mark

'[OT] Re: [PICList Admin] "Houston, we have a probl'
1999\10\09@115114 by Richard Martin

picon face
Gee, Mark I thought it was that you and  Jory had a program that
'doubled' all posts that included the word 'PIC' < or anything
vaguely related> in an effort to jack up the SNR on the list.

R.Martin

Mark Willis wrote:

> We seem to be having doubling of PICList messages, due to some account
> or another.  Both my & Jack Shidemantle's 12C50x posts have doubled,
> among others I'm sure.  We'll try to track that down & solve it.  If
> some of you get "Rejected posting" posts & can pass headers (the
> 'unreadable junk' in the body of the message) to me, it'll help me
> figure out where this is coming from.
>
>   Mark

1999\10\09@115118 by Richard Martin

picon face
Gee, Mark I thought it was that you and  Jory had a program that
'doubled' all posts that included the word 'PIC' < or anything
vaguely related> in an effort to jack up the SNR on the list.
Duhh... must be a S/W gremlin afterall. Shucks.

R.Martin

Mark Willis wrote:

> We seem to be having doubling of PICList messages, due to some account
> or another.  Both my & Jack Shidemantle's 12C50x posts have doubled,
> among others I'm sure.  We'll try to track that down & solve it.  If
> some of you get "Rejected posting" posts & can pass headers (the
> 'unreadable junk' in the body of the message) to me, it'll help me
> figure out where this is coming from.
>
>   Mark

'[PIC's] Some Explanations please'
1999\10\11@170544 by John De Villiers

flavicon
face
I've gone through the picNpoke tutorials, and now i have a few questions.

1) What does open collector output mean. What should i consider in the
circuit diagram for this pin.
2) What does weak pull-ups mean.
3) Is there a latency between setting a pin to high and when it actually
does go high, and if there is, what should my minimum time delay be if i
want to take it high and low very fast - ie 400ns ( 10 MHZ low instuction
immediately after a high )
4) if RB7:4 is set to interrupt and RB5&4 are to outputs, will i
inadvertently generate an intterupt when i write to bits 4 and 5.
5) does anyone have a 5digit bcd to 16bit binary routine please. My mind is
going numb trying to work that one out. i can do it on paper though

6) I want to use a pic for a dimmer switch. what is the easiest way to tap
5vdc from a 220vac line. I want to mount it inside the light switch cover if
at all possible.

thats all for now

thanx in advance

John

1999\10\11@191202 by Tony Nixon

flavicon
picon face
John De Villiers wrote:
>
> I've gone through the picNpoke tutorials, and now i have a few questions.
>
> 1) What does open collector output mean. What should i consider in the
> circuit diagram for this pin.
> 2) What does weak pull-ups mean.

These subjects are covered in PicNPort under [Open Collector] and
[Pullups].

You can think of an open collector output as a transistor switch
connected to ground. When the output is set to logic 1, the switch is
OFF and the pin is in a high impedance state. Logic 0 turns the switch
on and a current path to ground is produced. This means an open
collector pin can only sink current into the pin. It cannot source
current out of the pin.

> 3) Is there a latency between setting a pin to high and when it actually
> does go high, and if there is, what should my minimum time delay be if i
> want to take it high and low very fast - ie 400ns ( 10 MHZ low instuction
> immediately after a high )

Looking at the AC characteristics in the data sheet is a bit vague. It
appears there is a delay for the port pin to react which seems to be
TosH2ioV, but no timing figures are mentioned. A lot also depends on
what is connected to the pin.

> 4) if RB7:4 is set to interrupt and RB5&4 are to outputs, will i
> inadvertently generate an intterupt when i write to bits 4 and 5.

According to the data sheet, the interrupt on change feature is only
active on pins set as inputs. There is an AND gate controlled by the
TRIS latch which masks the port change.

> 5) does anyone have a 5digit bcd to 16bit binary routine please. My mind is
> going numb trying to work that one out. i can do it on paper though

A simple but perhaps long method is..

while X is positive (subtract 10000 - increment 10000 counter) else add
10000
while X is positive (subtract  1000 - increment  1000 counter) else add
1000
while X is positive (subtract   100 - increment   100 counter) else add
100
while X is positive (subtract    10 - increment    10 counter) else add
10
while X is positive (subtract     1 - increment     1 counter)

> 6) I want to use a pic for a dimmer switch. what is the easiest way to tap
> 5vdc from a 220vac line. I want to mount it inside the light switch cover if
> at all possible.

Can't help there, I haven't tried it, but be careful or you may be the
XMAS tree lights this year.

--
Best regards

Tony

http://www.picnpoke.com
Email salesKILLspamspamEraseMEpicnpoke.com

1999\10\11@193654 by Thomas Brandon

flavicon
picon face
I'm by no means an expert but I think I can cover these.
----- Original Message -----
From: John De Villiers <EraseMEjd62@spam@spam@spam@PIXIE.CO.ZA>
To: <@spam@PICLISTspamspamKILLspamMITVMA.MIT.EDU>
Sent: Tuesday, October 12, 1999 7:03 AM
Subject: [PIC's] Some Explanations please


> I've gone through the picNpoke tutorials, and now i have a few questions.
>
> 1) What does open collector output mean. What should i consider in the
> circuit diagram for this pin.
Open collector was used for bus interfacing before 3 state outputs came
around. 3 state ouputs (like the normal PIC pins) have (surpisingly) 3
states, high (+5V), low (GND) and High impedance (a.k.a High-Z, Z etc). The
high and low states are used when the pin is an output, the High impedance
when the pin is an input. This means multiple devices can be connected and
inactive devices simply go High-Z.
Open collector provides a similar end result with a different method.
Unfortunately you'll have to get someone else to explain exactly what it is.
If your using it as an input pin then noi modifications are needed. If
you're using it as an ouput you need a pullup resistor. A pullup resistor is
a resistor placed between the pin and +5V, this means that when the pin is
high it w3ill be "pulled up" to a full +5V, otherwise it's simply low.

> 2) What does weak pull-ups mean.
Same thing as in open collector. Don't know quite whjy there weak, or when
you would use them\not use them.

> 3) Is there a latency between setting a pin to high and when it actually
> does go high, and if there is, what should my minimum time delay be if i
> want to take it high and low very fast - ie 400ns ( 10 MHZ low instuction
> immediately after a high )
Due to the instruction pipelining of the PIC, pins are written at the end of
each instruction cycle, so there is that lag, but that's transparent from a
coding point of view as all writes happen at the same point in the
instruction cycle.However, reads occur at the start of the instruction,
Hence reads  should not directly follow writes in general. There is also a
delay added to the voltage change on the actual pin. This is due to the
capacitance on the pin and can be limited by a series resistor on the output
pin. I have only seen this mentioned when the Clock Tick on external pulse
feature is used and thus sub 1 instruction rise falls are neccesary. I'm
pretty sure you should have no problems with sequential writes at only
10MHz.

> 4) if RB7:4 is set to interrupt and RB5&4 are to outputs, will i
> inadvertently generate an intterupt when i write to bits 4 and 5.
No, if a pin is set to output it will not set the appropriate interrupt
flags (I gather it just doesn't set them) and no interrupt will be
generated.

> 5) does anyone have a 5digit bcd to 16bit binary routine please. My mind
is
> going numb trying to work that one out. i can do it on paper though
Microchip Application Note 526 - PIC16CXXX Math Routines has routines for
2bit binary -> BCD and 5bit binary->BCD in both directions.
>
> 6) I want to use a pic for a dimmer switch. what is the easiest way to tap
> 5vdc from a 220vac line. I want to mount it inside the light switch cover
if
> at all possible.
This is not my area of expertise. Inside a lightswitch covber might be a bit
of a tall ask. From memory, you need a transformer to get to about 15V AC, A
bridge rectifier to get 10-15V DC and a 5V regulator (prob. need a resistor
before or lower the input). But, I could be wrong. Not sure about the
lightswitch, depends how big it is.
>
> thats all for now
>
> thanx in advance
>
>  John

1999\10\11@201300 by Reginald Neale

flavicon
face
>6) I want to use a pic for a dimmer switch. what is the easiest way to tap
>5vdc from a 220vac line. I want to mount it inside the light switch cover if
>at all possible.
>

Email me in 12 hrs, I'll be at work where my files are. There is a
suggested circuit contributed by a Yugoslav engineer and I've got the code
for it somewhere. IIRC there were three implementations - the first was
just a switch, the second used an up and a down pushbutton to set the power
level. Both of those worked with a 12C508/9. The circuit uses a primitive
power supply that operates right off the 240V 50Hz line. The third one used
a 12C671/2 and a pot.

Eduardo Rivera also did some experimenting with this circuit. He put some
info up on his website at umemphis.edu. You still around, Eduardo?

If you're only talking about a couple of hundred watt load, the circuit and
the SSR should fit into an outlet box OK.

Reg Neale

1999\10\11@202301 by hris Fanning

flavicon
face
[snipsnip]
> This is not my area of expertise. Inside a lightswitch covber might be a bit
> of a tall ask. From memory, you need a transformer to get to about 15V AC, A
> bridge rectifier to get 10-15V DC and a 5V regulator (prob. need a resistor
> before or lower the input). But, I could be wrong. Not sure about the
> lightswitch, depends how big it is.

Check out this link for small cheap mains power:
 http://www.edtn.com/scribe/reference/appnotes/md004556.htm

Before I go off and use something like this, does anyone care to tell
me how crazy I'd be?  Or is this accepted practice?

I'm going to start a project soon that will run from mains power and this
looked simple enough.  However, I need to switch different power sources
to control various equipment (and do incandescent style dimming on a heater
element) say, 12VDC, 24VDC and 120VAC.  I'd like to set as few fires as
possible, but I'd like to use inexpensive electronic switching - TRIACs?
Because of the dimming control, relays are obviously out of the question.

I have pretty good digital background w/programming and design, but haven't
done much in the analog world.  Don't want my feet to get cut off.

I'm really asking because I figured I could just use a PIC pin and resistor
to check out zero crossing.  But after that other thread I figured it was
better to ask. :)

Chris

1999\10\11@225117 by Dave VanHorn

flavicon
face
I'll tackle the first two, and let a person more in sync with the pics do
the others.

> 1) What does open collector output mean. What should i consider in the
> circuit diagram for this pin.

This means that the output cannot by itself create a logic high. It can pull
current to ground, but it cannot output current to a load.  The output
circuit would look like an NPN transistor's collector, with the emitter tied
to ground.

> 2) What does weak pull-ups mean.

The chip has pullup resistors, which you might use with switches, such that
in the absense of any completed circuit to ground, the input reaches a high
state.  The pullups are "weak", in that they won't source much current.
Exact figures probably vary from chip to chip.

A strong pullup would be a 1 ohm resistor to VCC, a "weak" pullup might be
more like 100k.

1999\10\12@034552 by Michael Rigby-Jones

flavicon
face
       <snip>
       John De Villiers wrote:
> > 3) Is there a latency between setting a pin to high and when it actually
> > does go high, and if there is, what should my minimum time delay be if i
> > want to take it high and low very fast - ie 400ns ( 10 MHZ low
> instuction
> > immediately after a high )
>
       Thomas Brandon replied:
{Quote hidden}

I had endless troubles at only 4MHz due to driving a mosfet H-bridge which
must have had quite a high capacitance.  One NOP between consecutive bit
operations on the port cured it, but I felt worried about it so in the end I
only set bits in a shadow register and wrote the register to the port to
avoid all this.  It is very annoying to have to do this though.  It would be
great if there was an option to make the PIC read from the output latch when
TRIS=0, and from the pin when TRIS=1.  Bit manipulation of output ports is
where microcontrollers are supposed to shine, not so in the case of the PIC.
(Is the Scenix any better or the same?  I would think that it must be
improved for operation at 50+ MHz)

Mike Rigby-Jones

'[PIC][admin][OT][TECH][FLUFF][WHINE]and 18F87x ava'
1999\10\13@123452 by mjurras

picon face
How about we add [WHINE] to the headers for all you guys who constantly bitch ab
out how the list
isn't formatted exactly to you specific wants for efficient reading. This will g
ive you something
to look forward to reading.

Or, maybe you could just learn to deal with it. It isn't that hard. If you can't
go to onelist.com
and start your own.


Now for some real content. I am starting a new design and have been noticing pos
ts about the lack
of availability of the 16F87x. Digikey also shows naught available. Should I lea
ve my ICD in the
box and use an available part or is the 16F87x going to be available 1Q 2000?

- -Mark
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

1999\10\13@185355 by Tony Nixon

flavicon
picon face
Mark Jurras wrote:

> Should I leave my ICD in the box and use an available part or is the 16F87x go
ing to be > available 1Q 2000?

That's probably where all the stocks of F87X chips have gone. Into the
Microchip ICD's :-)

--
Best regards

Tony

http://www.picnpoke.com
Email spamBeGonesalesRemoveMEspamEraseMEpicnpoke.com

'[PICList] Mini-FAQ, Revised Oct. 14, 1999 (Pre-Dra'
1999\10\15@061902 by Mark Willis

flavicon
face
Worked more on this, it's still at a place where:

It needs some serious work!  This is still a PRE-Draft, not the real
thing <G>

Here's the draft, somewhat edited, "It won't even compile yet" <G>:

---  Begin  ---
   HOW TO UNSUBSCRIBE

There is one way that works to get off the list.  DO NOT post to the
list.  This might get you off, but is the worst way to do it; A post to
the list goes to all subscribers, is VERY slow and gets everyone angry
with you.  If Jory & Mark miss seeing it (and they may not read all
of every post, and may occasionally take a day off), you don't get off
the list.

The best, fastest way is to post to the PICList "Command Input Port":

RemoveMELISTSERVKILLspamspamRemoveMEMITVMA.MIT.EDU (i.e. TakeThisOuTLISTSERVspamMITVMA.MIT.EDU)

from the address at which you are subscribed, containing nothing but

unsubscribe PICList

in the first line of the message.  This is automatically executed and is
the fastest method.  The message must contain the exact words
"unsubscribe PICList", no other spelling works.  You'll get a
confirmation e-mail, with directions on how to confirm (Basically: just
reply with the word "ok" in the body), and you'll be off the list.

 If you are trying to unsubscribe from an address different from the
one you subscribed from, probably best to send an e-mail to
spamBeGonePICList-RequestKILLspamspamTakeThisOuTMITVMA.MIT.EDU (E-Mail to that address is copied to
all of the list admins), and clearly ask to have your OLD address
unsubscribed.  I cc my response to your old & new addresses (As a
courtesy), and if I'm not here Jory can catch you, this way.

 If you have difficulties, or do not understand what to do, send an
e-mail message to EraseMEPICList-Request.....spamKILLspamMITVMA.MIT.EDU, and one of us will
try to help you.  Do tell us you want help with the PICList as we both
are on / run more than one list!

   PURPOSE and ETIQUETTE

 This list is for the specific purpose of providing a forum about the
use, learning about, safety with, and enjoyment of MicroChip PICs. Other
support "Glue" chips are acceptable off-topic subjects, to some extent.
Questions about Sensors, power supplies, safely running your PIC project
on a car or airplane's electrical system, are also quite acceptable
off-topic subjects;  See the Beginners' FAQ questions later for markings
for OT questions.

 Commercial posts, flaming, spamming, virus warnings, etc. do not
belong in this mailing list, and posting same could result in our
removing you from the list.  (Post to the Admins, let US warn the list,
that way we just see one warning on the list, not 1200!)  Humor happens
here, and is welcome so long as it doesn't result in bodily harm from
too many list readers falling out of their chairs, and so long as it's
kept in reasonable bounds.  Humor isn't the purpose of the list, but the
good laugh provided (relevant to PICs especially) is very welcome on
occasion!  (At the same time, too much of a good thing, is too much.)
Use your judgement and good sense and experience as a guide.

 Posting messages to the list is restricted to subscribers, who are
defined as anyone posting with a logon name and address identical to one
in the list of subscribers.  You cannot post to the list either from a
different address or if you are unsubscribed.

 [For more information about this mailing list, post to:

spamLISTSERVspamMITVMA.MIT.EDU (i.e. LISTSERVSTOPspamspamMITVMA.MIT.EDU)

with the text

info PICLIST

in the first line of your message.  Also read
http://www.wasp.co.za/~tjaart/piclist.html, Tjaart's handy web page.
Also, see the Archives at http://www.iversoft.com/piclist.]

 This Mini-FAQ is posted by Mark Willis monthly (early in the month),
to help Jory out.  Suggested updates or changes, Post to:

<PICList-RequestSTOPspamspamKILLspamMITVMA.MIT.EDU>

 Mark will post this with this EXACT same title [unless revised, then
the revision date will change] to help keep the list uncluttered with
"unsubscribe" requests, and will e-mail it to anyone on request.

   Newbie FAQ topics and questions:

"RA4 doesn't behave right.  It will pull down, but not up, even though I
set it as an output pin & am writing a '1' to it."

RA4 is an open drain (same as an open collector basically) output pin.
You need to either (a) use a different port pin, or (b) put a pull-up
resistor from that pin to Vdd (+5V typically), to make the pin pull up
as default.

"When I set a port pin as an input, then ground & unground it with a
switch, it sometimes works & other times doesn't work."

You have a floating input;  You want to use a pull-up or a pull-down
resistor, if you are driving this pin with an open drain or a switch to
Vcc or Ground, directly. {mention weak pull-ups?}  10k is a good value
here.

"How do I describe my code that's not working well, to the list?"

It helps a lot if you post an URL (if the code's large), or the
offending 15-20 lines or so, to the list (Some people pay for their
connect time by the minute, so keep it as short as you can;  OTOH, some
people read the list offline, so they cannot help you if you have short
code snippets & don't include them, use judgement here.)  It also helps
if your code uses standard include files, and you describe the schematic
somewhat (i.e. if your code is toggling ra4, and we don't know that you
want it to toggle rb4, we'll wonder what problem exactly you're having
<G>)  It also helps to have a clear idea what the problem you perceive,
IS, what you observe, and what you expect / want to heppen!  Posting a
short message asking for help, with a good descriptive Subject line like
"Need a mentor, 16F84 Remote Tachometer for R/C boat", then giving the
person who volunteers all the info you have, can be more effective than
asking a really good question, but using a completely non-descriptive
Subject line like "problem" or "Help me!".  Think a little on those
subject lines, try to distill your whole post into that line, and you'll
get faster answers.

"My Windowed part works one way usually and sometimes another, now I
burned an OTP part and it behaves in the undesired of the two above."

You need to cover the window on /JW parts, then they'll not have memory
contents affected by ambient light;  I use a small piece of foil,
covered by electrical tape, this is simple to clean, for erasing, and is
very opaque to even IR light (Most electrical tape's transparent to IR
light somewhat.)  If you're doing repeated burns & erase cycles, can use
a small piece of thick cardboard or something like that, you mainly want
to block visible light (when indoors, which is where most of us work.)

"I want to post a request for information that no-one else on the list
may want to hear about;  What do I do?"

Sidestep for a second;
We use the subject line to mark posts for what their content is;  It's
good to post a question like "What's the difference between a 16F84 and
a 16F84A", with something like "Differences between 16F84 and F84A?" as
a subject line.  Many people won't read posts if they don't know what
it's about.

Now back to your question;
We use the flag [OT] to designate that a particular post is Off Topic
for the PicList.  This doesn't always mean that no-one on the list wants
to see your post;  It means that you know you're posting not strictly
about PICs, PIC Programming, or other goodies attached to PICs, but you
still need the information.  So, there are sort of 4 categories:

{Still working on this, folks, so let us polish this up & we'll see
where it goes.}

#1:  Directly related to PICs.  Programming questions, misbehavior
questions, code optimization, Post to the list.

#2:  Stuff attached to a PIC project;  Hooking up to the points on your
older car to make an electronic ignition module, for example.  Right
now, this is marked either with or without [OT], we're probably
migrating to a [Tech] marking for this, to clarify things.  Time will
tell.

#2a:  Electronics Related stuff;  Atmel, Scenix, Motorola, etc.
processors, coding, projects, etc.;

#3:  Stuff that's sort of off-topic for the PICList, but still technical
in nature;  Some of this would be good for posting to the list directly,
with an [OT] marking (for example, the recent Train threads, which have
wandered the gamut from Train braking by PIC-controlled rocket motors,
to kids' educational toys, some of these threads are quite hypothetical
& non-PIC related;  If you wander too far afield, but think most other
PICList members will enjoy what you have to post, consider posting your
reply under an [OT], changed subject line;  Minimize this somewhat, as
otherwise one thread breaks into 157 threads, though.

#3a:  Reminisces about the bad old days in High School when you blew up
$12 worth of electronics project by applying too high a voltage;
Probably post as [OT] to the list, some of those have been pretty
hilarious <G>

#3a:  Questions that're PICList related but don't need discussion on the
list, for example a tutorial about drilling 0.010" holes through 0.020"
wire (I want to know, but not everyone will), probably best if these are
posted to the list with Reply-To set to your personal e-mail address,
and you ask people to post to you personally;  Also good if you post

#4:  Political opinions, Religions opinions, SPAM, personal flames,
fighting, and so on;  We've been perhaps too lenient, and I suspect
we'll start throwing people off the list in future, for these.  If you
want to say something like this, you can use your signature line to
state your opinion, provided it's not flaming someone;  If someone posts
completely off topic on this, please post at them off the list, not ON
the list, as (even though we've been pretty mellow) we are likely to use
automated processes in future to end threads that're destructive.  More
later on this.

"Why all these different subject headers?"

Some people on the PICList want JUST PIC programming and code
optimization information - they're too busy, or uninterested, in the
other categories.

Some people want it all, want to talk about their R/C plane that crashed
because they forgot to re-attach the antenna, about what processor(s)
are best for their project, and so on.

Many are somewhere in the middle.  If we all use these conventions,
we'll be able to pick & choose what posts interest us most, and read
those first, as well as to ignore or read last, those we don't care so
much about.  Some people don't have a lot of time during the week, and
would like sleep after a 14 hour day & 3 hours of commuting, they want
to only spend 15 minutes or so reading the PICList, not 3 hours <G>

{I'm tired & need to work more on ALL of this - Comments?  Volunteers to
take the Mini-FAQ over as I get HEAT in this place, and get more
computers running?}

---  End  ---

 Mark, @spam@mwillis.....spamspamFoxInternet.Net

'[PICs] Stepper motor control'
1999\10\17@172507 by John De Villiers

flavicon
face
Im turning a large disk with a stepper and a pic.

The gearing that i use gives me several thousand possible stops (steps) in
one revelution of the disk. If the step number of the current point is
known, and the step number of the destination is known, how would i calulate
the shortest route ( clockwise or anti clockwise )??

Lets assume the step number is a 16bit variable.
Also assume that there will always be an equal number of stops.

John

1999\10\17@182225 by Sean H. Breheny

face picon face
A=Total number of steps
B=current step number
C=Destination step number

Let's assume that the step numbers increase clockwise

D = C - B
If ABS(D) < INT(A/2) then Result = D:done
If D > 0 then Result = D - A + 1:done
Result = D + A - 1
done

Where INT means take only the integer part and ABS is the absolute value
function.

Result is the number of steps that need to be taken. If it is positive, go
clockwise. IF negative, go counter clockwise. If zero, stay where you are.

The idea is this: If C>B then you should go clockwise if C-B is less than
half way around (hence the A/2). Otherwise, you should go the other way
around. Similar argument for C<B

Sorry, I don't have time right now to turn this into PIC code,but it should
be easy to do ;-)

Sean

At 11:25 PM 10/17/99 +0200, you wrote:
{Quote hidden}

| Sean Breheny
| Amateur Radio Callsign: KA3YXM
| Electrical Engineering Student
\--------------=----------------
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
spamshb7.....spam.....cornell.edu ICQ #: 3329174

'[PIC's] Some Explanations please'
1999\10\18@001459 by Sean H. Breheny

face picon face
I think that the Scenix works the same way,but I was very impressed with
its ability to drive a capcitive load on a pin. I had a test circuit with a
Scenix at 50Mhz driving a scope probe with about 20pF of capacitance. The
waveform easily reached the full 5v between consecutive SNB/CLRB
inctructions, with no NOPs. It was a while ago, but I think the rise time
was about 10ns.

Sean

At 08:44 AM 10/12/99 +0100, you wrote:
{Quote hidden}

| Sean Breheny
| Amateur Radio Callsign: KA3YXM
| Electrical Engineering Student
\--------------=----------------
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
shb7.....spamcornell.edu ICQ #: 3329174

'[PICList] Mini-FAQ, Revised Oct. 14, 1999 (Pre-Dra'
1999\10\18@102303 by eplus1

flavicon
face
The address you mention for Tjaart's handy web page results in the following
message:

Forbidden
You don't have permission to access /~tjaart/piclist.html on this server.

As he is no longer a participant in the PICList, I have asked Tjaart for the
page and have modified it and posted it at the address on the bottom of my
signature. If you don't mind I will add this [PICList] Mini-FAQ to that
page. <WHINE> I notice that you didn't mark this post as [OT] or as [ADMIN]
but as [PICList] which I don't think you have mentioned as a category marker
in the past. </WHINE><DUCKING><GRIN>

I would much rather see these pages posted at http://www.piclist.com (Which Jory
must allow/setup) or http://www.piclist.org or .net which is available to anyone
with the necessary resources ($70/2years and access to a server). I have the
server but not the $70.

Please feel free to take anything from my PICList page(s) to use as you
wish. I will try to write more as time allows to help as I can.

James Newton KILLspamjamesnewtonspam_OUTspamgeocities.com phone:1-619-652-0593
http://techref.homepage.com NOW OPEN (R/O) TO NON-MEMBERS!
Members can add private/public comments/pages ($0 TANSTAAFL web hosting)
PICLIST guide: http://204.210.50.240/techref/default.asp?url=piclist.htm


{Original Message removed}

'[PICs] Stepper motor control'
1999\10\18@152734 by Lawrence Lile

flavicon
face
Interesting problem, John.

Try this idea:

Say your present position is 1000.  You want to go to 1050.  and the
shortest route is clockwise.

Assume there are 65536 possible positions

1050 - 1000   is less than    65535 - 50.

Therefore,  subtract the present position from the desired postition, and
the desired position from the MAXIMUM number of positions.  the comparison
will give you the shortest route.



{Original Message removed}

'[PICs][newbie] MPLAB help'
1999\10\24@183049 by John De Villiers

flavicon
face
I need help with MPLAB.

Im busy with a cicuit design and at the same time im writing the code for
it. With some of the i/o lines i havent decided on what ports they should go
yet.

At the moment my code looks something to the effect of

       bsf     porta,0
       bcf     porta,1

Is there a way i can define names for porta,0 and porta,1 so that in the
code i can use the names, instead of the pin names? Then if i move something
around, all i need to do is change the name -> pin assignment and recompile,
instead of searching all the code for porta,0 etc.

Regards
  John

PS - does anyone know off-hand what the length (time) of a spark is in a
vehicle with electronic ignition ?

1999\10\24@185131 by Thomas C. Sefranek

face picon face
John De Villiers wrote:

> I need help with MPLAB.
>
> Im busy with a cicuit design and at the same time im writing the code for
> it. With some of the i/o lines i havent decided on what ports they should go
> yet.
>
> At the moment my code looks something to the effect of
>
>         bsf     porta,0
>         bcf     porta,1
>
> Is there a way i can define names for porta,0 and porta,1 so that in the
> code i can use the names, instead of the pin names?

Sure!

Declare constants for the pin numbers.

Plug1    EQU    0
Plug2    EQU    1
Plug3    EQU    2
etc....
Then you code can be:

   BSF    PORTA,Plug1
   BCF    PORTA,Plug2

> Then if i move something
> around, all i need to do is change the name -> pin assignment and recompile,
> instead of searching all the code for porta,0 etc.
>
> Regards
>    John
>
> PS - does anyone know off-hand what the length (time) of a spark is in a
> vehicle with electronic ignition ?

--
Thomas C. Sefranek  WA1RHP
ARRL Instructor, Technical Specialist, VE Contact.
http://www.harvardrepeater.org
http://hamradio.cmcorp.com/inventory/Inventory.html

1999\10\25@111751 by Lea

picon face
At 12:29 AM 10/25/99 +0200, you wrote:
>        bsf     porta,0
>        bcf     porta,1
>
>Is there a way i can define names for porta,0 and porta,1 so that in the
>code i can use the names, instead of the pin names? Then if i move something
>around, all i need to do is change the name -> pin assignment and recompile,
>instead of searching all the code for porta,0 etc.

Hi John
you can doit, It is very helpfull to know what are you turning setting or
clearing
when writing the code :-).
here is an example:

#define        _txda           PORT_A,1         ;SPI txdata
#define        _rxda           PORT_A,2         ;SPI rxdata
#define        _we             PORT_A,3         ;write enable/1

I usually do it at the begining of the program.

so if you whant to do : BCF PORT_A,1
              just do  BCF _txda
easier isn't it?.

Hope it helps.
see you.
  Leandro J. Laporta (LU2AOQ)
  mail: spam_OUTlu2aoqspamTakeThisOuTyahoo.com
  wrk: Arg. Assoc. for Space Technology.
  ham: TCP/IP high speed group HSG

1999\10\25@123230 by Dwayne Reid

flavicon
face
>Is there a way i can define names for porta,0 and porta,1 so that in the
>code i can use the names, instead of the pin names? Then if i move something
>around, all i need to do is change the name -> pin assignment and recompile,
>instead of searching all the code for porta,0 etc.

Sure!  Use the #define function in MPLAB.  The following is snipped from
working code.  Note that I define all bit variables with a leading
underscore - this is *MY* convention and not required by MPLAB.

To change the pin assignment for any i/o line, all I have to do is change
the #define in ONE location.

; PORT A Device Bits    note: ra 0,1 a/d inputs so no labels for them
   #define _MUXCLK  RA,2        ; RA2, a/d ext mux clk out (active LO)
   #define _MUXRST  RA,3        ; RA3, a/d ext mux reset out (active HI)
   #define _PBWR    RA,4        ; RA4, "WRITE" button (active LO)
   #define _PBRD    RA,5        ; RA5, "READ" button (active LO)

RA_INIT         EQU b'00010000' ;
DDR_A           EQU b'00110011' ; ddr: ra 2,3==out,  ra 0,1,4,5==in
DIPWRMSK        EQU b'00010000' ;
DIPRDMSK        EQU b'00100000' ;

; PORT B Device Bits
   #define _IPCRXD RB,0        ; RB0, IPC data input (active LO)
   #define _IPCTXD RB,1        ; RB1, IPC data out (active HI)
   #define _DHTRLD RB,2        ; RB2, display heater LEDs data output
   #define _DSTAT  RB,3        ; RB3, display status & inputs (bi-dir)
   #define _STROBE RB,4        ; RB4, ctrl, DipSw, disp str, eeprom !CS
   #define _SERCLK RB,5        ; RB5, ctrl, DipSw, display CLOCK
   #define _EECLK  RB,6        ; RB6, eeprom clock
   #define _SERDAT RB,7        ; RB7, ctrl, DipSw, eeprom DATA (bi-dir)

RB_INIT         EQU b'00000001' ;initial port B data status
DDR_B           EQU b'10001001' ;ddr: rb 1,2,4,5,6==out,  rb 0,3,7==in
DDR_BLO         EQU b'10001001' ;AND  0s force bits LO
DDR_BHI         EQU b'00000001' ;OR  1s force bits HI

Hope this helps.

dwayne



Dwayne Reid   <.....dwayner.....spamRemoveMEplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 15 years of Engineering Innovation (1984 - 1999)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
My posting messages to Usenet neither grants consent to receive
unsolicited commercial email nor is intended to solicit commercial
email.

'[PIC] PC/104 form factor'
1999\10\28@001205 by Keith Causey

picon face
Thanks Dave - Samtec says 6 similar sample sockets have been shipped! -
Keith Causey

> Try Samtec at http://www.samtec.com .  The Samtec part numbers are
> ESQ-132-39-G-D for P1 and ESQ-120-39-G-D for P2.  Also try the PC-104
> consortium at http://www.pc104.org .

'[PIC] Measuring Analog Voltages w/o Sharing Ground'
1999\10\28@102613 by Andy Kunz

flavicon
face
I'm working on a data logger which is a little different than what I've
done before.

I have three independent circuits (Power, Control, and Monitoring).
Control and Monitoring _may_ share a ground, but this is neither necessary
nor preferred by the customer.

Power must be as isolated from Control or Monitoring as possible, as the
Power circuit gets a lot of noise on it and Control is susceptible to noise :-(

My project is to provide data to the Monitoring system (and ground and
power may both be shared).

Required data:

a) Average Voltage to Power circuit.  Power is a 6V-24V source to a 70A
load switched at 3KHz to control motor speed.  The motor has a nasty back
EMF spike.  We need to see the average voltage during the last 100mS.
b) Average Current in Power circuit.  Average current during the last 100mS.
c) Voltage of Control circuit.  Control is a 3-6V source for a 75mA-300mA
typical load, with occasional 1A loads.  The power supply is well able to
provide 1A with minimal drop for short periods.
d) Voltage of Monitor circuit.  Monitor is a 4.5-5.5V source (I'm
investigating whether they will use NiCd or Li technology).  It is a PIC
driving an Atmel serial DataFlash chip (which I'm not sure yet, probably
the 4M piece), so it will have bursts of "high" current.  Supply will have
no problem providing this.

All data points will be sampled at 10-30 Hz (selected by customer at
runtime, with no hardware changes permitted).  8-bit data is sufficient at
this stage, but they may want 10-12 bit in the future.

The software (PIC) is essentially done - I just borrowed another data
logger I did.  The hardware is a problem.

The Monitor circuit is supposed to be small (as small as possible) and
needs to run at least 1 hour on batteries (NiCd rechargeable or Li coin
cells).  Of course it's mobile, and will use an RS-232 interface to
transfer data to a laptop, either during operation or at the end of a
testing period.

Test points for the Control circuit is an existing jack into the system
(power and ground are on the connector, not a problem).

Test points for the Power circuit are another matter.  A connection to the
positive side of the supply is very easy, and to the negative side almost
as easy.  Connection for the ammeter function would be easily accomplished
on either the high side or the low side of the supply, but it needs to
introduce as little resistance as possible (they don't want to hurt
performance of the system).

Now my question:

How do I hook these separate analog signals up without sharing the ground
with the Power circuit?

Thanks.

Andy



==================================================================
Eternity is only a heartbeat away - are you ready?  Ask me how!
------------------------------------------------------------------
spam_OUTandyTakeThisOuTspamEraseMErc-hydros.com      http://www.rc-hydros.com     - Race Boats
EraseMEandyspamBeGonespamKILLspammontanadesign.com  http://www.montanadesign.com - Electronics
==================================================================

1999\10\28@123249 by Dwayne Reid

flavicon
face
>I'm working on a data logger which is a little different than what I've
>done before.

<snip>

>
>Now my question:
>
>How do I hook these separate analog signals up without sharing the ground
>with the Power circuit?
>

It sounds as if your customer has SOME budget for moderately expensive
parts.  I'd use a 2 port or 3 port isolation amplifier.  I've used both the
Burr-Brown 3656 and the Analog Devices AD210 - I prefer the AD part.  They
cost about $50 USD and are worth every penny in situations such as yours.
They require a single 15 Vdc power source - this source can be isolated from
both the input and output.  The input looks like a standard op-amp - you
treat it as such when setting gain, etc.  The output is a unity gain op-amp.
There is auxiliary power available at both the input and output side of the
module.  The AD part is good for 10 or 12 bits of accuracy (I don't remember
the exact linearity spec).

PS - the difference between a 2 port and 3 port amplifier: the 2 port
generally shares a common ground between the output and power supply; the 3
port is completely isolated between input, output and power supply.  The
AD210 is spec'd at 2500 VAC between input and both other ports; 1000 VAC
between power and output.  They are tested and must pass at MUCH higher
voltages than those.

There are other ways around your problem, but the easy ones (much harder
than the isolation amplifier) don't have much accuracy.

Hope this helps.

dwayne


Dwayne Reid   <RemoveMEdwaynerspamBeGonespamspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 15 years of Engineering Innovation (1984 - 1999)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
My posting messages to Usenet neither grants consent to receive
unsolicited commercial email nor is intended to solicit commercial
email.

1999\10\28@125706 by Maverick

flavicon
face
>a) Average Voltage to Power circuit.  6V-24V
>b) Average Current in Power circuit.  Average current during the last 100mS.
>c) Voltage of Control circuit.  Control is a 3-6V source
>d) Voltage of Monitor circuit.  Monitor is a 4.5-5.5V source

>All data points will be sampled at 10-30 Hz (selected by customer at
>runtime, with no hardware changes permitted).  8-bit data is sufficient at
>this stage, but they may want 10-12 bit in the future.

>The Monitor circuit is supposed to be small (as small as possible) and
>needs to run at least 1 hour on batteries (NiCd rechargeable or Li coin
>cells).  Of course it's mobile, and will use an RS-232 interface to
>transfer data to a laptop, either during operation or at the end of a
>testing period.

>How do I hook these separate analog signals up without sharing the ground
>with the Power circuit?

Depends on what your design constraints are, obviously - how much additional
cost is acceptable, etc...  Do you intend to use the internal PIC A/D
converters or
an external part?  If you are using an external A/D, is that set in stone
or flexible?

This post intregued me because I've spent the last four years working
on EV telemetry and power systems, and we often face similar problems in
terms of noise,
coupling, floating voltages, and you name it...

Personally, I'd recommend you use true differential delta-sigma A/D
converters - and no,
before everyone jumps on me, these aren't necessarily out of the price
range on any reasonable
project - Analog's AD7705 is a relatively inexpensive (~$4 in small
quantity, I think) dual differential 16 bit D-S A/D that has an
SPI interface and works very nicely under extremely noisy conditions.
Because of the
integration-deintegration performed in the D-S process, noise and random
jitter in the data is reduced
significantly - to the point that one of these was used on the output of a
large (500W) switching power
supply to measure current through a shunt- and had consistent and accurate
average currents out to 10 to 12 bits
without a problem.  And with a main ground bus that can have ~2-3 volts of
ripple on it due to currents and inductive
kickback, this is no small feat!   Power consumption on these is very
reasonable for battery-based applications - I believe
they can be standby'd to 10uA or so...

If that isn't an option or you would prefer to use some other A/D
converter, just put an instrumentation amp on the
front end - these usually have two drawbacks:  they're expensive if you go
for really high-quality versions, and otherwise
their common mode rejection isn't the greatest at higher frequencies.
Since you're only looking for averages, though, you
could R-C integrate off all the high frequencies and leave the in-amp to
only convert the differential input signal you're
trying to monitor down to a "ground" referenced voltage for your circuit to
read.  I'm personally a fan of Burr Brown INA2128s, but
these are costly if you actually have to use them in a production circuit.
Analog also makes some very nice ones at lower cost, I
believe.  For your application, they also have one other drawback I just
thought of - they're usually current hogs.  On the order of ~20mA.


Just my two bits for the day...

ND Holmes




--------------------------------------------------------------------------
Nathan D. Holmes   @spam@maverickspamspamdrgw.net, TakeThisOuTndholmesKILLspamspam@spam@iastate.edu
  122 Shepard #3  Box 328  Gilbert, IA 50105  Iowa State University - EE
  http://www.drgw.net/~maverick   PH: 515-663-9368
-------------------------------------------------------------------------

1999\10\28@130104 by Maverick

flavicon
face
Concerning my earlier post concerning instrumentation amps or differential
ADCs, I feel I should mention
after reading Dwayne's post I rethought my assumption that these signals
are all loosely referenced to some theoretical "ground", your
problem was just that there was excessive noise floating around on the
power ground for the circuit that you didn't want
messing up your readings or coupling back into the signals being sensed...

If that isn't the case, pretty much everything I said is meaningless drivel
and just ignore it...

ND Holmes
--------------------------------------------------------------------------
Nathan D. Holmes   .....maverickRemoveMEspamdrgw.net, KILLspamndholmesspamTakeThisOuTiastate.edu
  122 Shepard #3  Box 328  Gilbert, IA 50105  Iowa State University - EE
  http://www.drgw.net/~maverick   PH: 515-663-9368
-------------------------------------------------------------------------

1999\10\28@131749 by Andy Kunz

flavicon
face
>If that isn't the case, pretty much everything I said is meaningless drivel
>and just ignore it...

But you said what I wanted to hear - don't take it all back!!!

I think Dwayne interpreted me more correctly.  I'm looking to keep these
other systems isolated from the Power system.  Not just because of noise,
but because it's possible that they are connected inadvertently and I don't
need to let magic smoke out of somebody else's equipment, let alone mine,
by picking up "ground" in different places.

What I need is some way to measure the Power parameters without being
electrically connected, in a way of thinking.  I would opto-isolate if
necessary, etc, but that gets into other problems (like real estate).

Andy

==================================================================
Eternity is only a heartbeat away - are you ready?  Ask me how!
------------------------------------------------------------------
TakeThisOuTandyspamspam_OUTrc-hydros.com      http://www.rc-hydros.com     - Race Boats
RemoveMEandyspamspamSTOPspammontanadesign.com  http://www.montanadesign.com - Electronics
==================================================================

1999\10\28@132553 by Jim Hartmann

flavicon
face
A simple technique requiring a capacitor and DPDT relay:

Vx+ >----o | o-----> AtoD
          |
         +-)(-+
             C |
          +----+
          |
Vx- >----o | o-----> GND

Relay on to sample Vx, relay off to measure.

1999\10\28@150342 by Quentin

flavicon
face
First cross post, hehe

Quentin

'[PIC] Measuring Analogue Voltages w/o Sharing Grou'
1999\10\28@152009 by Richard Prosser

flavicon
face
As an addendum to the differential A/D and instrumentation amplifiers, and
depending on the precision you require, a standard differential amplifier
using 1,2 or three opamps could be used. As the "common" ground connection
is taken as being a low impedance source, the single op-amp config may well
be adequate. In this configuration run the "common" side to the inverting
input and the "signal" side to the non-inverting input. Common mode error (&
l.f. noise rejection) will  be mainly determined by resistor matching so us
1% or better if you need useful accuracy. This will limit any current loops
to the values determined by your input resistors.
If you need better isolation a double op-amp config will give you high input
Z but somewhat limited common mode range. 3 op-amp will give you best
performance overall - but at the expense of realestate.
Suggested opamp - OP177 for low DC drift & offset (I think a quad pack
version is also available now)


Richard P

> {Original Message removed}

'[PIC] Measuring Analog Voltages w/o Sharing Ground'
1999\10\28@160030 by Andy Kunz

flavicon
face
At 12:22 PM 10/28/1999 -0500, you wrote:
>A simple technique requiring a capacitor and DPDT relay:
>
>Vx+ >----o | o-----> AtoD
>           |
>          +-)(-+
>              C |
>           +----+
>           |
>Vx- >----o | o-----> GND

I need to make up to 30 samples/sec.  That's a pretty nasty buzz for a relay.

I like the concept, though.

Other ideas?

Thanks.

Andy
==================================================================
Eternity is only a heartbeat away - are you ready?  Ask me how!
------------------------------------------------------------------
.....andyEraseMEspamrc-hydros.com      http://www.rc-hydros.com     - Race Boats
spamBeGoneandyspamRemoveMEmontanadesign.com  http://www.montanadesign.com - Electronics
==================================================================

1999\10\28@163501 by Don Hyde

flavicon
face
I was thinking along the lines of using another PIC (like maybe 12C671)
powered from the motor supply making the motor measurements, but
electrically isolated from everything else, then sending a bit stream
through an optocoupler to the PIC with the EEPROM.  It's cheap (<$2 in 25's
from Digikey), tiny (8-pin), and has an 8-bit A/D.

> {Original Message removed}

1999\10\28@164548 by Andy Kunz

flavicon
face
At 03:29 PM 10/28/1999 -0500, you wrote:
>I was thinking along the lines of using another PIC (like maybe 12C671)
>powered from the motor supply making the motor measurements, but
>electrically isolated from everything else, then sending a bit stream
>through an optocoupler to the PIC with the EEPROM.  It's cheap (<$2 in 25's

Well, DUH!!! Why didn't I think of that.

You forgot one point - I HAVE THEM IN STOCK!!!!  How Stupid can I be!

Thanks.

Andy

==================================================================
Eternity is only a heartbeat away - are you ready?  Ask me how!
------------------------------------------------------------------
.....andyEraseMEspamrc-hydros.com      http://www.rc-hydros.com     - Race Boats
spamandyspam_OUTspam@spam@montanadesign.com  http://www.montanadesign.com - Electronics
==================================================================

1999\10\29@064151 by fernteix

flavicon
face
Hi

Use the same  idea with analogue swiches.

fernando

-----Original Message-----
From: Andy Kunz <spamsupport@spam@spamSTOPspamMONTANADESIGN.COM>
To: spamBeGonePICLISTspamBeGonespam@spam@MITVMA.MIT.EDU <RemoveMEPICLISTRemoveMEspamRemoveMEMITVMA.MIT.EDU>
Date: Quinta-feira, 28 de Outubro de 1999 21:00
Subject: Re: [PIC] Measuring Analog Voltages w/o Sharing Grounds


{Quote hidden}

relay.
{Quote hidden}

1999\10\29@205426 by Harold M Hallikainen

picon face
       This is a "flying capacitor" analog isolator.  As I recall, Maxim makes
a chip that does this.

Harold


On Fri, 29 Oct 1999 11:28:36 +0100 fernteix <TakeThisOuTfernteixspam_OUTspamTELEWEB.PT> writes:
> Hi
>
> Use the same  idea with analogue swiches.
>
> fernando
>
> {Original Message removed}


'[PIC] Measuring Analog Voltages w/o Sharing Ground'
1999\11\01@141811 by Erik Reikes
flavicon
face
At 10:31 AM 10/28/99 -0600, you wrote:
>>I'm working on a data logger which is a little different than what I've
>>done before.
>
><snip>
>
>>
>>Now my question:
>>
>>How do I hook these separate analog signals up without sharing the ground
>>with the Power circuit?
>>

This is similar to a problem I was just working on.  We were measuring
current loops, so we could power the isolated side of the circuit.  I'm not
sure if that's an option for you here.  What we did is basically just power
an AD off of the current loop via a zener and send the serial signals
through optoisolators.

Some of the other things we thought about are :
1: analog optoisolators ....  really crappy temp coefficient kills your
accuracy over temp.
2: Voltage to frequency using op-amps then through opto isolators or caps.
Uses a fair amount of power on the iso side.  This problem can be solved by
having a truly isolated supply on the other side using a transformer.
3: A sort of charge sharing setup where storage caps are switched from iso
circuit to internal circuit.  I never quite got this one, but the EE's tell
me it should work.
4: Voltage to PWM through opto-isolators.  Also somewhat of a power hog and
sort of complicated.

HTH

-Erik Reikes

1999\11\02@133011 by Andy Kunz

flavicon
face
At 07:02 AM 10/29/1999 -0700, you wrote:
>        This is a "flying capacitor" analog isolator.  As I recall, Maxim
makes
>a chip that does this.

The MAX619 is the only chip with "flying capacitor" anywhere, according to
their search engine.  Got another name for it?

Thanks.

Andy

==================================================================
New Microprocessor support forum mail list - details on our site
------------------------------------------------------------------
KILLspamandy.....spamTakeThisOuTrc-hydros.com      http://www.rc-hydros.com     - Race Boats
TakeThisOuTandyEraseMEspamRemoveMEmontanadesign.com  http://www.montanadesign.com - Electronics
==================================================================

1999\11\02@140733 by William Bross

flavicon
face
Andy,

If you need a 'flying cap' front end, you may want to take a look at the
LTC1043 Dual Precision Instrumentation Switched-Capacitor Building Block
from Linear Tech at http://www.linear-tech.com/

Bill

'[PICList] Mini-FAQ, Revised Oct. 14, 1999 (Pre-Dra'
1999\11\17@011535 by Sean Breheny

face picon face
At 09:55 PM 11/16/99 -0800, you wrote:
>>As he is no longer a participant in the PICList, I have asked Tjaart for the
>>page and have modified it and posted it at the address on the bottom of my
>>signature. If you don't mind I will add this [PICList] Mini-FAQ to that
>>page. <WHINE> I notice that you didn't mark this post as [OT] or as [ADMIN]
>>but as [PICList] which I don't think you have mentioned as a category marker
>>in the past. </WHINE><DUCKING><GRIN>

<BLUSH> I notice that my PIC-O'Scope project link is listed in the FAQ. To
those who (despite the bitscope and others) are still interested in
projects like this: I have NOT given it up (despite the lack of updates for
ages). I have been sidetracked by school and other projects (yes,they
involve PICs and will be documented on my page soon). I hope to be going
back to the O'Scope project soon </BLUSH>

To those who don't know what the PIC-O'Scope is: the idea is to build a
simple,yet useful PIC-based DSO with at least 40MS/s capability,and
possibly mate it with a logic analyzer. I was working on it feverishly
about a year ago, but got sidetracked. Take a look at:

http://www.people.cornell.edu/pages/shb7/posc.html


Sean

|
| Sean Breheny
| Amateur Radio Callsign: KA3YXM
| Electrical Engineering Student
\--------------=----------------
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
spam_OUTshb7RemoveMEspam.....cornell.edu ICQ #: 3329174


'[PIC] [ot] Duhhh too'
2000\01\03@163405 by Robert.Rolf
picon face
On Mon, 3 Jan 2000, some smart ass wrote:

About my request to add a [PIC] tag to the subject line:

> Daaaaaaa, i red the instructions but i theenk i just are too dummm.

No, I just have disk quotas which regularly get blown by large binaries I
frequently receive (joint programming project). Procmail and the like sort
to local space and so frequently fail on quota. I can leave 16Mb in my
inbox without problem so I do so and have to forgo the use of the
available tools. This means sorting incoming mail by eye.

Sure, it's MY problem, but I'm sorry to see that something sensible is
so easily rejected because it represents a small change to the way things
are done here. Nothing like a little inertia to ensure progress...

Sorry to have wasted your time with such a simple request.
Lots of value to be found here. Lots of jerks too.

Robert
spam--Robert.RolfKILLspamspamKILLspamUAlberta.ca
"That's not a bug! That's an 'undocumented feature'".

'[PIC's] Some Explanations please'
2000\01\11@112140 by Roger Morella

flavicon
face
Reginald,

I found this response in the PIC archives.  Would it be possible to e'mail
anything you have regarding the topic below?

Thanks,

Roger

Reginald Neale wrote:

{Quote hidden}

2000\01\11@134201 by Reginald Neale

flavicon
face
<x-flowed>>Reginald,
{Quote hidden}

Roger:

The app note is Microchip Document number DS40160A-2. You can
download it from the Microchip site. It describes three different
applications, all operated direct from a 240V/50Hz line.

Not sure what you're trying to do, but note that this type of power
supply is NOT isolated from the power line. That means you have a
potentially lethal hazard for anyone contacting any part of the
circuit.

Regards,
Reg Neale

</x-flowed>

2000\01\18@162022 by Ing. Marcelo Fornaso

flavicon
face
Please Reginald: I was looking for Microchip Document number DS40160A-2, but
I can't find it at Microchip site.
Can you help me?

Thanks in advance
Best regards to the entire Piclist

Marcelo M. Fornaso, E.E.
Argentina





{Original Message removed}

'pic to thermistor interface [PIC]'
2000\01\22@183752 by Keith Causey

picon face
Hello Everyone, I need to interface a fast acting temperature sensor to a
pic to keep tabs on not smoking muscle wire and I was wondering if a
thermistor was something with 1/10 sec. response time. Does anyone have any
experience with this ?
Thanks in advance
Keith Causey
spamffightspam_OUTspamgeocities.com

2000\01\22@192600 by Jameel Ahed

picon face
I really like the Dallas DS1620.  That might work better than a thermistor.
Jameel Ahed

----- Original Message -----
From: Keith Causey <STOPspamffightspam_OUTspamspamBeGoneGEOCITIES.COM>
To: <spam_OUTPICLISTspamspamBeGoneMITVMA.MIT.EDU>
Sent: Saturday, January 22, 2000 4:37 PM
Subject: pic to thermistor interface [PIC]


> Hello Everyone, I need to interface a fast acting temperature sensor to a
> pic to keep tabs on not smoking muscle wire and I was wondering if a
> thermistor was something with 1/10 sec. response time. Does anyone have
any
> experience with this ?
> Thanks in advance
> Keith Causey
> EraseMEffightspamKILLspamgeocities.com
>


'[pICLIST] Warp13 programmer ...'
2000\02\04@094420 by John C. Frenzel
picon face
----- Original Message -----
From: "Moser, Carl Woodrow, JR (Carl)" <EraseMEcwmoserRemoveMEspamLUCENT.COM>
To: <.....PICLISTspamspam_OUTMITVMA.MIT.EDU>
Sent: Friday, February 04, 2000 8:02 AM
Subject: [PICLIST] Warp13 programmer ...


> I just ordered the Warp13 programmer.  Power Supply is not included -- is
> just a wall module unit required?  If so what are the specs?
The WARP-13 programmer requires power input in the range of 17 to 20VDC or
12-15VAC. The WARP-13 power input is fully bridge rectified and the power
plug is not polarity sensitive. this means it does not matter if the tip on
the power lead is positive or negative. Either way around is fine.

I recently replaced my ITU programmer with on of these and it is the best
money I have spent.  It is a joy to work with!
>
> I'm just getting into PIC development.  I already have a solderless
> breadboard but I need to obtain the following parts -- where is a good
place
> to order in small quantity?
>         - PIC 16F84A
>         - Ceramic Resonator or Xtal

http://www.digikey.com
http://www.jameco.com

>
>         - an A/D chip that serially interfaces to the PIC

I have used the ADC0831 8 bit converter alot.  It is cheap and alot of
example code is available on the net.
>         - an inexpensive digital readout that easily interfaces to the PIC

take a look at Scott Edwards site for his serial LCD's, one wire is very
easy
>
You may want to take a look at the Pic Sticks from Don for an easier
prototyping platform.  They have places on them for the ADC, and a MAX232
for the serial port.   If you are going to do ADC work, a breadboard will
take you only so far.   take a look at http://www.wirz.com they sell all the stuff
above.  Good company, with good prices.
>                                                      Carl W. Moser
John Frenzel


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com


'Fw: [PICLIST] Location of Include statement'
2000\03\14@153524 by Grant Forest
flavicon
face
> -----Original Message-----
> From: Grant Forest [SMTP:@spam@gforestEraseMEspamspamNETSPACE.NET.AU]
> Sent: Tuesday, March 14, 2000 8:56 AM
> To:   PICLISTTakeThisOuTspamKILLspamMITVMA.MIT.EDU
> Subject:      Location of Include statement
>
> Added an I2C Include  on the next line after my P16F84.INC  (at the
normal
> position at the start)
> and got heaps of Error[118] "overwriting previous address contents nnnn"
> But when I positioned the I2C Include at the end of the code
> All went OK without errors.
> Does this mean it is better to put the Includes at the end???
> Tks
> Grant Forest
>
No, it means that your I2C include probably used some variable definations
that conflicted with the first include.

Well its the Myke Predko I2C.INC and the only Variable used is I2CTemp that
I do declare in the main.
So do not think this is the problem. Grant Forest

'[PICList] [OT] Photo Radar Buster PRB'
2000\03\31@025718 by Mark Willis

flavicon
face
Another thought that came up while I was driving around getting the
parts for my newer faster machines, today;

Here in the US at least, Regular police officers aren't - or at least
USED to not be allowed - to radar clock every car coming past, in the
hopes of occasionally catching a speeder;  they're legally required to
exercise personal judgement, and only check those who appeared to their
calibrated eyeballs to be speeding...

It's called "Probable Cause" - They aren't allowed to just randomly pull
you over to fish for evidence that you're broken the law, they have to
have a reasonable belief that you're doing something wrong before they
pull you over.

Photo Radar/Lidar, does NOT, I suspect, address this - it just pings
until it catches someone then snaps a picture.  That's invasive of
citizens' rights IMO.  (I have yet to see a machine exercise personal
judgement!)

Never a speeding ticket myself, I figure the laws of physics don't
change just because I mean well & have good reflexes;  Now, if someone
is in danger, I'll definitely speed (it'll have to be something like
someone with a ruptured spleen is in the car & I'm heading for the local
hospital...  That'd motivate me.)

Another thought I had today:  A really, really good aircraft pilot is
said to be "Smooth" - i.e. he handles the aircraft quite smoothly and
competently, preventing problems instead of only reacting to them.  Same
thing goes for drivers, IMO - Kev talked about this.  Tailgaters aren't
smooth at all  <G>  You're a LOT safer inside the pack at the Indy 500,
than near a bunch of tailgating I-5 drivers who're competing for Dodo of
the Week...  (Met some of those today <G>)

 Mark


'Fw: [PICLIST] [OT] Measuring Peak to Peak'
2000\04\01@192050 by Grant Forest
flavicon
face
Goodday,
Have already tried the simple Op-amp + diode + Cap, but does not come close
to measuring
with a resolution of .1mV, even when the output has been nulled out with a
zero I/P.
Have tried a varity of op-amps and get mixed results.

The input wave is 80Hz at 500mv from a reference microphone, and is used to
indicate 125db in a calibration pressure box.
Normally I set the cro to 16 samples and average the results. But still
think I can get a better results.
The Cro Averaging is Ok but the 80Hz normally goes into an ADC that does
not have averaging.

So what I am tring to do is read the Raw Peak to peak of the 80Hz, and
resolve if I have a cro interpretation
problem, or a ADC firmware problem, or construct a test circuit that will
only measure one cycle of 80Hz and get
the true p/p at that time.
Another complication is the 80Hz mean volts also slowly moves up and
down(due to the pressure chamber)
with a period of 1 sec or so..


----------
> From: Russell McMahon <RemoveMEapptechTakeThisOuTspamCLEAR.NET.NZ>
> To: @spam@PICLISTSTOPspamspamMITVMA.MIT.EDU
> Subject: Re: [PICLIST] [OT] Measuring Peak to Peak
> Date: Thursday, 30 March 2000 22:53
>
> Basically, for a positive peak detector, you use an op-amp with signal
> applied to the non-inverting input to drive a capacitor on the
> non inverting input high via a series diode and resistor from the output
to
{Quote hidden}

1/2
> >DVM.
> >I'm looking for changes in the order of 0.1mV.
> >Tks
> >Grant Forest
> >


'little [PIC] more [EE]5v PIC <> 3v3 logic'
2000\05\18@021652 by Vasile Surducan
flavicon
face
On 18 May 00, at 15:22, David Duffy wrote:

{Quote hidden}

 It's the best ideea, I don't know how I forgot ... PIC will see as
high level anything up to ~1,8V...2V .
And a CMOS have thresolds at 1/3 and 2/3 from VDD so 2/3 from
5V is 3.3V that's the reason why CMOS are unhappy when is
supplied at 5V and interfaced with a signal coming from a 3.3V
circuit... and not because of schmitt trigger inputs...
But a good (standard) CMOS chip will work either at 3V (with
frequency limitation ) so no problem...
Vasile
****************************************
Surducan Vasile, engineer
email:EraseMEvasile.....spaml30.itim-cj.ro
URL:http://www.geocities.com/vsurducan
****************************************

'[PIC] Simple 16C73 PWM routine?'
2000\05\19@102116 by Graham North

flavicon
face
Hi

I am just starting to play with the 16C73, and would like to use the PWM
outputs.
I have read the data book but I am afraid it has gone straight over my head
(I have
not implemented any PWM outputs before).

If anyone has a simple program to get me started I would be very grateful.

Thanks

Graham

(I just don't know where to start!)

2000\05\19@104424 by Ismael M. Khangane

flavicon
face
Hi Graham:
In which programming language? Asm or C?
Ismael.

Graham North wrote:

{Quote hidden}

--
------------------------------------------------------------------
Ismael M. Khangane, Specialist in Robotics. Automatic Control & Systems ( Bsc
in Eng.)
Instituto de Automatica Industrial IAI-CSIC
Madrid, Spain.
Tel: (34) 91 871 1900
Fax: (34) 91 871 7050
E-mail: spamimkespKILLspamspam@spam@excite.com ; ismaelmspamspamTakeThisOuTiai.csic.es
------------------------------------------------------------------

2000\05\19@113614 by Matt Sidare

flavicon
face
Graham,

Here's a short bit of code that sets up the PWM and sets the PWM to ~50%
duty cycle
I copied it from some code that works,  Its been a while since I wrote it
so,
I may have forgot to copy something.  Try it and let us know.

       MOVLW   0xFF                    ; 00 --> W
       BSF             STATUS, RP0             ; Select bank 1
       MOVWF   PR2                     ; Load PR2 with period info
                                               ; at 20MHz PR2=FF gives a 1.22KHz
                                               ; at 4MHz PR2=FF gives a 3.906KHz
       BCF             STATUS, RP0             ; Select bank 0
       MOVLW   0X80                    ; Load W with 0X80
       MOVWF   CCPR1L          ; Duty Cycle is ~50% of PWM 1 Peroid
       MOVWF   CCPR2L          ; Duty Cycle is ~50% of PWM 2 Peroid
       BSF             T2CON, T2CKPS1  ; Set the TMR2 prescale value
       BSF             T2CON, T2CKPS0  ; Set the TMR2 prescale value
       BSF             T2CON, TMR2ON   ; Enable timer2
       MOVLW   0X0F                    ;
       MOVWF   CCP1CON         ; SET low two bits of PWM 1 and turn it on
       MOVWF   CCP2CON         ; SET low two bits of PWM 2 and turn it on
                                               ; PWM has 10-bits of resolution

Matt

'[PIC] [CCS] Usable SPI in most serial ADC ?'
2000\05\19@161812 by fernteix

flavicon
face
Hi

I use PBP and would like to have a compiler that deals directy with SPI.
I know that CCS has SPI functions , but I read somewhere about some limitation.
My purpose is to work easily with 12 to 16 bit SERIAL ADC and many serial powerful devices that appear everyday.
Please give me examples of chips you have used with good results with CCS  SPI.
Thanks in advance

Fernando

'[PIC]: RC oscillator'
2000\05\20@010721 by MCMANUS, Don

flavicon
face
Hi,

       I have an application which requires a an RC oscillator.  Since the
design will be subjected to high vibration in the field, it is felt that a
crystal or resonator would be too fragile.

       Right now we are operating at 4MHz, but this is may end up at 1 MHz
or below.

       The problem is that when we test the oscillator over temperature it
moves several percent between 25C and 50 C, at which point it can no longer
maintain serial communications because the clock has drifted too far. This
is unexpected because the we are using top quality high stability resistors
and capacitors, which should only move about 20-30 PPM/C each.

       I thought I had seen graphs of the stability of the RC mode from
device to device and over temperature, but I can't locate these in the
datasheet or app notes.

       I would like to know if anyone out there has experience with the RC
oscillators performance over extended temperature(we'd like to go up to
125C).  Hopefully I could get a few suggestions to stabilize our design.
Thanks in advance for any help

Don McManus
Bently Nevada Corporation

2000\05\20@013240 by Spehro Pefhany

picon face
At 08:42 AM 5/18/00 -0700, you wrote:

>        I thought I had seen graphs of the stability of the RC mode from
>device to device and over temperature, but I can't locate these in the
>datasheet or app notes.

I don't think that the RC mode is suitable for serial communications,
not in a production product that has to operate over a wide temperature
range.

Why don't you put an SMT or a 20 cent leaded resonator on there? You will get
guaranteed acceptable performance (without a lot of margin, but O.K.)
Resonators are much more robust than crystals.

Only a percent or two change and you will have decreased serial noise
immunity,
at 5% or so it typically will stop working.

I have used LC oscillators on PIC's to improve the guaranteed accuracy, but
the
accuracy certainly not good enough for this application. The stability,
OTOH,
might be just ok for asynchronous serial comms.


Best regards,
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
RemoveMEspeffRemoveMEspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

'[PIC] Converting A/D into Temperature'
2000\05\20@014719 by Damon Hopkins

flavicon
face
I've got an A/D circuit on my 16F874.
I have a couple of OP Amps hooked to some resistors a few Pots and a
thermistor so that I get a 5X gain on the voltage. (schematic available
if needed)
I have it giving me 2.5V at room temp. But for the LIFE of me I can't
figure out how to convert the 0-1023 value into a usable temperature.
I have an Excel spreadsheet that will tell me the readout if I type in
the voltage example: 0v=0, 5V=1023, 2.5V=512, 2.813782991V=576

>From my chart that last Voltage should correspond to a reading of 68F
(20C)
Maybe it's late and it's really simple but I can't figure it out.. any
help out there?

                               Damon Hopkins

2000\05\20@045937 by Jacky Joulin

picon face
hello,

can you give me your schematics.

B-Regards.

TakeThisOuTWeslay@spam@spam@spam@aol.com

'[PIC]: RC oscillator'
2000\05\20@233820 by Russell McMahon

picon face
>        I have an application which requires an RC oscillator.  Since the
>design will be subjected to high vibration in the field, it is felt that a
>crystal or resonator would be too fragile.


Don,

RC oscillators can be made stable enough for controlling serial async data
transfer but in your circumstances I would first consider whether a
resonator or crystal is really as fragile as you think it is. How strong is
a capacitor compared to a resonator?

What sort of environment are you in?
Properly mounted a resonator or crystal will survive massive accelerations.
I don't know details on what they use but the military fire GPS units in
artillery shells (!)
Unless you are using this equipment to tamp in your sticks of gelignite you
are unlikely to get higher accelerations than that.
Equipment with survivable accelerations of in the order of 1000 g is quite
standard.
Close attention to mounting detail and massive common sense seems to cover
most of it.
I don't know about the internal mounting structures in crystals but
resonators "seem" to be rather more monolithic.

You could try an easy test.
Mount a resonator on a steel block - hold in place with epoxy and press
firmly into place against the steel as the epoxy sets.
Drop steel block from various heights onto paper sheet on steel plate on
concrete floor (resonator uppermost :-)) from various heights.
If one assumes about zero compression of the steel-steel interface any
deceleration is carries out over the thickness of the paper (or less as it
will have some compression thickness).

Acceleration in g's = Fall distance/Stopping-distance
eg for a 0.010" = 0.25mm = 0.00025m thick stopper
A drop from 250mm results in a deceleration of 0.250/0.00025
= 1000g

IF this kills your resonator try embedding it in a very small amount of
stiffish padding and try again.
The g forces will be MUCH reduced (as seen above) by allowing it even a
small amount of "compliance".

regards


     Russell McMahon
_____________________________

>From other worlds - http://www.easttimor.com
                               http://www.sudan.com

What can one man* do?
Help the hungry at no cost to yourself!
at  http://www.thehungersite.com/

(* - or woman, child or internet enabled intelligent entity :-))

'[PIC] Simple 16C73 PWM routine?'
2000\05\22@040833 by Graham North

flavicon
face
Asm if possible.

       -----Original Message-----
       From:   Ismael M. Khangane [SMTP:TakeThisOuTismaelmspamspamIAI.CSIC.ES]
       Sent:   19 May 2000 15:39
       To:     KILLspamPICLISTKILLspamspamspamBeGoneMITVMA.MIT.EDU
       Subject:        Re: [PIC] Simple 16C73 PWM routine?

       Hi Graham:
       In which programming language? Asm or C?
       Ismael.

       Graham North wrote:

       > Hi
       >
       > I am just starting to play with the 16C73, and would like to use
the PWM
       > outputs.
       > I have read the data book but I am afraid it has gone straight
over my head
       > (I have
       > not implemented any PWM outputs before).
       >
       > If anyone has a simple program to get me started I would be very
grateful.
       >
       > Thanks
       >
       > Graham
       >
       > (I just don't know where to start!)

       --
       ------------------------------------------------------------------
       Ismael M. Khangane, Specialist in Robotics. Automatic Control &
Systems ( Bsc
       in Eng.)
       Instituto de Automatica Industrial IAI-CSIC
       Madrid, Spain.
       Tel: (34) 91 871 1900
       Fax: (34) 91 871 7050
       E-mail: spamBeGoneimkespKILLspamspamexcite.com ; ismaelm@spam@spamKILLspamiai.csic.es
       ------------------------------------------------------------------

2000\05\22@051809 by Graham North

flavicon
face
Thanks for the program.

Am I right by looking at the program that the input from the 10k pot should
be connected to RA0?

Which port is the output?

<Snip>           BCF    TRISC,2  ;MAKE PIN OUTPUT

Is it port C?  All 8 leds connected.

Sorry for the dumb questions.

Thanks  Graham

       -----Original Message-----
       From:   RAYMOND WILLCOX [SMTP:EraseMEmarkwillcox56RemoveMEspam@spam@hotmail.com]
       Sent:   20 May 2000 17:50
       To:     RemoveMEGRAHAM.NORTHspamspamEraseMELANDINST.COM
       Subject:        Re: [PIC] Simple 16C73 PWM routine?

       Graham
          Here is a simple A/D - PWM code (from Toni Nixon), it works well.
It
       drives an eight bit bar-graph display or 8 LED's. It uses a 10k pot
on the
       input. Real simple and quite self explanitory. Have fun - Mark








2000\05\22@133202 by Quentin

flavicon
face
Graham North wrote:
>
> Thanks for the program.
>
> Am I right by looking at the program that the input from the 10k pot should
> be connected to RA0?
>
> Which port is the output?
>
> <Snip>           BCF    TRISC,2  ;MAKE PIN OUTPUT
>
> Is it port C?  All 8 leds connected.
>
> Sorry for the dumb questions.
>
> Thanks  Graham

Graham, there are no such thing as dumb questions, only dumb answers. I
am not referring to the other replies to your email of course :).
I did not see the program that Tony wrote, but it should be very similar
to this A/D to PWM test program below (I modified the tutorial A/D
program for the ICD, bit rough, but it works).
To answer your questions: The 10K pot is connected to RA0 and the pin is
set up to be an analogue input. BCF TRISC,2 is the CCP1 output on PortC
which is set up to be the PWM1 output.
Get the Mid-Range MCU Family Reference Manual from Microchip. It will
give you a bit more info (You can also get it from Microchip's web with
each chapter as a separate download, get the CCP section).
To do PWM:
Set up TMR2, switch TMR on and set prescaler (16 in this case).
Set TMR2 period in PR2. Default is 0x0FF. You should only change this
setting lower if you want a faster PWM period (together with the
prescaler), but then you start meddling with resolution.
Clear TMR2 interupts in PIR2 and PIE2 (You don't need them for simple
PWM) Should be cleared as default.
Do the calculations (in the data books) to see if your duty cycle is not
longer than the period. The above settings should keep you in spec.
Set CCP1CON to be PWM.
Write your PWM duty cycle to CCPR1L (8 MSB) and CCP1CON, 5 and 4 (2 LSB)
and away you go!

Hope this helps
Quentin

;A/D input on RA0 to PWM output on RC2
Start
       banksel PORTC
       clrf    PORTC   ;Clear PORTC
       movlw   B'01000001'     ;Fosc/8, A/D enabled
       movwf   ADCON0

       banksel OPTION_REG
       movlw   B'10000111'     ;TMR0 prescaler, 1:256
       movwf   OPTION_REG
       clrf    TRISC   ;PORTC all outputs
       movlw   B'00001110'     ;Left justify,1 analog channel
       movwf   ADCON1  ;VDD and VSS references
       banksel         PORTC
       MOVLW   B'00000111'     ;switch on TMR2 and set prescaler to 16
       MOVWF   T2CON
       MOVLW   B'00001100'
       MOVWF   CCP1CON         ;select CCP1 to be PWM output
Main
       btfss   INTCON,T0IF     ;Wait for Timer0 to timeout
       goto    Main
       bcf     INTCON,T0IF

       bsf     ADCON0,GO       ;Start A/D conversion
Wait
       btfss   PIR1,ADIF       ;Wait for conversion to complete
       goto    Wait

DO_PWM  movf    ADRESH,W        ;Write A/D result to PWM
           MOVWF       CCPR1L
           BCF CCP1CON,4       ;do the LSB
           BCF CCP1CON,5
           BSF STATUS,RP0
           MOVF        ADRESL,W
           BCF STATUS,RP0
           MOVWF       TEMP1
           BTFSC       TEMP1,6
           BSF CCP1CON,4
           BTFSC       TEMP1,7
           BSF CCP1CON,5
       goto    Main            ;Do it again

'[PIC] Converting A/D into Temperature'
2000\05\22@135042 by Eisermann, Phil [Ridg/CO]

flavicon
face
Damon wrote:
> I've got an A/D circuit on my 16F874.
> I have a couple of OP Amps hooked to some resistors a few Pots and a
> thermistor so that I get a 5X gain on the voltage. (schematic available
> if needed)
> I have it giving me 2.5V at room temp. But for the LIFE of me I can't
> figure out how to convert the 0-1023 value into a usable temperature.
> I have an Excel spreadsheet that will tell me the readout if I type in
> the voltage example: 0v=0, 5V=1023, 2.5V=512, 2.813782991V=576
>
> From my chart that last Voltage should correspond to a reading of 68F
> (20C)
> Maybe it's late and it's really simple but I can't figure it out.. any
> help out there?
>
>
       Well, using a thermistor, it's not exactly straightforward. The
reason
is the highly non-linear resistance to temperature characteristic of the
thermistor. I have been working on something similar (in my copious
spare time). This equation is from memory, i'll look it up tonight when
I get home:

       T(Kelvin) = 1/(A + B*ln(R) + C*(ln(R)^3))

This equation is the Steinhart-Hart equation. R is the resistance
of the thermistor. A, B, and C are material constants that you can figure
out by measuring the resistance at three different temperatures. The
constants are all less than 1 for my particular thermistor.

Now you can see the difficulty with this equation in a PIC. While the
fractional values can be taken care of by scaling everything,
calculating the natural log function is a bit more difficult. On top
of that, the temperature (in Kelvin) is actually the inverse.

Of course, I admit I am not the world's greatest PIC programmer. Perhaps
there is an easy way to realize the required mathematical operations
on a PIC.

In my circuit, I placed the thermistor in parallel with a fixed resistor
in an attempt to linearize the resistance a little. Over a certain
range of values, this works fairly well.

A lookup table is one possible solution. You could put a lookup
table for all possible values in external EEPROM. Or you could
place a smaller lookup table in memory, and interpolate between
points.

If anyone has any other ideas, please jump in.

Phil Eisermann
H:(440) 284-3787 (STOPspammazer.....spamix.netcom.com)
O:(440) 329-4680 (spamBeGonepeisermaRemoveMEspamRemoveMEridgid.com)

2000\05\22@140735 by Don Hyde

flavicon
face
Well, for limited temp ranges, you can fit a polynomial to it and get pretty
decent results -- I've done that for 0-50C.  The problem is that the curve
really is logarithmic, so no polynomial will fit very well, at least not
over any extended temp range.  Hint -- buried in Excel somewhere there is a
polynomial curve-fitting wizard, I just don't remember where.

> {Original Message removed}

2000\05\22@143829 by Scott Dattalo

face
flavicon
face
On Mon, 22 May 2000, Eisermann, Phil [Ridg/CO] wrote:

>         Well, using a thermistor, it's not exactly straightforward. The
> reason
> is the highly non-linear resistance to temperature characteristic of the
> thermistor. I have been working on something similar (in my copious
> spare time). This equation is from memory, i'll look it up tonight when
> I get home:
>
>         T(Kelvin) = 1/(A + B*ln(R) + C*(ln(R)^3))
>
> This equation is the Steinhart-Hart equation. R is the resistance
> of the thermistor. A, B, and C are material constants that you can figure
> out by measuring the resistance at three different temperatures. The
> constants are all less than 1 for my particular thermistor.
>
> Now you can see the difficulty with this equation in a PIC. While the
> fractional values can be taken care of by scaling everything,
> calculating the natural log function is a bit more difficult. On top
> of that, the temperature (in Kelvin) is actually the inverse.


If calculating logarithms is all that's holding you back, then check out:


http://www.dattalo.com/technical/software/pic/piclog.html

and

http://www.dattalo.com/technical/theory/logs.html


Scott

2000\05\22@164321 by steve

flavicon
face
> In my circuit, I placed the thermistor in parallel with a fixed resistor
> in an attempt to linearize the resistance a little. Over a certain
> range of values, this works fairly well.
>
> If anyone has any other ideas, please jump in.

This is one application where Excel is actually useful.
Use it to build a table of thermistor values over the range you want
to test. Then take that value to calculate the voltage you would get
at the A/D input for your circuit topology. Graph the values.

Try a simple voltage divider with a resistor at the top and the
thermistor on the bottom. It works for me.

>From the measured voltage values, have Excel calculate the factors
for a y=mx+c function, generate another column with the result
of that function and plot them on the same graph. Also
calculate the power dissipation for each step and have Excel put the
maximum value somewhere you can see it. Do the same for the error
value.

Now you can fiddle with the value of the series R to get the closest
fit.

If the error is still out of range, plot it. You may see a solution
staring you in the face. Also try extending the temperature range
that you are plotting to give the linear regression a bit more room
to move.

I did this recently and got <0.5 degree error over 0-100C with an
algorithm that was no more than y=mx+c plus a test for values within
two ranges. If they were, I added or subtracted half a degree. The
circuit was just a voltage divider.

Steve.
======================================================
Steve Baldwin                Electronic Product Design
TLA Microsystems Ltd         Microcontroller Specialists
PO Box 15-680, New Lynn      http://www.tla.co.nz
Auckland, New Zealand        ph  +64 9 820-2221
email: @spam@stevebspamBeGonespamtla.co.nz      fax +64 9 820-1929
======================================================

2000\05\22@172444 by mike

flavicon
face
On Mon, 22 May 2000 13:46:59 -0400, you wrote:

{Quote hidden}

Use a lookup table - you can compensate for the thermistor
nonlinearity, and the nonlinearity of using a simple resistive divider
in one go. You can generate the table using the equation from the
thermistor databook data with a simple Basic/[insert your favorite
language] program, or probably Excel.

If you need a wide temperature range, use 2 switchable pullups to
improve linearity at the hot end, otherwise select the pullup/pulldown
to get a reasonable voltage swing over the range you're interested in.

'[OT] Re: [PIC] Converting A/D into Temperature'
2000\05\23@043331 by Kbek Tony

flavicon
face
Don wrote:
.
.
>over any extended temp range.  Hint -- buried in Excel somewhere there
is a
>polynomial curve-fitting wizard, I just don't remember where.
.
.
Make a graph with your data, rightclick on the line you want to
curve-fit..tada...there you can access the 'wizard'.
Dead easy and handy :-)


/Tony

Tony KŸbek, Flintab AB            
ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ
E-mail: spam_OUTtony.kubekspamspamflintab.com
ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ

'MPLAB-C17???? [PIC]'
2000\05\23@123235 by rleggitt

picon face
¿x> When MPLAB-C17 tell me that it can't find output file what does it
> mean??
Probably means that assembly failed, check the .LST file.

> Actually it crushes my head!
Ow.

'[PIC]: 24bit digital filter,'
2000\05\23@180442 by Kbek Tony

flavicon
face
part 0 1444 bytes content-type:application/octet-stream; name="Twist24.asm"I'm by no means an good PIC programmer, so I guess that
the code could be improved quite a bit. :-)

Also the code is very easy to modify for 16 or even 8 bit variables.

Have fun,

/Tony

BTW How is it with 'enclosed' code ? acceptable ? it IS regarding
PIS's and I consider it to be somewhat useful, but others might
not agree with me, please give me a note if You find this 'unwanted'.
Unfortunately I dont have access to private webspace DS


Tony KŸbek, Flintab AB            
ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ
E-mail: spamtony.kubekspamspamspamflintab.com
ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ


Content-Type: application/octet-stream; name="Twist24.asm"
Content-Disposition: attachment; filename="Twist24.asm"

Attachment converted: creation:Twist24.asm (????/----) (00015824)

2000\05\23@183810 by Scott Dattalo

face
flavicon
face
On Tue, 23 May 2000, [Iso-8859-1] Kübek Tony wrote:

{Quote hidden}

Tony,

I haven't examined the code, but I placed it on my web page:

www.dattalo.com/technical/software/software.html
http://www.dattalo.com/technical/software/pic/twist24.asm


Scott

'MPLAB-C17???? [PIC]'
2000\05\24@092144 by Ismael M. Khangane

flavicon
face
Thanks to all who in one way or another replied! It's working smoothly....

Ismael ( spain )

spamBeGonerleggittKILLspamspamKILLspamconcentric.net wrote:

> xx> When MPLAB-C17 tell me that it can't find output file what does it
> > mean??
> Probably means that assembly failed, check the .LST file.
>
> > Actually it crushes my head!
> Ow.

--
------------------------------------------------------------------
Ismael M. Khangane, Specialist in Robotics. Automatic Control & Systems (
Bsc in Eng.)
Instituto de Automatica Industrial IAI-CSIC
Madrid, Spain.
Tel: (34) 91 871 1900
Fax: (34) 91 871 7050
E-mail: TakeThisOuTimkespspamspamexcite.com ; spamBeGoneismaelmspamiai.csic.es
------------------------------------------------------------------

'[PIC]: REALLY WANTED: Picstart Plus'
2000\05\24@153455 by Mark Willis

flavicon
face
Anthony, if you find a MicroChip seminar near you, you can get one at
that price there.  Suggestion:  Buy a couple 17C44/JW's as well, or at
least one, you'll like being able to upgrade your own firmware.  (If you
just get one, keep the OTP one currently in your PSP.)  Not quite ready
to sell mine yet...

 Mark

Anthony Clay wrote:
> Ok, lets scratch that about the PROMATE II.  **Ouch** that's expensive!  I need a PICStart plus, bad!  I have an EPIC programmer, but it's not enough.  Does anybody have one for sale?  I would like to pay ~$150 or less if possible.  Thank you
>
> Anthony Clay
> EraseMEzarthragEraseMEspamintcon.net

'[PIC] Is this an MPLAB bug?'
2000\05\24@223726 by Don

flavicon
face
I wonder if I did something wrong, or maybe this is a bug in mplab.
I was using the simulator to exercise a program for 16F84, running
at 4 Mhz. I had some Bit manipulations of the data in the last
memory location of the pic (0x4F). I noticed that one of the bits
would not set when the bcf instruction executed. I changed the
location to 0x4E, and it worked fine. This is version 5 which I got
from the Mchip website a few months ago. Maybe I did something
to make it behave this way, but I sure cant figure it out!

'[PIC]: was: PICSTART+..Now: Warp-13 accessories qu'
2000\05\25@103852 by Jim P

flavicon
face
Jim P wrote:

Cutting to the quick:

A) Using the Warp-13, how are 8-pin parts programmed?

B) ... the 18-pin and 28 pin parts?

Background:

Note that the Warp-13 product page 'board' imge (picture)
shows a 40-pin ZIF socket - there are also two unpopulated
sockets: an 18-pin and a 28-pin.

What are the functions of the 18/28 pin sockets?


Further background - I've included the parts the Warp-13
will program from the: http://www.new-elect.com/products.htm
Warp-13 page:


WARP-13 WILL PROGRAM THESE PICS

(Yes, this is meant to be ALL of them! Did we forget any?)

PIC16C52 • PIC16C55 • PIC16C57 • PIC16C54 • PIC16C55A • PIC16C57C •
PIC16C54A • PIC16C56 • PIC16CR57B • PIC16C54B • PIC16C56A • PIC16CR57C •
PIC16C54C • PIC16CR56A • PIC16C58A • PIC16CR54A • PIC16C58B •
PIC16CR54B • PIC16CR58A • PIC16CR54C •
PIC16CR58B PDIP, SOIC*, Windowed CERDIP

16HV540

(All the above PICs require either the 18-pin Zif or 28-pin auxilary ZIFs to
be fitted.)
(Many PIC programmers don't program ANY of the above devices)

18C242, 18C252, 18C442, 18C452 (With MPLAB only)

16C770, 16C771*, 16C773, 16C774

16C712, 16C716, 16C717


12C508, 12C508A, 12CE518, 12C509, 12C509A, 12CE519
12C671, 12C672, 12CE673, 12CE674
16C505
16C554, 16C554A, 16C556A, 16C558, 16C558A
16C61, 16C62, 16C62A, 16C62B, 16C63, 16C63A, 16C64, 16C64A, 16C65,
16C65A, 16C65B, 16C66, 16C67, 16C66A, 16C67A
16C620, 16C621, 16C622, 16C620A, 16C621A, 16C622A, 16CE623, 16CE624,
16CE625
16C641, 16C642, 16C661, 16C662
16C707, 16C71, 16C710 (was 16C70), 16C711 (was16C71A), 16C712, 16C715,
16C716, 16C717, 16C72, 16C72A, 16C73, 16C73A, 16C73B, 16C74, 16C74A,
16C74B, 16C74C, 16C76, 16C77, 16C76A, 16C77A
16F83, 16C84, 16F84, 16F84A , 16F873, 16F874, 16F876, 16F877
16C923#, 16C924#
14C000*

 (In fact, all PICS except the 17Cxx family)
  * = DIP PART, ADAPTER REQUIRED
  #ISP or PLCC ADAPTER REQUIRED

******* End of List ******



{Original Message removed}

2000\05\25@104829 by Ravi Pailoor

flavicon
face
part 0 1445 bytes content-type:text/x-vcard; charset=us-ascii; (decoded 7bit)

Run the warp 13 driver and click on WHERE PIC. You will get a picture.

The blank unpopulated areas are for the 16C5x 18 pin and 28 pin parts.

Pailoor

--
********************************************************************
* e-CHIP INFOTEK (P) LTD.                                          *
* Microchip Consultant                                             *
* 6/1 Crescent Road, Bangalore 560001, INDIA                       *
* Tel 91 80 2202172, Fax 91 80 2258103, Mobile 98440 81538         *
*------------------------------------------------------------------*
* We design the future with PICmicro                               *
* http://echipinfotek.com                                          *
*------------------------------------------------------------------*
* All attachments will be listed above. If you find any additional *
* attachment, it could be a virus, please delete it and inform me. *
*                                                                  *
* Thanks                                                           *
********************************************************************
Content-Type: text/x-vcard; charset=us-ascii;
name="chiptech.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Ravi Pailoor
Content-Disposition: attachment;
filename="chiptech.vcf"

Attachment converted: creation:chiptech.vcf (TEXT/CSOm) (00015B48)

'[PIC]: PIC ICD'
2000\05\25@105039 by Alan B Pearce

face picon face
>and even the C672 and other 8 pin parts.

This possibly answers a question I have: -

Has anyone actively tried using the ICD to debug code for any of the 12 bit
cores, using only the appropriate peripherals? I envisage having a conditional
processor selection at the  beginning of the file to select the F87X during
debug, and 12CXXXX for production.

'[PIC]: was: PICSTART+..Now: Warp-13 programming'
2000\05\25@110721 by Jim P

flavicon
face
Thanks for your reply -

I also found the following on Dontronics page
re Warp-13 ... I've got a clearer picture in
my mind now:

******
Another major upgrade to the WARP-13 is the re-design of the wiring to the
40-pin zif socket. The
40-pin zif socket can now socket ALL 8-pin, 14-pin, 18-pin, 28-pin (except
14000) and 40-pin
ISP (In-System-Programming also known as ICSP or
In-circuit-serial-programming) compatible
PICs This is all PICs except the 16C5x and 17Cxx family. Previously, on the
WARP-3, the 18-pin
zif was required to program the 8-pin, 14-pin and 18-pin 16Cxx parts.

As all ISP programmable PICs can be programmed in the 40-pin zif socket, the
18-pin zif and the
28-pin 600mil zif are only required for the 18-pin and 28-pin respectively
16C5x parts. As these are
not as commonly used as the ISP programmable PICs this means for many users
the extra cost of
the 18-pin zif socket can be avoided making the WARP-13 even better value
for money.

The WARP-13 features an on board ISP connector suitable for in circuit PIC
programming and
connection to odd pin out devices like the 14000 (Bare adapter PCB supplied)
and the 16C92x
Quad pack parts.
*****

{Original Message removed}

'[PIC] PIC ICD'
2000\05\25@122042 by Dan Mulally

flavicon
face
----- Original Message -----
From: "Andrej Vuga" <spamBeGoneandrej.vugaspam_OUTspam.....GUEST.ARNES.SI>
To: <spamPICLISTspamMITVMA.MIT.EDU>
Sent: Thursday, May 25, 2000 5:47 AM
Subject: PIC ICD


> Hello!
>
> I'm thinking of buying a MPLAB ICD (in circuit debugger), because I want
to debug code for 16F873.
> Does enybody remember, which PIC microcontrollers does the package contain
(which chips do you receive in the package).
>
> I'm asking this because in the Microchip aplication note 51184b.pdf (page
23 of the manual) it's written, that for emulating the 16F873 you need a
16F874 attached to the header.
>
> Thanks for the answer
> Andrej Vuga
>
> _______________________________________________________________________
>
> Why pay when you don't have to? Get AltaVista Free Internet Access now!
> http://jump.altavista.com/freeaccess4.go
>
> _
The one I got came with a 16f877 on the demo board which connects to the ICD
board with a 6 wire modular cable (supplied). The demo board has both 40 and
28 pin sockets and the header board which has a socketed 16F877 plugs into
the 40 pin socket on the demo board. The header board also has a modular
connector.

Dan
Mulally_____________________________________________________________________

'[PIC]: Re: PICSTART PLUS'
2000\05\25@133232 by Larry G. Nelson Sr.

flavicon
face
They also had a special deal going on a trade in of development tools. If
you have another commercial programmer you can trade it in at the seminar.
I don't remember the details but it was a great deal. Check out the web
site. I think that is where I saw it.


At 10:38 PM 5/24/00 PDT, you wrote:
{Quote hidden}

Larry G. Nelson Sr.
RemoveMEL.NelsonKILLspamspamKILLspamieee.org
http://www.ultranet.com/~nr

'[PIC]: ICD Problems'
2000\05\25@134654 by Octavio Nogueira

flavicon
face
Try to see if the crystal is working. If isn't
you will get this message.

Friendly Regards

Octavio Nogueira
===================================================
EraseMEnogueiraspamBeGonespamspampropic2.com                  ICQ# 19841898
ProPic tools - low cost PIC programmer and emulator
http://www.propic2.com
===================================================

{Original Message removed}

'[PIC]: Compiled HEX versus dumped HEX'
2000\05\25@143748 by Albert Noah

flavicon
face
Hello,

I have what will probably seem like a stupid question but here it goes:

I built a programmer (http://www.jdm.homepage.dk/newpics.htm) and programmed
a 16F84 with the PP.EXE program. The programmer programmed the chip and then
verified it successfully. (Or so the software says).

I did a read on the chip and had it dump to a file. Below are a few lines of
the original and the dumped hex file starting at line 1 of each.

Original Hex
:020000000528D1
:08000800052885008B01093079
:100010006600C23062000611031EE22864005830F8
:10002000B6209F20120803110310493A031D05282A

Saved Hex
:100000000528FF3FFF3FFF3F052885008B01093092
:100010006600C23062000611031EE22864005830F8
:10002000B6209F20120803110310493A031D05282A

The original hex lines 3 and 4 are the same as the saved hex lines 2 and 3
but the header? is different. Is this normal? If this is normal can I burn
the saved hex to a chip and it operate like the original hex?

The reason I ask is that I will be building this project this weekend but I
want to know if it is the chip or the circuit if I have problems.

I hate to bother you with such a simple question but I am new to pics and am
learning slowly.

Thanks to everyone for your tips and all the great information that comes
through the list.

Albert

2000\05\25@145418 by Damon Hopkins

flavicon
face
Albert Noah wrote:
{Quote hidden}

not sure on the exactness but the hex file format uses some type of
doubling like everything is 2x or something like that.. I forget.. there
are alot of converters out their so you might want to check around...
probably http://www.piclist.com in the techref stuff is a good place..

               Good luck hopefully someone else will speak up with more knowledge
than i have..

                       Damon Hopkins

'[PIC]: ICD Problems'
2000\05\25@150043 by Quentin

flavicon
face
Octavio Nogueira wrote:
>
> Try to see if the crystal is working. If isn't
> you will get this message.
>
> Friendly Regards
>
> Octavio Nogueira
Or use the build in RC osci to test. But not just that.
I get this error on also if the code in the F87x and editor don't match,
also after changing config bits and not reprogramming, etc.
Another suggestion to the problem could be that you use the registers
and program space reserved for ICD. Check your ICD help file to see that
you do not use the ICD resources.

Quentin

'[PIC]: Compiled HEX versus dumped HEX'
2000\05\25@150247 by Jerry Merrill

flavicon
face
<x-flowed>These are equivalent.
The first example skipped some blank locations.

The second example included the original FIRST line, the blank locations
and the original SECOND line all in one line.

Both versions are legal HEX.


At 01:39 PM 5/25/00, you wrote:
{Quote hidden}

Jerry Merrill

KILLspamjerrymspamtech-tools.com
http://www.tech-tools.com
FAX: (972) 494-5814   VOICE:(972) 272-9392
TechTools  PO Box 462101  Garland,  TX  75046-2101

Join our PIC discussion list at
http://www.tech-tools.com/piclist.htm

</x-flowed>

'[PIC]: Thermometer CTN'
2000\05\25@154313 by Mark Willis

flavicon
face
Jacky, it's sort of unclear what you're asking here;  Are you a beginner
or do you have experience with PICs and/or Electronics?  I'm guessing
that you want to be able to read a thermistor to an accuracy of 1/10
degree C, over a 0-100 degrees C range, and you're a beginner to PICs at
least?

For this list, I'll pick the 16F84, first off - This's not the Stamp
list <G>

OK, then for 0-100C at 0.1 degree you want a reading of at least 0-1000
from your A/D conversion and some processing, which means you want a 9+
bit A/D reading (assuming the thermistor was linear, which it assuredly
is NOT, so you're going to have to do some extra work, and you may be
able to get by with 9 bits but don't count on it - I'd bet more like
12-14 bit A/D.  Others are more expert here, I'll jsut say that it's
do-able but not a one day project <G>);

How do you plan to handle wiring the thermistor up to your PIC?

How will you get around the self-heating problem with the thermistor?

Will you switch in different precision resistors to scale the
temperature readings, for better accuracy?  (Probably a good plan.
HexFET to ground from each, all common at the thermistor & PIC pin,
other side of the thermistor to it's own precision voltage source
perhaps, or to a cap with a series resistor to at least isolate spikes
off the thermistor readings.)

How will you handle calibration of your precision voltage source
(voltage divider to a PIC pin(s))?  Helps to test your A/D code <G>

Next:  How will you handle calibration of your thermistor to that level
of accuracy?  How much money do you expect to spend, say a couple
hundred dollars or so, to get that accuracy?  Or is the 0.1 degree C
spec a nicety, and if so, what accuracy do you really need?

Finally, you have a temperature, now what do you do with it - Serial
link to a PC?  Log it to an SEEPRom?  You probably know, we list members
don't <G>

There are, fortunately, a lot of good projects to look at to help if
you're a beginner (start at http://www.piclist.com/,
http://www.dontronics.com/piclinks.html has a bunch of good links, so
does http://www.new-elect.com/links.htm.

You might look at the Stamp links if a total beginner;  there may be a
"read thermistor" bit of Stamp code out there, too, I've never bought a
Stamp (they're fairly expensive compared to the 16C622's I first bought
when getting into PICs.)  Bet you'll have to work on it to get 0.1C
accuracy, of course.

I'l suggest you start by searching on piclist.com and the piclist
archives (look on piclist.com), for "sigma delta" (a good way to do A/D,
if a little unclear at first, it grows on you) and for thermistor, those
two search terms should get you more information.

There also are some temperature sensor chips out there, typically only 1
degree C accuracy though.

Also, you will want to be able to program the 'F84 once you have your
code;  There are a good number of different programmers out there.

 Mark

Jacky Joulin wrote:
> Hello,
> I research  soft (and hard ) for read termistor temperature 0 to 100 0C
> Termistor CTN 10K at 250C
> Risolution 1/10 0C
> Hard for PIC 16F84 or Stamp BS2 or ???
>
> tank for your help
>
> Weslayspam_OUTspamspamAol.com

--
I re-ship for small US & overseas businesses, world-wide.
(For private individuals at cost; ask.)

'[PIC]: U5 on the picstart 16b'
2000\05\25@171733 by Mark Willis

flavicon
face
There are two models of the 16B IIRC, with two different IC's there -
check yours to make sure you don't have a 78S40 elsewhere on your
machine (It's a switching voltage regulator, btw.)  All Archive fare,
really.

(BTW those odd text characters in someone's sig line crash my modem
offline somehow - Arrgh!)

 Mark

--
I re-ship for small US & overseas businesses, world-wide.
(For private individuals at cost; ask.)

'[PIC]: Compiled HEX versus dumped HEX'
2000\05\25@172357 by rleggitt

picon face
Each line specifies an address and some data to stick there. Typically an
assembler or linker will generate the file in the order of the definition
of various ROMable chunks, but what is dumped by a debugger or etc. will
be in linear address order.

Search for "Intel hex file format", or see http://www.8052.com/tutintel.htm

{Quote hidden}

'[PIC]: Stupid things to avoid when using UDATA_OVR'
2000\05\25@183130 by Quitt, Walter

flavicon
face
Folks when writing PIC assembly:

Do NOT mix variables declared UDATA_OVR that
are used in interrupt and non-interrupt level code!
That bug took some time to figure out!
I was trying to be too clever this time......

Now I use overlayed variables ONLY in non-real
time (non-interrupt code.)  The file registers (variables)
used in interrupt service routines are either just UDATA
or UDATA_SHR.

I have yet figure out if UDATA will go down into or over
UDATA_SHR space if you run out of UDATA space.  Guess
we'll see.

GL, Walt...

'[PIC]: Re: question about PLL+ freq input'
2000\05\25@220320 by l.allen

picon face
Joep wrote:
{Quote hidden}

I think you are asking how to convert a user input in
decimal to binary that the PLL circuit uses?

Decimal (BCD) to  Binary conversion is well covered in
PICLIST archives, Microchip app notes
(http://www.microchip.com) etc. Look and learn.

_____________________________

Lance Allen
Technical Officer
Uni of Auckland
Psych Dept
New Zealand

http://www.psych.auckland.ac.nz

_____________________________

'[PIC]: was: PICSTART+..Now: Warp-13 accessories qu'
2000\05\25@230706 by Jim Robertson

flavicon
face
At 08:22 PM 5/25/00 +0530, you wrote:

Thank Ravi, this is right on. The 28-pin Zif is only for the 16C55/57 and
the 18-pin ZIF does the 16C52/4/56/58 and on some firmware vintages the
24C, 25C, 93C and 59C serial eeproms.

BTW. Anyone can download the software driver and HELP file from my web page
if
they are interested further.

http://www.new-elect.com/downloads.htm

Regards,

Jim

{Quote hidden}

Regards,

Jim Robertson
NEWFOUND ELECTRONICS
________________________________________
Email: newfoundspamspam@spam@pipeline.com.au
http://www.new-elect.com
MPLAB compatible PIC programmers.
________________________________________

'[PIC]: I2C master mode routines for 16F877?'
2000\05\26@031546 by Achim Vollhardt

flavicon
face
I am looking for some experienced guys working with the 16F877 as
master
with I2C protocol.. I have tried to figure out some working routine
from
the datasheet, but in contrast to the USART programming there is no
'to-do' list for I2C Master mode.. can anyone help me out as my own
routines don't work ?

Thanks in advance!
Achim Vollhardt

spamBeGoneavollhar.....spamphysik.unizh.ch

'[PIC]: Delays got me beat'
2000\05\26@040258 by Tim Hamel

picon face
Hi Friends,

I'm once again at everyone's mercy. I usually try to exhaust all my resources
and fight with something before posting a problem to the list; but I'm stuck.
I consider myself pretty handy with PICs, but this topic has me buried in
books and sites.

I can't, for the life of me look at a piece of delay code and tell you how
long it delays for. I've tried breaking it down, reading over David Benson's
piece about it over and over, but still have a big "?" on my forehead. The
simple one-shot delays I can figure, but this gets me:

From David Benson's "Easy PIC'n," it's been tweaked a bit:

        Movlw "value"
        Movwf  M
Pause Movlw  "value2"
         Movwf  N

Delay1 Decfsz N
        goto Delay1
        decfsz  M
        goto Pause
        return

Ok, for the finale, he gives the formula for the delay as "3MN," how!?  Could
some kind soul break down into bits and pieces so I could figure it out? I'm
going to be doing a weather project, and I'm sure I'll need this knowledge.
Hopefully, I'll be able to complete the project without being dependant on
you guys =)

Much thanks in advance,

Tim Hamel

2000\05\26@072615 by Scott Dattalo

face
flavicon
face
On Fri, 26 May 2000, Tim Hamel wrote:

{Quote hidden}

Sean breaks this down on his site. Perhaps he'll elaborate.


First, there are two nested loops. The inner one:

loop_inner
  decfsz  some_reg,f
   goto   loop_inner

The time it takes for this loop to execute depends on the contents of
"some_reg":

 some_reg   loop time
-----------------------
    1           2
    2           5
    3           8
    x           2 + 3*(x-1)   1 <= x <= 255

This says that it takes three cycles for each pass through the loop except for
the very last one which only takes two cycles.

x=0 is a special case. The first time through the loop, x will decrement to 255.
So what happens is that the maximum delay time occurs for x=0. And in fact, the
time for the loop to execute is 2 + 3*(256-1) cycles. So for x=0 you substitute
x=256 and the general formula:

 loop_time = 2 + 3*(x-1)

still applies.

The outer loop can be abstracted like so:

loop_outer:

  <some pic code>

  decfsz  some_other_reg,f
   goto   loop_outer

In other words, it's structurally identically to the inner loop with some extra
code in the loop. Let's say that the time for this extra code to execute is
'Q'. Then the total time for the outer loop is:

some_other_reg   loop time
-----------------------------
     1             Q + 2
     2             2*Q + 5
     3             3*Q + 8
     y             y*Q + 2 + 3*(y-1)   1 <= y <= 255

The same caveat for y = 0 applies. This equation can be simplified:

outer_loop_time = y*(Q+3) + 2 - 3
               = y*(Q+3) - 1

Now to combine the two loops, all we have to do is find the value for Q. This is
the time it take for this snippet to execute:

> Pause Movlw  "value2"
>           Movwf  N
>
> Delay1 Decfsz N
>          goto Delay1

There are two cycles for initializing N and then there's the loop. So the total
time is:

 Q = 2 + (2 + 3*(N-1))     , 1 <= N <= 255
   = 4 + 3*N - 3
   = 1 + 3*N

The total time for both loops is:

 total = M*(Q+3) - 1     , 1 <= M <= 255
       = M*(1+3*N +3) - 1
       = 3*M*N + 4*M - 1

(keep in mind, if M or N is 0 then we need to replace the 0 with 256)

Benson is wrong.

Scott

> some kind soul break down into bits and pieces so I could figure it out? I'm
> going to be doing a weather project, and I'm sure I'll need this knowledge.
> Hopefully, I'll be able to complete the project without being dependant on
> you guys =)

Is this why it's so hard to predict the weather?

'[PIC]: Old PIC16C5x-EMU from Parallax. Any info?'
2000\05\26@081229 by M. Adam Davis

flavicon
face
I have come across an old (1991) emulator from Parallax, inc for which I do not
have documentation or software.  Parallax sold all their PIC stuff to Tech
Tools, and I suppose this may have gone with it, but it is obsolete so I suspect
that between the two of them I'll get little information on it.

If anyone here has any information on this emulator, I would appreciate hearing
from you.  I'm also contacting Parallax and Tech Tools.

Thanks for your help!

-Adam

PS: I know, I can use the ICD I have to do basically the same thing.  I am still
interested in getting this thing working, though.

'[PIC]: Delays got me beat'
2000\05\26@112744 by pandersn

flavicon
face
Just a thought. Why not use one of the timers for an exact interrupt delay
rather than working with code loops? Example: use TMR2 and set pre- post-
and main counters so that you get the delay you want, then interrupt or
sample on that...count it in a routine.

Hope that is helpful.....

Phil

On Friday, May 26, 2000 3:02 AM, Tim Hamel [SMTP:.....TekPhobia@spam@spamAOL.COM] wrote:
> Hi Friends,
>
> I'm once again at everyone's mercy. I usually try to exhaust all my
resources
> and fight with something before posting a problem to the list; but I'm
stuck.
> I consider myself pretty handy with PICs, but this topic has me buried in
> books and sites.
>
> I can't, for the life of me look at a piece of delay code and tell you
how
> long it delays for. I've tried breaking it down, reading over David
Benson's
> piece about it over and over, but still have a big "?" on my forehead.
The
{Quote hidden}

Could
> some kind soul break down into bits and pieces so I could figure it out?
I'm
> going to be doing a weather project, and I'm sure I'll need this
knowledge.
> Hopefully, I'll be able to complete the project without being dependant
on
> you guys =)
>
> Much thanks in advance,
>
> Tim Hamel

'[PIC]: Audio Ideas?'
2000\05\26@125318 by Josh Koffman

flavicon
face
Greetings,
I had an idea, and I wonder if it would work. Basically, I want to
construct an 8 channel audio VU meter (level meter). This would be used
on a mic/line level source rather than a speaker level source. I think
there are dedicated chips for this, however I wondered if I could do it
with a pic. If I used a 16f877, i'd have 8 analogue inputs, and I could
use an 8 bit port for an 8 segment LED bar graph, and another 8 bit port
to multiplex 8 of those bar graphs. I just am not sure that feeding the
audio signal straight into the ADC would work. I know I would have to
figure out the voltage range.

Supposing this works, would it the be possible to make a small audio
spectrum analyzer? Perhaps if I put a filter on each analogue input that
only allowed one frequency, or a small frequency range through?

Anyways, I was just brainstorming. Is any of this even possible? BTW
James did I get the header right?

Thanks in advance,
Josh Koffman
@spam@joshyspammb.sympatico.ca

'[PIC]: Old PIC16C5x-EMU from Parallax. Any info?'
2000\05\26@130538 by Larry G. Nelson Sr.

flavicon
face
I have one of those along with the 2 headers for the small and large 5x
chips. I have the software around somewhere along with some documentation I
think. I haven't used it for quite a while but it did work fine. Now I use
my MPLAB ICE or Picmaster so it doesn't get used much.
What do you need.


At 08:12 AM 5/26/00 -0400, you wrote:
>I have come across an old (1991) emulator from Parallax, inc for which I
do not
>have documentation or software.  Parallax sold all their PIC stuff to Tech
>Tools, and I suppose this may have gone with it, but it is obsolete so I
suspect
>that between the two of them I'll get little information on it.
>
>If anyone here has any information on this emulator, I would appreciate
hearing
>from you.  I'm also contacting Parallax and Tech Tools.
>
>Thanks for your help!
>
>-Adam
>
>PS: I know, I can use the ICD I have to do basically the same thing.  I am
still
>interested in getting this thing working, though.
>
>
Larry G. Nelson Sr.
L.NelsonRemoveMEspamieee.org
http://www.ultranet.com/~nr

'[PIC]: Audio Ideas?'
2000\05\26@130542 by James Paul

flavicon
face
Yes, I believe all this could be accomplished.   As far as the audio
being input directly into the PIC, I would convert it to DC first
with a relatively fast filter (short time constant) to smooth the
output.  This would be better in my opinion than straight audio AC.
As fas as filters, there are many many possibilities.  But yes, this
too should work.  Unless you have some very good caps and resistors
(or inductors) though, you're not going to be very accurate.

                                        Regards,

                                          Jim




On Fri, 26 May 2000, Josh Koffman wrote:

{Quote hidden}

jimspam_OUTspamTakeThisOuTjpes.com

2000\05\26@131357 by James Paul

flavicon
face
Yes, I believe all this could be accomplished.   As far as the audio
being input directly into the PIC, I would convert it to DC first
with a relatively fast filter (short time constant) to smooth the
output.  This would be better in my opinion than straight audio AC.
As fas as filters, there are many many possibilities.  But yes, this
too should work.  Unless you have some very good caps and resistors
(or inductors) though, you're not going to be very accurate.

                                        Regards,

                                          Jim




On Fri, 26 May 2000, Josh Koffman wrote:

{Quote hidden}

spamjimspamspamjpes.com

2000\05\26@135955 by M. Adam Davis

flavicon
face
This is something I've been meaning to make.  But it will still be a month or
two before I get to it, so...

You have 1 analog input, and run the chip at 20MHz.  Use a fast fourier
transform to get the level in 10 different frequency bands, and drive a 10x10
matrix of LEDs.  One could do an 8x8 or 16x16 or just about any size spectrum
analyzer out of such a setup.  A 16f876 would have the right number of I/O to do
10x10 with one audio input and an extra i/o pin.  It may not be too much to ask
for to have it drive two 8x8 displays with two audio inputs.

At any rate, there have been several threads on FFT on a PIC in the past, look
at http://www.piclist.com/ for the archive and search for FFT.

You should probably start out doing a reguler VU meter first, then do a
peak-holding VU meter, then decide whether a spectrum analyzer is worth it or
feasable.  By then the 18Fxxx chips will be common with their 8x8 multiply to
speed your fft up quite a bit.

-Adam

Josh Koffman wrote:
{Quote hidden}

2000\05\26@145226 by Dan Michaels

flavicon
face
Josh Koffman wrote:
>Greetings,
>I had an idea, and I wonder if it would work. Basically, I want to
>construct an 8 channel audio VU meter (level meter). This would be used
>on a mic/line level source rather than a speaker level source. I think
>there are dedicated chips for this, however I wondered if I could do it
>with a pic. If I used a 16f877, i'd have 8 analogue inputs, and I could
>use an 8 bit port for an 8 segment LED bar graph, and another 8 bit port
>to multiplex 8 of those bar graphs. I just am not sure that feeding the
>audio signal straight into the ADC would work. I know I would have to
>figure out the voltage range.
>
>Supposing this works, would it the be possible to make a small audio
>spectrum analyzer? Perhaps if I put a filter on each analogue input that
>only allowed one frequency, or a small frequency range through?
.........

Writing this after reading some of the other responses:

- FFT on a PIC might be the worst way to go for this project.
 Digital bandpass filters might be better - much less computation
 intensive. Also, check a piclist thread a couple of months back
 called "Don't use Microchip's FFT".
- many past audio systems have used h.w. bandpass filters, and this
 would cetinaly work here too.
- if you really want VU meter functionality, you might need to consider
 a logarithmic scale - and remember the PIC only has 8-bit A/D which
 isn't gonna give you much dynamic range.

'[PIC]: Compiled HEX vs. dumped HEX'
2000\05\26@151744 by Peter L. Peres

picon face
Hi,

the two HEX file snippets shown indicate the same data. The first one is
typical of compiler and assembler output, with 'holes' where no data is to
be programmed, and not sorted by address, and the second is a full
'canonical' dump, typical of... dumps and (good) linker output.

The only way to compare HEX files is using a checksum computation (which
should be done by ALL the tools, including the programmer). Typical
checksums for PICs are computed by summing the bytes in the device in a 16
bit register, and printing it in hexadecimal (4 figures, modulo 0x10000).
The register is set to 0 at start. Bytes not supplied in a HEX file are
assumed to be 0xFF unless otherwise specified.

If the programmer driver says that the file was indeed programmed and
verified, then you must not worry, because it probably has been ;-) If, on
the other hand, you roll your own (driver) then you should worry ;-) ;-)

Peter

'[PIC]: [EE]: Microcontroller with 4 USARTs and 40 '
2000\05\26@232352 by Bob Ammerman

picon face
Does the application require 4  _bi_directional UARTs? Or can some of your
MIDI ports be unidirectional (ie: how many MIDI ins and MIDI outs do you
need).  Bit banging the transmit side is _much_ easier than the receive
side. You could set up an interrupt source at the bit rate (31250) and
easily have time to blast out the bits. I would suggest, perhaps, the 18C
series chips, running at a 10MHz crystal, with the PLL x4 to get 10MIPS.
This would give you 320 instructions per bit time, which is nearly
'forever'.

Unfortunately, to receive you need to run your interrupt handler somewhat
faster than the bit time.  I have successfully built a software UART using a
interrupt 6x of the bit rate. I expect 5x would work pretty well.

So, you would have to take 1 interrupt every 64 instruction times. I'm
guessing about a 8 instruction time overhead in the interrupt handler (the
18C can be quite efficient at this) and perhaps 15 instructions per
interrupt per receiver. You could handle 5 transmitters by processing them
round-robin, one per interrupt (say another 10 instructions).

Thus, our interrupt budget would be about 8 (overhead) + 15*Number of
receivers + 10 instructions.

Assuming 2 receivers, this would take about 48 instructions, leaving you
with about 2.5 MIPS for 'task-level' code.

I really think this could be done on the 18C chips!

BTW: I have developed an 18C application that directly generates (no
hardware other than the PIC and 3 resistors) a full-screen animated NTSC
(monochrome) image -- this chip can really make things happen!

Bob Ammerman
RAm Systems
(high function, high performance, low-level software)

'[PIC]: Audio Ideas?'
2000\05\27@012918 by Josh Koffman

flavicon
face
James Paul wrote:
>
>  Yes, I believe all this could be accomplished.   As far as the audio
>  being input directly into the PIC, I would convert it to DC first
>  with a relatively fast filter (short time constant) to smooth the
>  output.  This would be better in my opinion than straight audio AC.
>  As fas as filters, there are many many possibilities.  But yes, this
>  too should work.  Unless you have some very good caps and resistors
>  (or inductors) though, you're not going to be very accurate.
>
>                                          Regards,
>
>                                            Jim
Jim,
Thanks for your response. I am actually most interested in just the VU
meter section - the analyzer was just a "what if" question. What kind of
filter would I need? And why would this be better than just straight
audio AC.

Thanks
Josh Koffman
.....joshyspam.....mb.sympatico.ca

2000\05\27@014855 by Josh Koffman

flavicon
face
"M. Adam Davis" wrote:
>
> This is something I've been meaning to make.  But it will still be a month or
> two before I get to it, so...
>
> You have 1 analog input, and run the chip at 20MHz.  Use a fast fourier
> transform to get the level in 10 different frequency bands, and drive a 10x10
> matrix of LEDs.  One could do an 8x8 or 16x16 or just about any size spectrum
> analyzer out of such a setup.  A 16f876 would have the right number of I/O to do
> 10x10 with one audio input and an extra i/o pin.  It may not be too much to ask
> for to have it drive two 8x8 displays with two audio inputs.

Something like that (2 inputs, 8x8 display) sounds really interesting. I
imagine the coding for this would be pretty hard though. This is
probably a bit out of my league.

> At any rate, there have been several threads on FFT on a PIC in the past, look
> at http://www.piclist.com/ for the archive and search for FFT.
>
> You should probably start out doing a reguler VU meter first, then do a
> peak-holding VU meter, then decide whether a spectrum analyzer is worth it or
> feasable.  By then the 18Fxxx chips will be common with their 8x8 multiply to
> speed your fft up quite a bit.

Right now all I really want is the VU meter. Do you think it is even
feasible to do an 8 input, 8 bar graph out VU meter in a 16f877? Do you
have any pointers as to how to even begin? I checked the archive, and I
still am not sure how to process the input on adc to provide a proper
output on the display. If I can only get one output per pic, it would
probably be easier to use a dedicated linear chip. I only want to use
the pic for the coolness factor, plus a reduced parts count, and
eventually I can interface it with a computer.

Thanks,
Josh Koffman
spamjoshyKILLspamspammb.sympatico.ca

'[pic] 16f84/873 time/event counter/stopwatch'
2000\05\27@043015 by markwillcox56

picon face
<x-flowed>Hi all
 I would like to build a stopwatch type timer using a 16f84 or -873 @ 4Mhz.
Input on the timer/counter pin should be able to detect a rising edge to
start timer and a falling edge to stop timer(or start/stop pulse too?). I
suppose using internal TMR0/1 and count overflow flag, sum flags, store
result in some reg is the easiest way? Output the reg to portB or portC
LED's to display the time. The time intervals to be counted will probably be
on the order of 10s of milliseconds up to a few seconds. This is just a
learning project to be used to check nested timing loops for my other
projects. My thumb on my TIMEX watch gets worn out pretty fast(pun
intended!). Thanks in advance, Mark
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

</x-flowed>

'[PIC]: I2C master mode routines for 16F877'
2000\05\27@051039 by John

flavicon
face
Hello Achim & PIC.ers,

I've had to bash my own way thru this recently meself...
I cribbed, borrowed and stole whatever I could,
then went back to the 16f87x manual and wound up with
a set of master transmit <> receive routines that are
*working* - perfectly well as far as I can tell.

This app. has two Philips PCF8574   I2C general purpose
byte-wide IO port chips.
One (IO1) is dedicated to inputs only, for switch states, etc.,
while IO2 is output only, to drive a collection of panel
LEDs.

I have used private macros like :-
       bank0        ;use ram bank0
       bank1        ;use ram bank1
       movlf           ;load literal to freg
       movff            ;load freg1 to freg2
etc.,  these should need no introduction, but if they do, let me know..

Setup the ports by :-
       setup_i2c

Invoke a IO1 port read by:-
       read_switches      ;byte-wide result in freg`latest_switch_state'

Invoke a IO2 port write by:-
                                               ;put desired byte into freg
'led_state'
       write_leds



;****************** I2C macros begin
start_i2c         MACRO              ;[S]
    bank0                                     ;bank0 (bank0? names) be sure
    bcf             PIR1,SSPIF
    bank1                                           ;bank1
    bsf             SSPCON2,SEN     ;send i2c START [S] bit
    bank0                                       ;bank0
    btfsS         PIR1,SSPIF         ;start bit cycle complete?
    goto         $-1
      endm

enable_receive_i2c     MACRO
    bank1                                           ;bank1
    bsf             SSPCON2,RCEN     ;enable receiving at master 16f877
    bank0                                           ;bank0
    bcf             PIR1,SSPIF
    btfsS         PIR1,SSPIF             ;sspbuf buffer full byte?
    goto             $-1
      endm

stop_i2c         MACRO                  ;[P]
    bank0                                           ;bank0
    bcf             PIR1,SSPIF
    bank1                                           ;bank1
    bsf             SSPCON2,PEN         ;send i2c STOP [P] bit
    bank0                                           ;bank0
    btfsS         PIR1,SSPIF             ;stop bit cycle completed?
    goto         $-1
          endm

wait_for_ack_i2c         MACRO
    bank0                                           ;bank0
    bcf             PIR1,SSPIF
    btfsS         PIR1,SSPIF                 ;ACK received?
    goto         $-1
      endm

setup_i2c         MACRO                          ;setup mssp for i2c
    movlf         00101000b,SSPCON     ;=0x028
    bank1
    movlf         10000000b,SSPSTAT
    movlf         01100000b,SSPCON2
    movlf         00001010b,SSPADD
    bank0
      endm

read_switches     MACRO                   ;io1 is inputs only
    start_i2c
    movlf             01000011b,SSPBUF     ;send out io1 pcf8574 addr
    wait_for_ack_i2c
    enable_receive_i2c
    movff             SSPBUF,latest_switch_state
    stop_i2c
      endm

write_leds MACRO                                   ;io2 is output only
    start_i2c
    movlf             01000100b,SSPBUF                 ;sned out io2
address, writing
    wait_for_ack_i2c
    movff             led_state,SSPBUF
    wait_for_ack_i2c
    stop_i2c
      endm
;***************** I2C macros end




{Quote hidden}

Hope this all makes sense,

best regards,   John


e-mail from the desk of John Sanderson, JS Controls.
Snailmail:          PO Box 1887, Boksburg 1460, Rep. of South Africa.
Tel/fax:            Johannesburg  893 4154
Cellphone no:   082 469 0446
email:                jsandspam_OUTspamspam_OUTpixie.co.za
Manufacturer & purveyor of laboratory force testing apparatus, and related
products and services.

'[pic] Which is the best 'C' compiler for PIC?'
2000\05\27@052117 by markwillcox56

picon face
<x-flowed>Hi all
 I would your views and comments on PIC'C". I would like to start writing
my PIC code in C. Where can I get a compiler specifically for PIC? Who makes
the best(at a reasonable cost). Which is the most widley used? Which is the
easiest to learn?
So many questions! Thanks for your responses, Mark
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

</x-flowed>

'[PIC]: Audio Ideas?'
2000\05\27@071653 by Bob Ammerman

picon face
This sounds like a neat project.

If you want to do the Vu meter thing, you might consider the following
design:

Take each analog input, run it thru an op-amp to buffer it (so you don't
affect the signal in its normal use).

Take the output of the op-amp and half-wave rectify it with a diode
(actually, I think you have to include the diode in the op-amp's feedback
somehow so that you don't have the diode drop affecting your output).

Run the resulting DC signal thru a resistor to a cap. This forms a simple
low-pass filter.

Connect the cap to an A/D input on the PIC.

In your PIC code, periodically reprogram the A/D input to be an output and
drive it low. This will discharge the CAP.

Then, go back to an A/D input, give the signal time to charge the cap up
(this time interval should be very consistent), then read the voltage on the
cap.

Since you want a logarithmic display, you could actually just use each bit
of the converted result to drive one of the LED's (each LED would then
represent a factor of 2 (I think that is 3 dB!).

Have fun.

Bob Ammerman
RAm Systems
(high function, high performance, low level software)

'[PIC]: PIC to PIC wireless transmission'
2000\05\27@072323 by Bob Ammerman

picon face
Since you are going 1-way, you will have no way of knowing if your data got
to the other side. Thus, you are going to need some form of 'forward error
correction'. The simplest way to do this is to just repeat your message
multiple times, and hope the other side gets it. Of course, there is NO way
to guarantee the other side get it. You can improve your chances if you send
the data in multiple small packets, each with an identifier. The receiver
then assembles the full message by piecing together whatever packets its
receives successfully.

Bob Ammerman
RAm Systems
(high function, high performance, low level software)

'[PIC]: Audio Ideas?'
2000\05\27@074016 by Alok Dubey

flavicon
face
hi,
if u include the diode in the opamps f/b u have a log amp there itself...
might as well use an offset DC on it to make it fn as a log amp and simply
give this o/p to a A/D convertor.. and some nice math to compute the o/p in
db.
again ur diode should be a nice one.. and some temp compensation will be
reqd..
this is a std log amp ckt Vo/p =ln (Vi/p)=2.303log(Vi/p)
have fun and let me knw what u up to..

Alok


{Original Message removed}

'[PIC]: Were can i find source codes and schematics'
2000\05\27@080650 by Ricardo Reis

flavicon
face
Thank you

'[PIC]: Audio Ideas?'
2000\05\27@132915 by rottosen

flavicon
face
Josh Koffman wrote:
{Quote hidden}

How about a compromise on the coolness factor?

Use a PIC (or it may need the higher speed of an SX) to generate the
clocks to several switched capacitor filters.

Just a thought  :-)

-- Rich

2000\05\27@143919 by Jim P

flavicon
face
Oops! Did anyone else catch this?

"of the converted result to drive one of the LED's (each
LED would then represent a factor of 2 (I think that is 3 dB!)."

- S/B  "6" dB

(Not meaning to beat a dead horse or anything - but here's
 a quick review of the dB anyway ...)

Voltage factor of         2 = 6 dB
Voltage factor of  1.414 = 3 dB

Power ratio of 2 = 3 dB
Power ratio of 4 = 6 dB

Computing decibels:
Power ratio:    10 * log_sub_base10 (P1/P2) = dB
Voltage ratio:  20 * log_sub_base10 (P1/P2) = dB


{Original Message removed}

2000\05\27@150031 by Jim P

flavicon
face
Correction on the last formula:

Voltage ratio:  20 * log_sub_base10 (V1/V2) = dB



----- Original Message -----
From: Jim P <@spam@jvpollRemoveMEspamdallas.net>
To: <PICLIST@spam@spamEraseMEMITVMA.MIT.EDU>
Sent: Saturday, May 27, 2000 1:36 PM
Subject: Re: [PIC]: Audio Ideas?


Oops! Did anyone else catch this?

"of the converted result to drive one of the LED's (each
LED would then represent a factor of 2 (I think that is 3 dB!)."

- S/B  "6" dB

(Not meaning to beat a dead horse or anything - but here's
 a quick review of the dB anyway ...)

Voltage factor of         2 = 6 dB
Voltage factor of  1.414 = 3 dB

Power ratio of 2 = 3 dB
Power ratio of 4 = 6 dB

Computing decibels:
Power ratio:    10 * log_sub_base10 (P1/P2) = dB
Voltage ratio:  20 * log_sub_base10 (P1/P2) = dB

2000\05\27@150243 by Bob Ammerman

picon face
Right you are of course. (What can I say, I'm a programmer Jim, not an
Electrical Engineer!). I should have known better tho'.

Bob Ammerman
(high function, high performance, low level software)

{Original Message removed}

2000\05\27@150906 by Jim P

flavicon
face
... sawright ... that's what we're here for!

Jim

----- Original Message -----
From: Bob Ammerman <spam_OUTRAMMERMANspam_OUTspamRemoveMEPRODIGY.NET>
To: <RemoveMEPICLISTspam.....MITVMA.MIT.EDU>
Sent: Saturday, May 27, 2000 1:51 PM
Subject: Re: [PIC]: Audio Ideas?


Right you are of course. (What can I say, I'm a programmer Jim, not an
Electrical Engineer!). I should have known better tho'.

Bob Ammerman
(high function, high performance, low level software)

----- Original Message -----
From: Jim P <spamjvpoll@spam@spamDALLAS.NET>
To: <PICLISTTakeThisOuTspamMITVMA.MIT.EDU>
Sent: Saturday, May 27, 2000 2:36 PM
Subject: Re: [PIC]: Audio Ideas?


{Quote hidden}

the
{Quote hidden}

'[PIC]: Delays got me beat'
2000\05\27@173336 by Sean Breheny

face picon face
Hi Tim and Scott,

As Scott says, I have information about PIC loops on my page at

http://www.people.cornell.edu/pages/shb7/lop.html

I recently found out that the section on a certain type of loop (called N2
on my page) was incorrect, so I just corrected that, and added some great
suggestions from Scott and Reggie Burdin. Long overdue update of that page!

It looks like you did a better job of explaining this than I could do,
Scott. The only thing is that I get 3*M*N + 4*M + 1, instead of -1 at the
end. I think you may have forgotten the two instructions at the very top of
the loop, but it is possible that I could be the one making the mistake.

Sean


At 06:24 AM 5/26/00 -0500, you wrote:
{Quote hidden}

for
>the very last one which only takes two cycles.
>
>x=0 is a special case. The first time through the loop, x will decrement
to 255.
>So what happens is that the maximum delay time occurs for x=0. And in
fact, the
>time for the loop to execute is 2 + 3*(256-1) cycles. So for x=0 you
substitute
{Quote hidden}

extra
{Quote hidden}

This is
>the time it take for this snippet to execute:
>
>> Pause Movlw  "value2"
>>           Movwf  N
>>
>> Delay1 Decfsz N
>>          goto Delay1
>
>There are two cycles for initializing N and then there's the loop. So the
total
{Quote hidden}

| Sean Breheny
| Amateur Radio Callsign: KA3YXM
| Electrical Engineering Student
\--------------=----------------
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
shb7EraseMEspamcornell.edu ICQ #: 3329174
_____________________________________________
NetZero - Defenders of the Free World
Click here for FREE Internet Access and Email
http://www.netzero.net/download/index.html

'[PIC]: I2C master mode routines for 16F877?'
2000\05\27@234501 by Damon Hopkins

flavicon
face
Achim Vollhardt wrote:
>
>  I am looking for some experienced guys working with the 16F877 as
> master
>  with I2C protocol.. I have tried to figure out some working routine
> from
>  the datasheet, but in contrast to the USART programming there is no
>  'to-do' list for I2C Master mode.. can anyone help me out as my own
>  routines don't work ?
>
>  Thanks in advance!
>  Achim Vollhardt
>
>  EraseMEavollharspamspamBeGonephysik.unizh.ch

I have the Serial PIC'n book which has some I2C master mode routines in
it that I could probably get for you.. I'll have to look to see if I
legally can but I probably will be able to.. have you looked at the
techref site (link off of http://www.piclist.com) there's ALOT there (I don't
know much about I2C though) But I'd imagine it's there..

                       Damon Hopkins

'[PIC]: [EE]: Microcontroller with 4 USARTs'
2000\05\28@070501 by Alan B Pearce

face picon face
>Unfortunately, to receive you need to run your interrupt handler somewhat
>faster than the bit time.  I have successfully built a software UART using a
>interrupt 6x of the bit rate. I expect 5x would work pretty well.

You get away with 4 samples per bit time if you are not doing it synchronous to
the bit edges. Many years ago before high speed async modems were commonly
available we used to send async data through synchronous modems, and could do it
with no errors if the async baud rate was a quarter of the sync modem rate.

2000\05\28@082711 by Bob Ammerman

picon face
Of course this depends on the quality of your signal.

This thread has got me to thinking, and coding, and I am pretty sure I've
come up with a way to get 4 in and 4 out at 31250buad on a PIC18CXX2 at 10
MIPS. The trick involves accumulating input samples on each channel and
processing them 5 at a time instead of one-by-one. This idea was inspired by
byte-at-a-time CRC algorithms. Basically you end up with a monster state
machine, about 70 states, with 32 (ie: 2^5) possible inputs for each state.
The state machine is then stored as one whopping big (about 8K) table. But
hey, what's 8K when you've got 32K on chip? :-)

Bob Ammerman
RAm Systems
(high function, high performance, low level software).

{Original Message removed}

'[EE][PIC] How to measure level of liquids and sens'
2000\05\28@174123 by Hugo Jorge Mller

flavicon
face
Hello

I am beginning to work in the final project of my career of Electronic
Engineering and at the moment, we have decided to make the following work
(with a friend): To automate a plant of Concrete.

The idea is to use a PC for the general control of the plant and to arm a
network (Possibly RS485) with terminals that will be slaves working with
PICs, to complete different tasks, as the following ones:

1) To control the pneumatic servos and read proximity sensores and other.

2) To Sense the weight of the materials with cells of loads, indicate the
value measured in a  7 segments display and to send the measures througt the
network when they are requested or periodically. This partly would be
resolved, but I accept ideas and suggestions in this respect.

3) To Sense the level of water in the main dosificador tank. The tank should
be filled until certain level and then it is pumped to the truck concrete
mixer. I have think in sense the height of the column of liquid with a
sensor of pressure Motorola of the series MPX, I also thought of the
ultrasonic solution  but I don't have idea that resolution i can achieve.
The tank in question has 1100 Liters and a height of about 2 meters. aprox.,
it is cylindrical. I need a precision of about 5 liters. (or better).
Ideas? Comments? Other viable methods?
On the other hand I should dose some aditives, special liquids that
unfortunately they are corrosive and at the moment it is filled a small tank
of about 26 liters by means of a key, for graveness, then they closes this
key (superior) and two keys open up, one in the inferior part that allows
the exit of the preservative toward the MIXER and the other one in the
superior part that injects compressed air at 10 Kg/cm^2 to impel to the
preservative and to pump it without having contact with the same one.
The problem is to measure the level or the quantity of this aditive without
touch it and to be able to pump it too to the mixer.
I thought of measuring it with sensor MPX, but the problem is when opening
the key of compressed air, the sensor doesn't support 10 Kg/cm^2 (although
it could measure in differential form, but I suppose that the transitory one
provoked, it would destroy to the silicon sensor).
Here it is where I request them help that mensuration methods advise me?

Somebody had worked with sensor MPX with PICs ?  What kind of interface/ ADC
use ?

4) Another topic not less difficult of solving it is to be able to measure
the relative humidity that there is in the sand and in the concrete once
blended. Here the only method that I am happened (electronic) it is between
two by means of the mensuration of conductivity electrodes of a material
that is not oxidized, located inside the material to measure, at a certain
distance. That other methods or variantes suggests me?

As for the net RS485, has somebody used them with PICs? That protocols
suggest? Some link with information?

Good, I won't extend more in the detail, I wait their collaboration with
ideas...

Sorry if there are errors in the text, but my language is Spanish  :-)

Thank you from already.

Hugo J. M|ller
H.J.M. Hardware & Software Diseqos Electrsnicos
San Nicolas 683
Tel-Fax : 54-(0)-343-424-5953
(3100) Parana (Entre Rmos) Argentina
Email : hmuller [ANTISPAM-QUITAR-ESTO] @arnet.com.ar
Web Site: http://www.pagina.de/hjm
UIN (ICQ) : 38.605.074

'[EE]:[PIC]: How to measure level of liquids and se'
2000\05\28@201049 by Gennette, Bruce

flavicon
face
       Looks do-able to me.

       Reading proximity sensors, reading load cells and displaying values
on request while regularly logging them is simple PIC stuff.

       Measuring liquid heights can be done several ways, but as you are
already reading proximity switches why not use that method for this task
too?  Use a captive rod in a guide above a float to trip proximity switches
above your tanks (KISS principle).  Also gives a visual indication of the
amount in the tank as the rod rises above the rim.

          ______  _
            ||  <||
            ||x <|| sensors
            ||  <||
          _ || _ ||
       ___| || |_||_________
       |  | || |           |
       |  | || |           |  Use courier font to see diagram
       |    ||             |
       | ___||___          |
       |_|float |__________|
       | |______|          |
       |                   |
       |       liquid      |
       |                   |
       |___________________|

       This should also work for your special additive liquids as long as
you use compatible materials for the float and rod.  For increased accuracy
use tall, thin tanks (large, vertical pipes?).

       Humidity sensors are available in 1-wire devices.  [I assume you
need to know the humidity in several feeds to guess the amount of water
contained in the raw materials (sand and gravel) to calculate the real
amount of material being added and the water to be added]

       Good luck.

       <original message>

       To automate a plant of Concrete.

       The idea is to use a PC for the general control of the plant and to
arm a
       network (Possibly RS485) with terminals that will be slaves working
with
       PICs, to complete different tasks, as the following ones:

       1) To control the pneumatic servos and read proximity sensores and
other.

       2) To Sense the weight of the materials with cells of loads,
indicate the
       value measured in a  7 segments display and to send the measures
througt the
       network when they are requested or periodically. This partly would
be
       resolved, but I accept ideas and suggestions in this respect.

       3) To Sense the level of water in the main dosificador tank.
       <snip>

'[PIC]: Romzap'
2000\05\28@201308 by Tony Nixon

flavicon
picon face
Hi all,

I've just uploaded the new ROMzap which includes some new software to
aquire data from one of the A2D inputs.

You can get aquisition in auto, manual or burst mode.
The results are stored in the PC and are written to a text file with
time stamping and alarm triggers.
External triggers (pos or neg edge) on any IO pin
Graphical display of the data
Alarm set points which can also change state of any IO pin

http://www.picnpoke.com/demo/ROMzap.html

--
Best regards

Tony

http://www.picnpoke.com
TakeThisOuTsalesspamTakeThisOuTpicnpoke.com

'[PIC]: [EE]: Microcontroller with 4 USARTs and 40 '
2000\05\28@221344 by Bob Ammerman

picon face
This thread has fascinated me from the beginning. I was sure that it was
possible to do this on a PIC.

What I have come up with so far:

I have designed, and written the critical code for, a scheme permitting 5
full-duplex software UARTs. This code requires a timer-driven interrupt at 5
times the baud rate. Code path in the interrupt handler, counting all
overhead, with all 5 channels going full blast in both directions, is 55
instruction times max, 51 instruction times average. This drops down
somewhat if the channels are running at less than full speed.

The simulated UARTS sample the input at 5x the baud rate, and determine bits
using the majority vote of the center 3 samples for each bit.

They detect framing errors, and can handle receive data streams slightly
faster than the nominal rate (ie: the stop bit can be less than 5 samples
long, so the UART can slip properly to handle a  slightly overspeed input).

Both receive and transmit are double-buffered so that task level has an
entire byte time to handle a received character or prepare the next
character for transmission.

Relating this to the problem at hand:

On a 10MIP 18CXX2 chip (10MHz clock, PLL'd to 40MHz on chip), with a baud
rate of 31250, the interrupt rate would be every 64 instruction times. This
will leave at least 9 and on average 13 instructions between interrupts.

Thus, 'task level' code will get about 13/64 = 20% or so of the 10MIPs.  You
can get quite a bit done with the remaining 2 MIPS!

For anyone who is interested, the basic structure of the interrupt handler
is something like this (expressed in a combination of pseudocode and "C" to
make it easier to follow, but the real code is of course assembly):

send values computed by last interrupt for output bits to the hardware

fetch current values input bits from the hardware into 5 5-bit shift
registers, one per channel.

switch (phase)
{
case 0:
   phase = 1;
   compute next output bit for channel 0
   process last 5 input bits received by channel 0
   break;

case 1:
   phase = 2;
   compute next output bit for channel 1
   process last 5 input bits received by channel 1
   break;

case 2:
   phase = 3;
   compute next output bit for channel 2
   process last 5 input bits received by channel 2
   break;

case 3:
   phase = 4;
   compute next output bit for channel 3
   process last 5 input bits received by channel 3
   break;

case 4:
   phase = 0;
   compute next output bit for channel 4
   process last 5 input bits received by channel 4
   break;
}

The phrase 'compute next output bit for channel N' simply figures out what
start, data, or stop bit is to be sent.

The phrase 'process last 5 input bits received by channel N' involves using
the 5 input bits, treated as a 5 bit number, as an input to a large state
machine stored as a table in program memory. This will determine a new
state, and possibly an action to be performed (setting a bit in the receiver
register, or marking a byte received (correctly or with a framing error)).

Bob Ammerman
RAm Systems
(high function, high performance, low-level software)

'[PIC] Re: Help: Thermometer CTN'
2000\05\29@040753 by TOM THERON

flavicon
face
If you do not HAVE to use a thermistor, I'd suggest a Dallas sensor DS1624,
I2C interface directly to PIC16F84, measures -55 to 125 degrC in 0.03 degree
increments.


Regards
Tom

"Designing a future"
MMS Electronic Systems
Tel +27-(0)12-6645696
Fax. +27-(0)12-6642682
Mobile. 0833109007

'[PIC]: WIZPIC'
2000\05\29@091627 by andy howard

flavicon
face
From: "Brian Devlin" <hitrackspamspam_OUTLINEONE.NET>



> Has anyone tried WIZPIC or any other windows based simulator. I am
thinking
> of buying one and would like some feedback first.
> Thanks

Yes, I use the PICDE simulator in WizPIC pretty much all the time. I
much prefer it to the MPLAB sim. The INCLUDED code generator is useful
for cobbling together quick one-offs and proof-of-concept prototypes
too.

I'd recommend printing off the documentation 'cos it does take a bit of
reading and not all the docs are supplied as hardcopy.

The only really big disadvantage is the irritating voice "feature",
luckily it can be disabled.









.

'[PIC]: [EE]: Microcontroller with 4 USARTs and 40 '
2000\05\29@140350 by Bob Ammerman

picon face
Oops, I left out one more point.

The original requirement was for 4 channels, not 5. The interrupt rate
doesn't change as channels are deleted, but both maximum and average
interrupt handler times will go down.

For 5 channels: max is 55, average is 51 (2.0 MIPs available for task-level)
For 4 channels: max is 53, average is about 44 (3.1 MIPs available for
task-level)
For 3 channels: max is 51, average is about 38 (4.1 MIPs available for
task-level)
For 2 channels: max is 49, average is about 31 (5.2 MIPs available for
task-level)
For 1 channel: max is 44, average is about 22 (6.6 MIPs available for
task-level)

Bob Ammerman
RAm Systems
(high function, high performance, low-level software)

2000\05\29@140353 by Bob Ammerman

picon face
Points very well taken here. It is very good to take advantage of apriori
knowledge of the data stream.

Bob Ammerman
RAm Sytems
(high function, high performance, low level software)

{Original Message removed}

'[PIC]:UMPS and SXKEY'
2000\05\29@161415 by piclist.com

face picon face
www.piclist.com

for a link and brief directions for using Tony Nixon's Parapic to convert
the Scenix code to Parallax mnemonics.

Also, please use [OT]: rather than [OT] and finally, this is not off topic
as the Scenix is a PIC clone. So, please use [PIC]: instead.

James Newton, PICList Admin #3
spamjamesnewton@spam@spampiclist.com
1-619-652-0593 phone
http://www.piclist.com

----- Original Message -----
From: Soon Lee <spam_OUTpslnTakeThisOuTspamKILLspamCYBERWAY.COM.SG>
To: <RemoveMEPICLIST@spam@spamspamMITVMA.MIT.EDU>
Sent: Monday, May 29, 2000 08:22
Subject: [OT]UMPS and SXKEY


Hi
any one know of any way to convert parallax sxkey code to hex code that is
compatible with UMPS

'[PIC]: 16F873 stopwatch code wanted'
2000\05\30@030810 by Tony Nixon

flavicon
picon face
Mark Willcox wrote:
>
> Hi all
>   I would like to build a simple stopwatch using a 16f873 @ 4Mhz(xt). The
> stop/start could be on RA4/TOCS or an external interrupt on RB0. Once
> started, I would like the counter to incf a register(s)each FF to 00
> overflow and count the number of overflows during run time(# of overflows x
> machine cycles = ms or sec)? I would like this stopwatch to be able to count
> from milliseconds up to seconds(if possible). I would like to display the
> count register(s) total at the end(stop) of count on ports B&C(2 x 8 LED
> bargraphs). Any help you can give will be greatly appreciated, thanks in
> advance, Mark
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

Got no idea if it works properly.

Key press on PORTA,0 reads and sets data on PORTB,C.

       include "P16f873.inc"

       CBLOCK 0x20

TimeH
TimeL
Debounce
KeyFlag

       ENDC

       org 0h

       clrf PORTA
       clrf PORTB
       clrf PORTC
       bsf STATUS,RP0
       movlw b'11000010'
       movwf OPTION_REG
       movlw b'00000001'
       movwf TRISA
       clrf TRISB
       clrf TRISC
       movlw b'10000110'
       movwf ADCON1
       bcf STATUS,RP0

       clrf Debounce
       movlw b'00000001'       ; flag key is up
       movwf KeyFlag
       clrf TimeH
       clrf TimeL

Reset   movlw 84h
       movwf TMR0
       bcf INTCON,T0IF

WtLoop  btfss INTCON,T0IF       ; 1mS @ 4MHz
       goto WtLoop

       incf TimeL
       btfsc STATUS,Z
       incf TimeH

       movf Debounce
       btfsc STATUS,Z
       goto ButtChk

       decf Debounce
       goto Reset

ButtChk btfss PORTA,0   ; test for low
       goto IzLow

       btfss KeyFlag,0
       goto Reset      ; already pressed

       bcf KeyFlag,0   ; flag key is down
       movlw 10h
       movwf Debounce

       movf TimeH,w    ; output data to PortB & C
       movwf PORTB
       movf TimeL,w
       movwf PORTC

       clrf TimeH      ; reset timers
       clrf TimeL
       goto Reset

IzLow   btfsc KeyFlag,0
       goto Reset      ; already released

       bsf KeyFlag,0   ; flag key up
       movlw 10h               ; just pressed
       movwf Debounce
       goto Reset


       end
--
Best regards

Tony

http://www.picnpoke.com
RemoveMEsalesRemoveMEspamTakeThisOuTpicnpoke.com

'[PIC]: Multiple IRQ'S ?'
2000\05\30@060801 by Kbek Tony

flavicon
face
Hi,
What's the 'best' way to interface several external irq requests ?
PortB change feature seems 'no-go', OR'ing several irq's
to the INT pin seems doable ( and then poll which one it was )
but potentially dangerous ( strong possibility of missing one ).

Any suggestions ?

/Tony


Tony KŸbek, Flintab AB            
ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ
E-mail: tony.kubekTakeThisOuTspam@spam@flintab.com
ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ

2000\05\30@061628 by Michael Rigby-Jones

flavicon
face
If the interrupt signal is likely to be too short to be able to poll in the
ISR, then maybe you could use something like an SR flip flop for each IRQ.
The incomming interrupt would set the output of the flip flop which can be
diode OR'ed to the int pin.  The ISR would have the responsibility of
clearing each flip flop after servicing its interrupt.  With a bit of
cunning (and a resistor or two) you could use the same PIC pin to read and
reset the flip flop.

Mike

> {Original Message removed}

'[EE][PIC] How to measure level of liquids and sens'
2000\05\30@092333 by M. Adam Davis

flavicon
face
You are putting this into a concrete plant?  You should really use some sort of
industrial solution.  A number of companies make non contact and contact
distance sensors specifically for liquid level measurement.  The one I am
thinking of now for your application is a non contact laser liquid level sensor,
which you simply point down on the liquid.  Many of these can be used in
corrosive environments (glass, stainless steel, etc) as well.

As far as the water content of sand, the only thing I can think of would be to
take a certian volume of the sand, and weigh it.  The same volume will be
heavier the more damp it is.  I don't think the usual method of electrodes
spaced so far apart will be very accurate (nevermind having to replace them
every month, and recalibrate them daily due to wear) Most dampness/humidity
sensors require contact with the substance you are measuring.  Perhaps you can
tell us more about the properties of wet sand.  Does it reflect a lightsource
differently depending on its dampness?

-Adam

Hugo Jorge M|ller wrote:
{Quote hidden}

'[PIC] LCD driving trouble'
2000\05\30@095007 by Andre

flavicon
face
Hi all !

I«ve been working on a CPU used to control a high teperature high pressure chamber based on a 16C622A.
It has a LCD display (16x1) been drived using nibbles instead of 8 bits words. Unfortunatly I have no more free I/O pins to use.
The problem is as follow:
1. When I first turn the CPU ON everything goes right. The LCD shows the message it was programed to show.
2. If I turn the CPU OFF and not after one or two seconds back to ON again the LCD shows anything but the message it was programed to show.
3. If I wait a little bit more (5 sec.) before turning the LCD back to ON again everything goes right.
4. If I turn the CPU OFF and back to ON two times without wait all goes ok.
I am sening the data without using the LCD R/W pin. The data is sent to the display and the program waits it to stabilize before sending the next 4 bits.

Any comments or sugestions are welcome !!!

Andre
acollingTakeThisOuTspamspamBeGonezaz.com.br

2000\05\30@103444 by Dwayne Reid

flavicon
face
<x-flowed>At 10:44 AM 5/30/00 +0100, Andre wrote:
>Hi all !
>
>I«ve been working on a CPU used to control a high teperature high pressure
>chamber based on a 16C622A.
>It has a LCD display (16x1) been drived using nibbles instead of 8 bits
>words. Unfortunatly I have no more free I/O pins to use.
>The problem is as follow:
>1. When I first turn the CPU ON everything goes right. The LCD shows the
>message it was programed to show.
>2. If I turn the CPU OFF and not after one or two seconds back to ON again
>the LCD shows anything but the message it was programed to show.
>3. If I wait a little bit more (5 sec.) before turning the LCD back to ON
>again everything goes right.
>4. If I turn the CPU OFF and back to ON two times without wait all goes ok.
>I am sening the data without using the LCD R/W pin. The data is sent to
>the display and the program waits it to stabilize before sending the next
>4 bits.

My off the cuff suggestion is that you are not properly initing the
LCD.  According to specs, you must issue the 'switch to 8 bit mode' *3*
times before switching to switching to 4 bit mode.  Repeat: you have to
issue the 'function set' command with the 8 bit mode bit set for a total of
THREE times before changing to 4 bit mode.

You would do this in your PIC init routines after each power up
reset.  Give it a try!

dwayne



Dwayne Reid   <spamdwaynerTakeThisOuTspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 16 years of Engineering Innovation (1984 - 2000)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

</x-flowed>

2000\05\30@120804 by Jilles Oldenbeuving

flavicon
face
Hi Andre!


You might want to check the supply voltage to the processor. With some
capacity in your system
supply voltage will not be immediatly 0 V when you switch of the supply.
Let's say the voltage will
be 2.0 V when you switch on the supply again, a brown - out will occur. i.e.
the processor is
plain not running due to the fact that the Vdd didn't reach 0 V... i've seen
this in a consumer product
(vacuum cleaner). When programming your device be sure to set brown-out
detect on (and maybe
adapt your program to this).


By waiting longer before switching on the supply you make sure that Vdd will
reach 0 V, and thus
a brown-out will not occur.....


Regards,

Jilles Oldenbeuving
.....jillesspamspamBeGonerendo.dekooi.nl
-----Oorspronkelijk bericht-----
Van: Andre <.....acollingTakeThisOuTspamEraseMEZAZ.COM.BR>
Aan: RemoveMEPICLISTspamspamKILLspamMITVMA.MIT.EDU <STOPspamPICLISTEraseMEspamMITVMA.MIT.EDU>
Datum: dinsdag 30 mei 2000 15:53
Onderwerp: [PIC] LCD driving trouble


Hi all !

I«ve been working on a CPU used to control a high teperature high pressure
chamber based on a 16C622A.
It has a LCD display (16x1) been drived using nibbles instead of 8 bits
words. Unfortunatly I have no more free I/O pins to use.
The problem is as follow:
1. When I first turn the CPU ON everything goes right. The LCD shows the
message it was programed to show.
2. If I turn the CPU OFF and not after one or two seconds back to ON again
the LCD shows anything but the message it was programed to show.
3. If I wait a little bit more (5 sec.) before turning the LCD back to ON
again everything goes right.
4. If I turn the CPU OFF and back to ON two times without wait all goes ok.
I am sening the data without using the LCD R/W pin. The data is sent to the
display and the program waits it to stabilize before sending the next 4
bits.

Any comments or sugestions are welcome !!!

Andre
acollingspamBeGonespamzaz.com.br

'[PIC] Pic tools & scenix chips ?'
2000\05\30@121631 by Don B. Roadman

flavicon
face
I want to try to use Scenix chips as a faster pic, but I don't want to
mess around too much learning the Scenix stuff. I want to stick to
Pic mnemonics. Is it possible to use Mplab to write code for
scenix? How about hi-tech compiler? Are there include files that
would help do this? I realize that the simulator wont work, and the
programmer has to be specific for the scenix. I do want to run the
scenix at 50Mhz, or there would be no reason to use it instead of a
pic.
If anyone is using scenix with existing pic tools I would appreciate
any pointers for how to do it.

Thanks,
Don

2000\05\30@131239 by Dan Michaels

flavicon
face
At 11:21 AM 05/30/2000 -0500, you wrote:
>I want to try to use Scenix chips as a faster pic, but I don't want to
>mess around too much learning the Scenix stuff. I want to stick to
>Pic mnemonics. Is it possible to use Mplab to write code for
>scenix? How about hi-tech compiler? Are there include files that
>would help do this? I realize that the simulator wont work, and the
>programmer has to be specific for the scenix. I do want to run the
>scenix at 50Mhz, or there would be no reason to use it instead of a
>pic.
>If anyone is using scenix with existing pic tools I would appreciate
>any pointers for how to do it.
>
>Thanks,
>Don
>

For a cheap entry into SX, take a look at the SX-Blitz programmer
from Parallax - available for $59 from Jameco. It comes with its own
assembler/dev_environment, rather than using PIC tools, but it's
really no big problem for someone already familiar with PIC.

2000\05\30@145432 by Andrew Seddon

picon face
> I want to try to use Scenix chips as a faster pic, but I don't want to
> mess around too much learning the Scenix stuff. I want to stick to
> Pic mnemonics. Is it possible to use Mplab to write code for
> scenix? How about hi-tech compiler? Are there include files that
> would help do this? I realize that the simulator wont work, and the
> programmer has to be specific for the scenix. I do want to run the
> scenix at 50Mhz, or there would be no reason to use it instead of a
> pic.
> If anyone is using scenix with existing pic tools I would appreciate
> any pointers for how to do it.
>
> Thanks,
> Don
>

I seem to remember seeing a workaround somewhere take a look at this I`m
pretty sure the link is on there http://www.svtehs.com . However I think it will
probably end up being more trouble than it`s worth. I have fairly limited
programming experience but once I had grasped the concepts it dosn`t really
matter the language you use. This is especially true with assembler where
there is a limited command set anyway. At the moment there is no schematics
for a debugger so I would recommend the SX-KEY, i use one of these and have
found it to be very usefull. As for the HI-TECH compiler, as far as I am
aware unless they have altered it since I last asked them it does not work
with the SX. However there is a shareware compiler available from
www.geocities.com/SiliconValley/Network/3656/c2c/c.html
It`s pretty good apart from the lack of built in routines and it`s very
cheap to register.

I would defintely recommend the SX if you have the patience. Unfortunately
there is very little support compared to the PIC and you will have to figure
some stuff out for yourself.

2000\05\30@161513 by rottosen

flavicon
face
Look at:
http://www.rhoent.com/sxops.pdf   and
http://www.rhoent.com/startmp.zip   and also
http://www.rhoent.com/ncoman.pdf plus
http://www.rhoent.com/sxncoex.zip

I think this is what you may have in mind.
These files were created using PIC mnemonics because I have a huge
amount of PIC software that I have written over the years. I also hate
the weird asymmetry of the SX op-code mnemonics.

If you stick with 100% PIC syntax, I think MPLAB will do everything you
need except electrically program the SX. The SX-Blitz can do the
programming using the hex file.

-- Rich


"Don B. Roadman" wrote:
{Quote hidden}

2000\05\30@181308 by w. v. ooijen / f. hanneman

picon face
The compiler I wrote (Jal) targets both scenix and a few pics. It creates
(apart from a hex file) an asm file that can be assembled with mpasm. A few
macros take care of the scenix-specific instructions. You could take a look
at the header of the created asm file and copy the macros.
Wouter

PS I added a colon after the [PIC] so maybe you will not receive this
(.....)

> I want to try to use Scenix chips as a faster pic, but I don't want to
> mess around too much learning the Scenix stuff. I want to stick to
> Pic mnemonics. Is it possible to use Mplab to write code for
> scenix?

'[PIC]: 16F873 stopwatch code wanted'
2000\05\30@190317 by Tony Nixon

flavicon
picon face
Sorry for the logish post, but this may work better.

I wrote the other in a few spare minutes before knock off last night.

        include "P16f873.inc"

        CBLOCK 0x20

TimeH
TimeL
Debounce
Flags
DelayH
DelayL

        ENDC

;
; Set Delay value 1 - 65535 mS
;

Delay = 1

         org 0h

         clrf PORTA
         clrf PORTB
         clrf PORTC
         bsf STATUS,RP0
         movlw b'11000010'
         movwf OPTION_REG
         movlw b'00000001'
         movwf TRISA
         clrf TRISB
         clrf TRISC
         movlw b'10000110'
         movwf ADCON1
         bcf STATUS,RP0

         clrf Debounce
         movlw b'00000001'   ; flag key is up
         movwf Flags
         clrf TimeH
         clrf TimeL

         clrf DelayH
         clrf DelayL

         movlw 84h
         movwf TMR0
         bcf INTCON,T0IF

WtLoop    btfss INTCON,T0IF   ; 999uS @ 4MHz
         goto WtLoop

         bcf INTCON,T0IF
       movlw 84h
         movwf TMR0

       incf DelayL           ; increment delay count
       btfsc STATUS,Z
       incf DelayH

       movlw High(Delay)     ; if = Delay value then
       xorwf DelayH,W        ; increment the Time counter
       btfss STATUS,Z
       goto ButtChk

       movlw Low(Delay)
       xorwf DelayL,W
       btfss STATUS,Z
       goto ButtChk

       incf TimeL
       btfsc STATUS,Z
       incf TimeH

       clrf DelayH
       clrf DelayL

ButtChk movf Debounce         ; read key if debounce = 0
       btfsc STATUS,Z
       goto DoButt

       decf Debounce
       goto WtLoop
;
; Key input is high when released
;
DoButt  btfss PORTA,0         ; test for low
       goto IzLow

       btfsc Flags,0
       goto WtLoop           ; already released

       bsf Flags,0           ; flag key is now up
       movlw 10h
       movwf Debounce
       goto WtLoop

IzLow   btfss Flags,0
       goto WtLoop           ; already released

       bcf Flags,0           ; flag key now down
       movlw 10h
       movwf Debounce

       movf TimeH,w          ; output data to PortB & C
       movwf PORTB
       movf TimeL,w
       movwf PORTC

       clrf TimeH            ; reset timers
       clrf TimeL
       clrf DelayH
       clrf DelayL
       bcf INTCON,T0IF
       movlw 84h
       movwf TMR0
       goto WtLoop

       end

--
Best regards

Tony

http://www.picnpoke.com
sales@spam@spampicnpoke.com

'[PIC]: Multiple IRQ'S ?'
2000\05\31@043053 by Kbek Tony

flavicon
face
Hi,

Mike wrote:
>If the interrupt signal is likely to be too short to be able to poll in
the
>ISR, then maybe you could use something like an SR flip flop for each
IRQ.
>The incomming interrupt would set the output of the flip flop which can
be
>diode OR'ed to the int pin.  The ISR would have the responsibility of
>clearing each flip flop after servicing its interrupt.  With a bit of

Yes that was my idea.

>cunning (and a resistor or two) you could use the same PIC pin to read
and
>reset the flip flop.

Hmm this got me stumbled, how ? cant figure out a circuit that would
work
using the same pin as input/reset.
Would You care to elaborate ?


/Tony

Tony KŸbek, Flintab AB            
ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ
E-mail: spam_OUTtony.kubekspamspamflintab.com
ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ

2000\05\31@090859 by Alok Dubey

flavicon
face
use the good old obselete 8086 based interrupt ctlr.. i forgot the number..
but this is essentially what i did.
alok


{Original Message removed}

'[PICS]: Re: Windows vs Linux'
2000\05\31@091109 by Andrew Kunz

flavicon
face
HiTech also has a Linux distribution of the PICC compiler, I understand.

Andy









Ries van Twisk <riesspam_OUTspamRemoveMEFRANKSINTL.NL> on 05/31/2000 08:40:26 AM

Please respond to spamriestspamBeGonespamfranksintl.nl








To:      spamPICLISTRemoveMEspamMITVMA.MIT.EDU

cc:      (bcc: Andrew Kunz/TDI_NOTES)



Subject: Re: Windows vs Linux








Hai,

I'm not familair yet window developing PIC software on a Linux box.
I do now that the C2C compiler is compatible with Linux. And I
guess programming a PIC from a Linux box is posible to.

That one thing I can say is that Linux is robust. My servers here ans
at company runs smothly (only one real crash because I run out of
temporary disk space). At home it never crached and my laptop
never crashed.
I use the Debian distributions (slink).

Ries

'[EE][PIC] How to measure level of liquids and sens'
2000\05\31@094056 by Hugo Jorge Mller

flavicon
face
Adam:
  How work the laser measurement of liquid (water) level ? Do you know
something that sell this sensores ready to use ?

With respect to wet sand properties, i don't have more information that
you.. sorry  I am in the beggining of my project and
recolecting information, I am not a expert on sand and concret ;-)

TIA.

Hugo

{Original Message removed}

2000\05\31@101338 by riest

flavicon
face
Maby I'm jumping in the middle of a discussion but ever thought
about using ultrasonic transducer?
The only thing you have to do is doing some calibration.

Ries

2000\05\31@102419 by Alok Dubey

flavicon
face
yeah they are the best soln.. sonar type thngies//
alok

-----Original Message-----
From: Ries van Twisk [KILLspamriesspam_OUTspamspam_OUTFRANKSINTL.NL]
Sent: Wednesday, May 31, 2000 3:01 PM
To: PICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU
Subject: Re: [EE][PIC] How to measure level of liquids and sense
relativehumidity?


Maby I'm jumping in the middle of a discussion but ever thought
about using ultrasonic transducer?
The only thing you have to do is doing some calibration.

Ries

2000\05\31@103251 by Robert A. LaBudde

flavicon
face
<x-flowed>The normal method of measuring effective humidity in wood, concrete, sand,
etc., is by conductivity.

Use a 1 kHz square-wave from the PIC through two stainless steel probes
spaced a fixed distance apart. For wood and concrete, use needles.

Measure the conductivity as an unknown resistance in a bridge and read it
with an ADC input.

The method is not a priori specific for water, but it can be calibrated on
materials in a specific environment.

The official method for moisture is to weigh the sand, cook for 4 hrs @ 125
C (=270 F), and weigh again. The weight loss is crude moisture.

Conductivity is also used as a surrogate for other measurements, such as pH
in pool water or plant soil.

Tap water usually has a conductivity of 1-200 uS/cm. The water in the sand
would be probably 100x larger than this, up to 20,000 uS/cm. Therefore the
effective resistance of 1 cm apart probes would be expected to be 50 ohm or
more.


================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: spamBeGoneralspamspamspamBeGonelcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causas scire"
================================================================

</x-flowed>

2000\05\31@114707 by Don Hyde

flavicon
face
Some colleagues here took on a liquid-level sensor based on ultrasonic
ranging, and were suprised at what a major project it turned into.

For starters, cost was an important issue.  It turns out that, like with
many things, there are two kinds of ultrasonic transducers -- cheap ones
that aren't very good and very expensive ones that are still only pretty
good.

After spending a lot of time dealing with analog noise, they got down to
difficult problems with ringing in the transducer, multiple reflections, and
the fact that all the transducer's properties varied a whole lot with
temperature.  Then they got to work compensating for the fact that, while
the speed of sound in air and water vapor is fairly well-behaved, the speed
of sound in diesel fuel vapor is not.  It varies a lot, and in a highly
nonlinear fashion, with temperature (and to a lesser extent, from one batch
of fuel to another).

> {Original Message removed}

2000\05\31@115957 by Dan Michaels

flavicon
face
At 10:42 AM 5/31/00 -0500, you wrote:
>Some colleagues here took on a liquid-level sensor based on ultrasonic
>ranging, and were suprised at what a major project it turned into.
>
>For starters, cost was an important issue.  It turns out that, like with
>many things, there are two kinds of ultrasonic transducers -- cheap ones
>that aren't very good and very expensive ones that are still only pretty
>good.
>
>After spending a lot of time dealing with analog noise, they got down to
>difficult problems with ringing in the transducer, multiple reflections, and
>the fact that all the transducer's properties varied a whole lot with
>temperature.  Then they got to work compensating for the fact that, while
>the speed of sound in air and water vapor is fairly well-behaved, the speed
>of sound in diesel fuel vapor is not.  It varies a lot, and in a highly
>nonlinear fashion, with temperature (and to a lesser extent, from one batch
>of fuel to another).
>

For a slightly different viewpoint, I consulted with a company that
used std Polaroid ultrasonic transducers to determine the level of
ice in an icemaker machine. They had 10s of 1000s of unitsin the
field. This device is quite easy to interface, and fairly cheap,
and used just a couple of chips running off a 6805 uC, which provided
control and took measurements.

However, the transducers always had a heavy coating of water
condensate on them, so I was always amazed they didn't have
horrendous reliability problems. Eventually, they gave them up for
a simpler/cheaper solution involving a thermistor in a tube.

best regards,
- Dan Michaels
==============

2000\05\31@131201 by M. Adam Davis

flavicon
face
One source has level (and flow) sensors here:
http://www.omega.com/toc_asp/section.asp?book=green&section=K

You might also check out their conductivity and resistivity sensors:
http://www.omega.com/green/index.html#ph

It is not inexpensive, but when you're dealing with industrial work it is often
better to use the appropiate equipment than develop your own if you aren't very
familiar with it.

-Adam

Hugo Jorge M|ller wrote:
{Quote hidden}

> {Original Message removed}

2000\05\31@153624 by Mark Willis

flavicon
face
Laser could be aimed at say 30 degrees from vertical onto the waters'
surface, a sensor at 30 degrees the other side of vertical would pick up
specular reflection, BUT:

Water's top surface isn't perfectly flat so you get early "hits",
perhaps want several photodiodes and to think on how to handle the top
surface wave problem there.  If you have a top styrofoam "float" atop
the water, stick a reflective mylar sheet on there and you have specular
reflection again, and reduce the wave problem <G>

There are capacitive sensors used to detect water levels also.

What's wrong with a cheap and easy, hot bead thermistor solution,
though?  Constant current through a thermistor to intentionally
self-heat it to say body temperature or so, when in free air -  then
measure the resulting voltage - when water level rises to where the
thermistor is covered in water, it'll cool the thermistor in a heck of a
hurry, thus voltage change and you know the water's there.  Want the
water to not spray onto the thermistor, of course, placing the
thermistor inside a tube or if needed adding a tank water inlet baffle
will solve that though <G>  Yeah, it's contact sensing, I know.

 Mark

Hugo Jorge M|ller wrote:
{Quote hidden}

<snip>

2000\05\31@155109 by Patrick J

flavicon
face
And how about another even simpler way ?
(which might even prove to work in the real world!)

Just stick a pipe down in the fluid and measure the air pressure that
builds in the pipe when the level rises. There are sensors availfor it.

'[PIC] LCD driving trouble'
2000\05\31@155928 by Peter L. Peres

picon face
Hi,

I have seen this happen with 2 x 16 LCD. The reason is that the LCD takes
a very long time to decay all its internal voltages. Here are 5 fixes
(which should be applied together for good results):

- Set the B'1000' fixed combination on D0-D3 of the LCD. Refer to the LCD
controller data sheet for why (the code that initializes the display
interface size).

- Use the 'long' initialization sequence every time (see LCD data sheet).

- Place a small resistor (1-2k) in parallel with the LCD power pins to
help drain the voltage quickly. You can use a low value contrast pot for
this to avoid adding parts. This assumes that you can live with the extra
power drain (2.5-5mA @5V).

- Have a turn-on delay of 0.5 sec at least before talking to the LCD after
applying power.

- You can save a lot of power by leaving the LCD on and using the display
off command (measure yours), This removes the reset problem if the unit
has soft power control.

Peter

'[EE][PIC] How to measure level of liquids and sens'
2000\05\31@160118 by Dan Michaels

flavicon
face
Mark Willis wrote:
.........
>What's wrong with a cheap and easy, hot bead thermistor solution,
>though?  Constant current through a thermistor to intentionally
>self-heat it to say body temperature or so, when in free air -  then
>measure the resulting voltage - when water level rises to where the
>thermistor is covered in water, it'll cool the thermistor in a heck of a
>hurry, thus voltage change and you know the water's there.  Want the
>water to not spray onto the thermistor, of course, placing the
>thermistor inside a tube or if needed adding a tank water inlet baffle
>will solve that though <G>  Yeah, it's contact sensing, I know.
>

Plus, I suspect you could use 2 or more thermistors arranged
vertically within the tube, plus a little math, to actually
determine the level, not just whether above/below one point.

2000\05\31@163637 by Mark Willis

flavicon
face
Dan Michaels wrote:
> Mark Willis wrote:
> .........
> >What's wrong with a cheap and easy, hot bead thermistor solution,
> >though?  Constant current through a thermistor to intentionally
> >self-heat it to say body temperature or so, when in free air -  then
> >measure the resulting voltage - when water level rises to where the
> >thermistor is covered in water, it'll cool the thermistor in a heck of a
> >hurry, thus voltage change and you know the water's there.  Want the
> >water to not spray onto the thermistor, of course, placing the
> >thermistor inside a tube or if needed adding a tank water inlet baffle
> >will solve that though <G>  Yeah, it's contact sensing, I know.
> >
>
> Plus, I suspect you could use 2 or more thermistors arranged
> vertically within the tube, plus a little math, to actually
> determine the level, not just whether above/below one point.

True on multiple height determination - though (despite my being pretty
good in math) I don't see where the math's needed/applicable.  I thought
with 3 hot beads, you'd know one of 4 states, {"Height < A" || "Height
>= A" || "Height >= B" || "Height >= C"}, don't see how you can determine shades of height between say A and B (putting A lowest, C highest here, to clarify.)  Am I missing something?  Has been a "Bad Brain Day" to some degree <G>  (There's not a big difference for thermistor B in temperature, between temperature for water say 1 foot below it and 1 inch below it, barring splashing, is there?  Has been a while since I last hot-beaded <G>)

 Mark

2000\05\31@190953 by Dan Michaels

flavicon
face
Mark  wrote:
....
>>
>> Plus, I suspect you could use 2 or more thermistors arranged
>> vertically within the tube, plus a little math, to actually
>> determine the level, not just whether above/below one point.
>
>True on multiple height determination - though (despite my being pretty
>good in math) I don't see where the math's needed/applicable.  I thought
>with 3 hot beads, you'd know one of 4 states, {"Height < A" || "Height
>>= A" || "Height >= B" || "Height >= C"}, don't see how you can determine
shades of height between say A and B (putting A lowest, C highest here, to
clarify.)  Am I missing something?  Has been a "Bad Brain Day" to some
degree <G>  (There's not a big difference for thermistor B in temperature,
between temperature for water say 1 foot below it and 1 inch below it,
barring splashing, is there?  Has been a while since I last hot-beaded <G>)
>

Not that I've ever tried this, but I figure the temperature variation
would distribute itself along the tube in some manner [to be measured
and calibrated empirically], and the math would be some weighted
averaging routine. Just a thought. The sorta thing you try once, and
immediately get a strong hunch whether it will ever work or not.

- Dan

2000\05\31@194532 by Gennette, Bruce

flavicon
face
Yeah, my washing machine uses this to 'control' the level of water used.
It's not very accurate, but in a washing machine who cares if it's a few
litres out?  But in a concrete plant the amount of water added controls the
workability, setting time and, to a degree, the final strength of the
concrete, so it *MAY* not be accurate enough.

Bye.

       {Original Message removed}

'[PIC]:School DAQ project'
2000\05\31@213241 by David and Melanie

flavicon
face
Hi,
   My name is David and I am going to a technical college in Victoria BC Canada.  In my data acquisition course we are setting up a small strain gauge scale feeding a ADC.  We will be using an f84.  I was wondering if anybody had any suggestions as how to go about processing the information being read in serailly from the ADC.  I was just going to take a series of readings and average them, but our instructor encourages us to use the internet for information.  I have been monitoring the list for a month now, but haven't seen much for this area.

   Thank you for your time.

David Gates

'[EE]:,[PIC]: How to measure level of liquids and s'
2000\05\31@213705 by Mark Willis

flavicon
face
Dan Michaels wrote:
{Quote hidden}

Aaah, you're thermally bonding the hot beads to the tube?  Perhaps
that'd work, might want to instead put a heater at the top of a small
rod, bond the thermistors to the rod, use them to measure along the rod,
maybe would work.

Good news is that you can use one larger PIC and run quite a few
thermistors simultaneously to get many data points simultaneously.
Sigma Delta code's not too hard to find <G>

 Mark

'[EE][PIC] How to measure level of liquids and sens'
2000\05\31@235651 by John Orhan

flavicon
face
Hi ,
Where can I find sensors to measure the air pressure. I had exactly the same
idea for a water level meter on a boat, but could not source any sensors to
do the pressure measuring. Please advise.John Orhan
Detection Systems / EDM Engineering Department
Ph: 02 96721233 (ext 219)
Fx: 02 9672 4093
Email: @spam@jorhanspamspamspam_OUTedm.com.au


{Original Message removed}


'[PIC]:School DAQ project'
2000\06\01@003657 by Chris Eddy
flavicon
face
David;

Although your question is somewhat broad (you will get better answers if you are specific) you can find a good quantity of very accurate info on digital filters in the last month of posts.  I would look at piclist.com or piclist.org and search the archives.  If you run into specific problems with an approach, someone will probably leap at the oportunity to beat the gremlins out of it then.

Chris Eddy

David and Melanie wrote:

> Hi,
>     My name is David and I am going to a technical college in Victoria BC Canada.  In my data acquisition course we are setting up a small strain gauge scale feeding a ADC.  We will be using an f84.  I was wondering if anybody had any suggestions as how to go about processing the information being read in serailly from the ADC.  I was just

2000\06\01@023803 by Gennette, Bruce

flavicon
face
When you say 'scale' do you mean like a science laboratory balance or like
an old speedometer needle in a car moving across some numbers ?

If it is a balance then you should be able to remotely switch on/off, tare
and take readings.  You should be able to select between take the current
reading, wait for *SOME* stability, wait for total stability, or take the
average over a range of time periods.  Your display *MUST* give user
feedback when any of the above are changed and must also acknowledge unit
changes and accuracy changes.  A common addition is the ability to 'batch
count' - e.g. you put 1 coin on, then 5, then 10, then an unknown amount and
the balance tells you how many coins (or whatever you are counting) are on
it until you change modes.
To be *REALLY* clever you can add a routine to re-calibrate the scale - e.g.
when you start the re-calibration routine the display request a series of
masses to measure; after weighing the series of (6 or 8) masses any
non-linearity is compensated for in a lookup table stored into EEPROM.

Is this enough ?

       {Original Message removed}

'[EE][PIC] How to measure level of liquids and sens'
2000\06\01@024621 by markwillcox56

picon face
<x-flowed>put carbon granuals, powder, or antistatic foam in a plastic pipe,open at
one end for pressure. connect one wie to each end and you have a pressure
sensitive resistor. or mabey use an old carbon mic from a telephone? just
some thoughts..... Mark


{Quote hidden}

>{Original Message removed}

2000\06\01@025450 by markwillcox56

picon face
<x-flowed>how about a float from a toilet connected to a LVDT or a pot at the fulcrum?


>From: John Orhan <JOrhanspamspam_OUTEDM.COM.AU>
>Reply-To: pic microcontroller discussion list <.....PICLISTRemoveMEspamKILLspamMITVMA.MIT.EDU>
>To: TakeThisOuTPICLISTKILLspamspam.....MITVMA.MIT.EDU
>Subject: Re: [EE][PIC] How to measure level of liquids and sense relat ive
>             humidity?
>Date: Thu, 1 Jun 2000 13:57:01 +1000
>
>Hi ,
>Where can I find sensors to measure the air pressure. I had exactly the
>same
>idea for a water level meter on a boat, but could not source any sensors to
>do the pressure measuring. Please advise.John Orhan
>Detection Systems / EDM Engineering Department
>Ph: 02 96721233 (ext 219)
>Fx: 02 9672 4093
>Email: jorhanspam_OUTspamspamBeGoneedm.com.au
>
>
>{Original Message removed}

'[PIC]:[EE]: School DAQ project'
2000\06\01@053754 by teix1

flavicon
face
Hi,

As the description is not detailed, I try to guess some normal problems in
this type of work:
The strain gauge should be supplied with a reference voltage DC or AC of
high stability: if the voltage is the usual +5V and you use a bridge you
would have the output with 1/2 of the ripple existing in +5V.
As the signal you get is small, you should have the analog processing
(perhaps instrumentation amplifiers) near the sensor and have all the ground
connections mounted  in a star . It would be advisable to have a RC filter
with capacitors for high frequency and that  that means using ceramic. You
can filter again with active filters if necessary.
Near the input of the ADC again a small RC filter, and now you can occupy
the ADC ( 10 , 12 bit,... ?) converting all the time and take averages.

Regards

fernando teixeira

{Original Message removed}

'[PIC] AT Keyboards --- Not all equal!'
2000\06\01@081918 by mike

flavicon
face
On Wed, 31 May 2000 17:49:44 -0400, you wrote:

{Quote hidden}

I played around with PC keyboards a few years ago. I found two
problems running with different makes - firstly the clock rate can
differ significantly between keyboards, and secondly many keyboards
had automatic XT/AT mode detection. This worked in several different
ways, some of which confused my product - e.g. one keyboard would send
a code with a deliberate parity error, and if the host didn't request
a re-send it went into XT mode.
Although XTs are long dead, it's entirely possible that this
functionality may remain in some current keyboards if they are based
on old firmware.

'[PIC]: Truck tachometer'
2000\06\01@110224 by Octavio Nogueira

flavicon
face
> >Picking up the ignition pulse is more exact.
>
> Most trucks are diesel and don't have one of these. Perhaps this is why he
is
> looking at the alternator?
>
> My idea would be to have some form of sensor mounted to sense the teeth on
the
> starter ring gear. This would probably give a more consistent pulse pickup
then
> alternator frequency.

What about picking the fuel injector pulse? I was
thinking in applying this to measure RPM and fuel
consume.
to measure the width of the pulse I will use CCP

Friendly Regards

Octavio Nogueira
===================================================
nogueira.....spam@spam@propic2.com                  ICQ# 19841898
ProPic tools - low cost PIC programmer and emulator
http://www.propic2.com
===================================================

{Original Message removed}

2000\06\01@110847 by Alan B Pearce

face picon face
>What about picking the fuel injector pulse? I was
>thinking in applying this to measure RPM and fuel
>consume.
>to measure the width of the pulse I will use CCP

probably easier to get at than the starter ring gear. Also kills two birds with
one stone, if you are needing fuel consumption data. I do not know how accurate
it would be, put probably accurate enough.

'[PIC]: External SRAM on PIC (or AVR)'
2000\06\01@113832 by Bennett, Matt

flavicon
face
If you've used the external SRAM (as in STATIC, not serial) on a PIC or AVR-
which SRAM did you use?  I'm having problems finding a 64Kx8 part that is
pin compatible (without gates other than an address latch) and is in stock
somewhere.  I could go to a 2 32K SRAMs, but I'd rather not.

The PIC (17C) uses an ALE, /OE, /WR scheme, and the AVR uses an ALE, /RD,
/WR scheme.  The PIC appears compatible with the 61XXX family of SRAMs (64Ks
are currently being made of Unobtanium [Un]), but in my brief search, I
haven't found any that are directly compatible with the AVR's scheme.
Serial RAMs are not an option, due to speed issues.

Matt Bennett

'[PIC]: Chip test program??'
2000\06\01@114458 by Don B. Roadman

flavicon
face
Is there any program written to exercise a PIC to see if it is working
properly? I know it couldnt be perfect, but I searched the net
looking for code that might have been used to verify probably good
operation of a pic. I'm interested in overclocking, and I'm sure
others are too, so I figured someone might have written a routine
that pretty well wrings out a pic to verify correct operation. I tested
some 4 mhz chips with a little sequential led flashing program, and
these chips "seemed" to work at 20 Mhz, but still, I feel uneasy
about overclocking anything unless I have a pretty good feel for it.

'[EE]:,[PIC]: How to measure level of liquids and s'
2000\06\01@115140 by Dan Michaels

flavicon
face
Mark  wrote:
.....
>> Not that I've ever tried this, but I figure the temperature variation
>> would distribute itself along the tube in some manner [to be measured
>> and calibrated empirically], and the math would be some weighted
>> averaging routine. Just a thought. The sorta thing you try once, and
>> immediately get a strong hunch whether it will ever work or not.
>>
>> - Dan
>
>Aaah, you're thermally bonding the hot beads to the tube?  Perhaps
>that'd work, might want to instead put a heater at the top of a small
>rod, bond the thermistors to the rod, use them to measure along the rod,
>maybe would work.
>

Yeah, that's pretty much what I had in mind. Although I am not a
thermal engineer, it seems to me there will generally be a temperature
difference between the fluid, now matter what it is, and the air
above it - due to thermal inertia - so a heater may not be required.
I'd have to try this to see how it would work. It might work with
3 thermistors this way - one at the bottom [in the fluid], one at the
top [out of the fluid], both of which act as references, and one in
between to do the actual weighted measurement - all bonded to the same
long tube.
=============

>Good news is that you can use one larger PIC and run quite a few
>thermistors simultaneously to get many data points simultaneously.
>Sigma Delta code's not too hard to find <G>
>

For production stuff, I think most companies would want to go with
as few parts as they could get away with --> costs, plus reliability
issues.

- Dan

'[PIC] 12C508 OSCCAL value'
2000\06\01@121733 by Bill Colville

flavicon
face
I am trying to program a 12C508/JW for the first time and when I
read the calibration value it shows C70. When I try to use 0xC70 in
MPASM it issues an error message saying " argument out of
range. least significant bits used". What should I be entering?

Bill

'[PIC]: Truck tachometer'
2000\06\01@122155 by Dale Shelor

flavicon
face
>
>What about picking the fuel injector pulse? I was
>thinking in applying this to measure RPM and fuel
>consume.

If it is a Diesel it's probably mechanical injected.  Only the lastest
diesel trucks have electroniclly controlled injection.  It may be possible
to read the mechanical injection pulses with a load cell on one of the
injection lines.  If it is a newer electroniclly controlled diesel then you
can probably find the RPM as serial data from the engine fuel computer.
The new Volvo trucks have a Motorola 68HC11 in the dash just to control the
gauges.  It appears a lot of info (RPM, speed, temp, oil pressure) is sent
as signal serial data stream to the dash. (But they still run hoses all the
way to the dash and have mechanical air pressure gauges!)

For low RPM engines (like diesel trucks) the alternator is not real bad
source for RPM.  Oldsmobile did it for years on their diesel cars. (not
saying that Oldsmobile did anything right with a diesel car! 0-60 in 32
seconds, those were the days...)

Dale

'[EE]:,[PIC]: How to measure level of liquids and s'
2000\06\01@125948 by Mark Willis

flavicon
face
Dan Michaels wrote:
{Quote hidden}

It'd depend on situation, around here on a cold day that wouldn't work
well though - if the temp's 55F and the water pours in at 55F, you would
need to rethink - in hotter climes, 55F vs. 80F, easy to see the
difference.  Worth a try some time when you have "spare time", that
elusive thing we never have enough of <G>  I wouldn't expect
self-heating from the thermistors to work in this situation, bet you
don't either;  power resistors are cheap and plentiful though <G>  (Bond
a 5W or so resistor inside the top of the tube, use polyurethane power
cable out the top, seal the ends with PVC cement goop after scratching
the cable to give you good bonding and then using that purple MEK stuff
to prep the cable?  Seems to work pretty well in past, IME.  Run say
1-2W into the resistor so it won't be over stressed.)

> >Good news is that you can use one larger PIC and run quite a few
> >thermistors simultaneously to get many data points simultaneously.
> >Sigma Delta code's not too hard to find <G>
> >
>
> For production stuff, I think most companies would want to go with
> as few parts as they could get away with --> costs, plus reliability
> issues.

Sure - So long as it works <G>

> - Dan

--
I re-ship for small US & overseas businesses, world-wide.
(For private individuals at cost; ask.)

'[PIC]:School DAQ project'
2000\06\01@132103 by Matt Bonner

flavicon
face
David and Melanie wrote:

> My name is David and I am going to a technical college in
> Victoria BC Canada.

Hi David,  Chris gave you a good starting point.  Which
college in Victoria - Camosun College?  I taught the
embedded systems course (once) there a few years ago and
convinced the powers-that-be to move from Intel to PIC.  Say
Hi to Don Evans and Les Papp for me (if those old fogies are
still there).

--Matt

'[PIC]: Chip test program??'
2000\06\01@132507 by Mark Willis

flavicon
face
In the uChip Advanced seminars (IIRC) they discuss this;  Anyone know if
that concept's on the uChip web site?

Don't want to do this on an OTP part unless you make it part of your
power-up code, of course.

 Mark

Don B. Roadman wrote:
> Is there any program written to exercise a PIC to see if it is working
> properly? I know it couldnt be perfect, but I searched the net
> looking for code that might have been used to verify probably good
> operation of a pic. I'm interested in overclocking, and I'm sure
> others are too, so I figured someone might have written a routine
> that pretty well wrings out a pic to verify correct operation. I tested
> some 4 mhz chips with a little sequential led flashing program, and
> these chips "seemed" to work at 20 Mhz, but still, I feel uneasy
> about overclocking anything unless I have a pretty good feel for it.

--
I re-ship for small US & overseas businesses, world-wide.
(For private individuals at cost; ask.)

Display limited to first 300 matches. Add keywords to narrow the result set or browse by year:
- In 2000 , 2001 only
- Today
- New search...