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'.

Truncated 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\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 TakeThisOuTdavidwEraseMEspamspam_OUTggx.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 "RemoveMEsonyedespamTakeThisOuTiway.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 <picsEraseMEspam.....parallaxinc.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 - EraseMEfastfwdspamix.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
RemoveMErobTakeThisOuTspamspamwheels.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 <EraseMExaqspamspamspamBeGoneINDIRECT.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
RemoveMEclydeKILLspamspamhitech.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 infoSTOPspamspamspam_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: spamBeGoneestrautsSTOPspamspamEraseMEix.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 <KILLspamPICLISTspamBeGonespamMITVMA.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 - EraseMEfastfwdspamEraseMEix.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
<@spam@rdmiller@spam@spamspam_OUTexecpc.com>

1996\05\06@173356 by Bob Fehrenbach

picon face
Xaq <spamBeGonexaqspamKILLspamINDIRECT.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     .....bfehrenbspam_OUTspamexecpc.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
>TakeThisOuTnogueira.....spamTakeThisOuTmandic.com.br
>http://ourworld.compuserve.com/homepages/tato

-------------------------
Jerry Durand
Durand Interstellar, Inc.
tel:  +1 408 356-3886
fax:  +1 408 356-4659
TakeThisOuTjdurandKILLspamspamspaminterstellar.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:   .....nogueiraspamRemoveMEmandic.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:   RemoveMEnogueiraspamspamBeGonemandic.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 spamBeGonemajordomo@spam@spamspam_OUTparallaxinc.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:   TakeThisOuTnogueiraspamspammandic.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 majordomoEraseMEspamparallaxinc.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 <RemoveMEpicsEraseMEspamspam_OUTparallaxinc.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 - @spam@fastfwdRemoveMEspamEraseMEix.netcom.com                 ===
=== Fast Forward Engineering - Vista, California          ===
===                                                       ===
=== Custodian of the PICLIST Fund -- For more info, see:  ===
=== http://www.geocities.com/SiliconValley/2499/fund.html ===


'[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 <EraseMEw.bennettspam@spam@sct.gu.edu.au>)
<@spam@w.bennettspam_OUTspam.....SCT.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
spamBeGonefthompsoEraseMEspammail.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?


'[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
shb7spamBeGonespamcornell.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
RemoveMEtjaart@spam@spamspamBeGonewasp.co.za

|--------------------------------------------------|
|                WASP International                |
|R&D Engineer : GSM peripheral services development|
|--------------------------------------------------|
|SMS .....tjaart@spam@spamEraseMEsms.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          |
|--------------------------------------------------|

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
.....shb7RemoveMEspamcornell.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
.....shb7STOPspamspam@spam@cornell.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}


'[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   <RemoveMEdwaynerspamspamBeGoneplanet.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
spamBeGonebarryKILLspamspam@spam@nrgsystems.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
rlandryspam_OUTspam@spam@haywood.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
spamBeGonebob@spam@spamdrzyzgula.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
spamBeGonebobspam_OUTspamRemoveMEdrzyzgula.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: <.....Pine.LNX.3.96.990503081050.221BspamRemoveMEprof.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
"foobarspam@spam@winnt.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
<RemoveMEmwillisKILLspamspamTakeThisOuTfoxinternet.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:

spamBeGoneLISTSERVspam@spam@MITVMA.MIT.EDU (i.e. RemoveMELISTSERVspam_OUTspamMITVMA.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
<PICList-RequestspamspamMITVMA.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 <spam_OUTPICList-Requestspam_OUTspamspam_OUTMITVMA.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:

LISTSERVspam_OUTspamMITVMA.MIT.EDU (i.e. RemoveMELISTSERVKILLspamspam@spam@MITVMA.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-RequestspamBeGonespam.....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, KILLspammwillisspam.....nwlink.com
 Changing to <spam_OUTmwillisspamKILLspamFoxInternet.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 RemoveMEmwillisRemoveMEspamEraseMEfoxinternet.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


'[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

'[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 KILLspamsalesspamspamBeGonepicnpoke.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 <jd62spamspamPIXIE.CO.ZA>
To: <RemoveMEPICLISTspamBeGonespamRemoveMEMITVMA.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 KILLspamsalesspamBeGonespampicnpoke.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":

@spam@LISTSERVSTOPspamspam@spam@MITVMA.MIT.EDU (i.e. LISTSERVspamBeGonespamspamBeGoneMITVMA.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-RequestspamMITVMA.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 spam_OUTPICList-RequestSTOPspamspamMITVMA.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:

RemoveMELISTSERVspamspamMITVMA.MIT.EDU (i.e. TakeThisOuTLISTSERVspamspamRemoveMEMITVMA.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:

<KILLspamPICList-Requestspamspamspam_OUTMITVMA.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, mwillisRemoveMEspamFoxInternet.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
EraseMEshb7STOPspamspamRemoveMEcornell.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
spam_OUTshb7RemoveMEspamEraseMEcornell.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 TakeThisOuTjamesnewtonRemoveMEspam@spam@geocities.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: EraseMElu2aoqRemoveMEspamyahoo.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   <spamdwayner.....spamspamplanet.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!
------------------------------------------------------------------
andyspam_OUTspam@spam@rc-hydros.com      http://www.rc-hydros.com     - Race Boats
.....andyspamspam.....montanadesign.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   <dwaynerKILLspamspamEraseMEplanet.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   EraseMEmaverick@spam@spam@spam@drgw.net, @spam@ndholmesspamspamKILLspamiastate.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   spamBeGonemaverickRemoveMEspamEraseMEdrgw.net, RemoveMEndholmesKILLspamspamRemoveMEiastate.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!
------------------------------------------------------------------
TakeThisOuTandyspamrc-hydros.com      http://www.rc-hydros.com     - Race Boats
spamBeGoneandyKILLspamspamTakeThisOuTmontanadesign.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!
------------------------------------------------------------------
EraseMEandy.....spamKILLspamrc-hydros.com      http://www.rc-hydros.com     - Race Boats
spamandyspammontanadesign.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!
------------------------------------------------------------------
andySTOPspamspamrc-hydros.com      http://www.rc-hydros.com     - Race Boats
andySTOPspamspamKILLspammontanadesign.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 <@spam@support.....spamspamMONTANADESIGN.COM>
To: spamPICLIST.....spam.....MITVMA.MIT.EDU <PICLIST.....spamMITVMA.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 <.....fernteix.....spamRemoveMETELEWEB.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
------------------------------------------------------------------
spam_OUTandyTakeThisOuTspamEraseMErc-hydros.com      http://www.rc-hydros.com     - Race Boats
EraseMEandyspamBeGonespamKILLspammontanadesign.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
RemoveMEshb7spamBeGonespamspamcornell.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.RolfspamspamUAlberta.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}


'[pICLIST] Warp13 programmer ...'
2000\02\04@094420 by John C. Frenzel
picon face
----- Original Message -----
From: "Moser, Carl Woodrow, JR (Carl)" <TakeThisOuTcwmoserKILLspamspam@spam@LUCENT.COM>
To: <.....PICLISTRemoveMEspamMITVMA.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


'[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


'[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: KILLspamimkespspamTakeThisOuTexcite.com ; TakeThisOuTismaelmspamspam_OUTiai.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"
RemoveMEspeffspamspamSTOPspaminterlog.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.

.....WeslayEraseMEspamaol.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:spamBeGoneismaelmspamRemoveMEIAI.CSIC.ES]
       Sent:   19 May 2000 15:39
       To:     .....PICLISTEraseMEspamMITVMA.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: spamimkespspam_OUTspam@spam@excite.com ; spamismaelm@spam@spamSTOPspamiai.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:spamBeGonemarkwillcox56spamBeGonespam@spam@hotmail.com]
       Sent:   20 May 2000 17:50
       To:     RemoveMEGRAHAM.NORTHRemoveMEspamRemoveMELANDINST.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 (mazerKILLspamspamspamix.netcom.com)
O:(440) 329-4680 (spam_OUTpeiserma@spam@spamridgid.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: TakeThisOuTstevebspam_OUTspamtla.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.

'[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: KILLspamtony.kubek.....spamTakeThisOuTflintab.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

'[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
> TakeThisOuTzarthragEraseMEspamRemoveMEintcon.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" <spam_OUTandrej.vugaRemoveMEspam.....GUEST.ARNES.SI>
To: <spamPICLISTKILLspamspamKILLspamMITVMA.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.
spamL.Nelsonspam_OUTspamieee.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
===================================================
STOPspamnogueiraspam_OUTspamspamBeGonepropic2.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

spam_OUTjerrymspamspamBeGonetech-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
>
> EraseMEWeslayspamKILLspamAol.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: EraseMEnewfoundRemoveMEspampipeline.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

.....avollharspamspam_OUTphysik.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:@spam@TekPhobiaEraseMEspamspamAOL.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
joshyTakeThisOuTspamKILLspammb.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.
RemoveMEL.NelsonTakeThisOuTspamieee.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}

TakeThisOuTjimTakeThisOuTspamRemoveMEjpes.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}

jim.....spam@spam@jpes.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
EraseMEjoshy.....spammb.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
spamjoshyKILLspamspam@spam@mb.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:                TakeThisOuTjsand@spam@spam@spam@pixie.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 <KILLspamjvpollKILLspamspamspamBeGonedallas.net>
To: <spamBeGonePICLISTKILLspamspamMITVMA.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 <RAMMERMAN@spam@spamKILLspamPRODIGY.NET>
To: <EraseMEPICLISTRemoveMEspam@spam@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 <RemoveMEjvpollspamspamEraseMEDALLAS.NET>
To: <STOPspamPICLIST.....spamMITVMA.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
spam_OUTshb7spamspamcornell.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
>
>  spamavollharspamspamspamphysik.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}

'[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
spamBeGonesalesKILLspamspamKILLspampicnpoke.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" <TakeThisOuThitrackspamspamLINEONE.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
spamBeGonejamesnewtonspampiclist.com
1-619-652-0593 phone
http://www.piclist.com

----- Original Message -----
From: Soon Lee <EraseMEpslnEraseMEspamCYBERWAY.COM.SG>
To: <spamBeGonePICLISTspam_OUTspam.....MITVMA.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
spamsalesspampicnpoke.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: RemoveMEtony.kubekKILLspamspamKILLspamflintab.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}

'[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
EraseMEacollingspamBeGonespamspamzaz.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   <KILLspamdwaynerspamplanet.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
jillesspam_OUTspamspamrendo.dekooi.nl
-----Oorspronkelijk bericht-----
Van: Andre <acollingspamspam@spam@ZAZ.COM.BR>
Aan: spamBeGonePICLIST.....spamMITVMA.MIT.EDU <.....PICLIST@spam@spamMITVMA.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
@spam@acollingspamzaz.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
salesRemoveMEspampicnpoke.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: spamtony.kubekspamflintab.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_OUTspamTakeThisOuTFRANKSINTL.NL> on 05/31/2000 08:40:26 AM

Please respond to spam_OUTriest@spam@spamRemoveMEfranksintl.nl








To:      spamPICLISTspamspamMITVMA.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

'[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

'[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


'[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}

'[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
===================================================
@spam@nogueiraspam_OUTspampropic2.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.

'[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

'[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.)

'[PIC]: Allowable ICD length'
2000\06\01@133743 by John

flavicon
face
Hello Anthony & PIC.ers,

My workshop pc is in a more-or-less fixed position, while the 16f877
target is a machine sitting outside under a car-port & weighs 250kg.
Definitely not mobile, that one.

I started by making a twp comms extension cable between the ICD and
16f877 header extension of  10.4 metres, knowing it was much longer
than I really needed.  It performed poorly, with many hang-ups, GPFs
etc., and was generally painful.
After halving the length to 5.2m it worked perfectly & I was still
*just* able to string it out to the target.

Hope this helps, as un-scientific as it is....

best regards,   John


PS  For the SI-challenged,          5.2 metres  =  17 foot and a wee bit.


>Date:    Wed, 31 May 2000 14:05:31 -0500
>From:    Anthony Clay <.....zarthragspam.....INTCON.NET>
>Subject: Allowable ICD length
>
>I am about to start experimenting with this ICD Module today, after I'm
done
>with the documentation.  Concerning the "telephone cable" between the ICD
>and header, how long can it be?
>
>Anthony
>

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:                spamjsandKILLspamspampixie.co.za
Manufacturer & purveyor of laboratory force testing apparatus, and related
products and services.

'[PIC]: 12C508 OSCCAL value'
2000\06\01@134202 by Octavio Nogueira

flavicon
face
The value is 0x70, use RETLW 0x70

Friendly Regards

Octavio Nogueira
===================================================
RemoveMEnogueiraRemoveMEspampropic2.com                  ICQ# 19841898
ProPic tools - low cost PIC programmer and emulator
http://www.propic2.com
===================================================

----- Original Message -----
From: Bill Colville <KILLspamwtc3.....spamKILLspamSUSCOM.NET>
To: <PICLISTspam_OUTspamspam_OUTMITVMA.MIT.EDU>
Sent: Thursday, June 01, 2000 1:07 PM
Subject: [PIC] 12C508 OSCCAL value


> 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

2000\06\01@141242 by John C. Frenzel

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
>
The 12c508 uses 4 bits, the 12c508a uses 6 bits.  Make sure you have the
correct version selected.
John

2000\06\01@142540 by John C. Frenzel

flavicon
face
----- Original Message -----
From: "Octavio Nogueira" <KILLspamnogueiraspam@spam@AJATO.COM.BR>
To: <@spam@PICLISTRemoveMEspamMITVMA.MIT.EDU>
Sent: Thursday, June 01, 2000 12:40 PM
Subject: Re: [PICLIST] [PIC]: 12C508 OSCCAL value


> The value is 0x70, use RETLW 0x70
>
> Friendly Regards
>
> Octavio Nogueira
actually retlw 0x70 assembles to 0x870

movlw 0x70 assembles to 0xC70

John

'[PIC]: Need Resumes'
2000\06\01@152315 by Andrew Kunz

flavicon
face
We are expanding.  Still.

Anybody looking for work in the northwest NJ area (relocate) let me know
privately:

akunz@spam@spamEraseMEtdipower.com?subject=Resume

We do C work (no assembly) on

    PIC (HiTech)
    68XXX (Cosmic with RTXC)
    X86 (MSCv8 with USSW)

Andy

'[PIC]: Multiple IRQ'S ?'
2000\06\01@153537 by Keith Causey

flavicon
face
The generic number is 8259 and it's gotten a facelift. There is a 28 j-lead
package of this device that has a 12mhz rating from Future Electronics.

use the good old obselete 8086 based interrupt ctlr.. i forgot the number..
but this is essentially what i did.
alok


{Original Message removed}

'[PIC]Re: Allowable ICD length'
2000\06\01@165204 by Ed Edmondson

picon face
FWIW, this is what Microchip has to say about the ICD cable length.  I
thought I would just pass this along to the rest of the list.

"Regarding the cable length, I'm assuming that you're talking about the
little RJ45 cable that looks like a phone cable.  Is that correct?  If so,
this is a serial interface to the ICD header and shouldn't be extended
much beyond the cable length provided (8-9 inches).  This is unshielded,
six wire conductor and longer lengths could generate noise damaging to the
protocol.  This is the only cable length that we've tested."

Regards,
Ed

'[PIC] LCD driving trouble 17c756'
2000\06\01@180408 by marius bratrein

flavicon
face
I solved the 17c756 LCD problem that I posted a few days ago.
Turns out the Pic Basic Pro example which supposedly compiles correctly for
the 17C756 series, uses PortA.0 and PortA.1 as outputs although for the
17C756, they are inputs only.
The wonders of working with 'new' devices :)

Marius

'[PIC]: External SRAM on PIC (or AVR)'
2000\06\01@221824 by Bob Ammerman

picon face
Just a dumb question: Serial RAM? I've heard of search EEPROM and serial
FLASH. I have had a couple applications where serial RAM would have been a
godsend. Does anybody make this? What capicity?

Thanks,

Bob Ammerman
RAm Systems
(high function, high performance, low level software)


{Original Message removed}

2000\06\01@223858 by John Hansen

flavicon
face
<x-flowed>At 10:18 PM 6/1/00 -0400, you wrote:
>Just a dumb question: Serial RAM? I've heard of search EEPROM and serial
>FLASH. I have had a couple applications where serial RAM would have been a
>godsend. Does anybody make this? What capicity?
>
>Thanks,
>
>Bob Ammerman
>RAm Systems
>(high function, high performance, low level software)

Check http://www.ramtron.com  They make nonvolatile 8k serial RAM that can be also
be used in a bus fashion for higher capacities.  It's pretty reasonably
priced, too.

John Hansen

</x-flowed>

2000\06\02@014616 by William Chops Westfield

face picon 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.

You might have better luck finding a 128Kx8 ram and using half of it.

BillW

'[PIC]Re: Allowable ICD length'
2000\06\02@035018 by Alan B Pearce

face picon face
To lengthen the cable, I would be very tempted to use the twisted pair Cat 5
cable that is used for computer network connections. This would hopefully get
you around many of the noise problems.

'[PIC] 12C508 OSCCAL value'
2000\06\02@044713 by Nebelong Bjarne

flavicon
face
The C70 should be read 0C70, giving:
       Movlw   0x070

So your calibration value is 0x070

(0xC70 gives 3184 dec => argument out of range)

/Bjarne



-----Original Message-----
From:   Bill Colville [spam_OUTwtc3spam_OUTspamRemoveMESUSCOM.NET]
Sent:   Thursday, June 01, 2000 6:08 PM
To:     RemoveMEPICLISTspam.....MITVMA.MIT.EDU
Subject:        [PIC] 12C508 OSCCAL value

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]: External SRAM on PIC (or AVR)'
2000\06\02@050558 by TOM THERON

flavicon
face
PCF8570 from Philips,  256 x 8,  i2c interface.

Tom

----- Original Message -----
From: Bob Ammerman
To: spamPICLIST@spam@spamMITVMA.MIT.EDU
Sent: Friday, June 02, 2000 4:18 AM
Subject: [PIC]: External SRAM on PIC (or AVR)


Just a dumb question: Serial RAM? I've heard of search EEPROM and serial
FLASH. I have had a couple applications where serial RAM would have been a
godsend. Does anybody make this? What capicity?

Thanks,

Bob Ammerman
RAm Systems
(high function, high performance, low level software)


----- Original Message -----
From: Bennett, Matt <Matt.BennettTakeThisOuTspamANDREW.COM>
To: <.....PICLISTspamTakeThisOuTMITVMA.MIT.EDU>
Sent: Thursday, June 01, 2000 11:38 AM
Subject: [PIC]: External SRAM on PIC (or AVR)


> 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]: Digital Alarm Clock source code and schemat'
2000\06\02@055556 by -=jugggernut=-

flavicon
face
Hi!

I like to build a digital alarm clock using PIC 16F84, the display format
must be Military time.

The following problems are:
1. A certain website discuss about PIC 16F84 timer. The 1 second delay well
not be exactly 1 second because of the error. How can I made an error
correction with this?

2.Can I set an interrupt (ISR)? for the setting of the alarm time.

3.Is there anybody can share me a simple Digital clock schematic using  PIC
16F84.

Thanks in advance...

Best regards,

-=jug=-

/ /                         Homepage:
 (  ,),)             http://juggernut.cjb.net
(  +++)                  Email:
 >   <              EraseMEjuggernutzspamKILLspamyahoo.com
/^      ^\            juggernutEraseMEspamcrosswinds.net
^      ^             EraseMEimcecespamspamBeGonecrosswinds.net
just hoping that your okay!!!

'[PIC]: [EE]: Wire/Wireless communication using PI'
2000\06\02@055608 by -=jugggernut=-

flavicon
face
Hi!

I'm interesting to learn the PIC 16F84 using as a communication.

The problem is that I don't know how start the code . I doubt whether I use
ISR or Not. This is the circuit:

                -----------                          --------------
           PIC 1     RB0  ------------------>RB1   PIC 2
                                |                         |
                        RB1<---------------------RB0
                                |                         |
                 -----------                           -------------

Please help the set-up of PIC communication codes.


Thanks in advance if you can share your program snips.

Best regards,

-=jug=-

/ /                         Homepage:
 (  ,),)             http://juggernut.cjb.net
(  +++)                  Email:
 >   <              TakeThisOuTjuggernutzspamTakeThisOuTyahoo.com
/^      ^\            juggernutspamspam_OUTcrosswinds.net
^      ^             spamimcece@spam@spamcrosswinds.net
just hoping that your key!!!

'[PIC]: Digital Alarm Clock source code and schemat'
2000\06\02@064004 by Vasile Surducan

flavicon
face
On 2 Jun 00, at 21:49, -=jugggernut=- wrote:

You may found a collection of all clock I found on the web based on
to 16F84 and my own one at:
http://www.geocities.com/vsurducan/pic.htm
Take a deep breath and look at every one...


{Quote hidden}

*********************************************
Surducan Vasile, engineer
mail: vasileTakeThisOuTspam@spam@l30.itim-cj.ro
URL: http://www.geocities.com/vsurducan
*********************************************

2000\06\02@064424 by Werner Soekoe

flavicon
face
Hi

Microchip has got a chematic with code. Follow these links:

LCD Clock:
www.microchip.com/Download/Appnote/Category/16CXX/00582b.pdf
http://www.microchip.com/Download/Appnote/Category/16CXX/00582.zip

7SEG LED Clock on 32768Hz Crystal:
www.microchip.com/Download/Appnote/Category/PIC16/00615b.pdf
http://www.microchip.com/10/Appnote/Category/PIC16/00615/indexZIP0.htm

I want to mention that I am building a "CountDown" timer, and I use the
following method to acurately time the seconds:

1. I run the PIC from a 4.194304 MHz Crystal.
2. The PIC then performs 1048576 Instructions per second
3. I set up the Timer Overflow Interrupt with a prescaler of 16
4. The Timer Interrupt then occurs 256 times per second
5. My ISR Increments another counter I defined
6. When that counter overflows from 0xFF to 0X00 (and sets the carry bit), I
know exactly one second has passed, and I update my seconds, minutes, hours
counter accordingly and update the display.

Try this. I hope it helps

Regards,
Werner Soekoe
Information Systems Manager
Free State Legislature
wernersTakeThisOuTspamspamBeGonefsl.gov.za
Tel. (051) 407-1109
Fax. (051) 407-1137
Cell. 082 376 8383
Country Code. +27


{Original Message removed}

'[PIC]: [OT]: External SRAM on PIC (or AVR)'
2000\06\02@090914 by Bennett, Matt

flavicon
face
I have found 128Kx8 SRAMs, or at least evidence of their existence, but I
can't seem to find any in stock (or at least with a <8 week delivery time).
I think I'm going to have to use 2 32K*8 SRAMs and use a little bit of
decoding logic.  Digikey has some Toshiba 128K parts in stock, but they
aren't fast enough to operate without a wait state (on the AVR).  Pioneer
appears to have some 62C256 parts from ISSI.  (for now)

Matt

{Original Message removed}

2000\06\02@095538 by goflo

flavicon
face
JDR Microdevices had 64KX8 SRAM last time I looked.

regards, Jack

'[PIC]: External SRAM on PIC (or AVR)'
2000\06\02@110717 by Morgan Olsson

picon face
>The PIC (17C) uses an ALE, /OE, /WR scheme, and the AVR uses an ALE, /RD,
>/WR scheme.

Is there really any difference except the *naming* of the "/OE" respective "/RD" signal?

I know AVR can be interfaced directly to standard SRAM with only an adress latch.  (Tip: if not using the whole adress space, use an inverter on A15, to map the external SRAM to top adress space, and not waste it on overlapping internal SRAM.

BTW, 32Kx8 seem to be more available, and also cheaper than 8Kx8.

Regards
/Morgan (PIC literate, AVR beginner)

'[PIC]: Allowable ICD length'
2000\06\02@110728 by Morgan Olsson

picon face
Isn«t it better to use long RS232 cable between PC and ICD instead?
/Morgan

'[PIC]: Several baud rate of RS232C (CCS C) [Was: R'
2000\06\02@111128 by David Kott

flavicon
face
> Dear all,
>
> I'm trying to realize two types of baud rate at PIC16F873. The chip
> would convert between 9600bps serial data and 31250bps MIDI data
> described as following two definitions:
> #use RS232C(baud=9600,***)
> #use RS232C(baud=31250,***)
>
> I would like to know how does it work In case that simply "getchar()"
> or "putchar()" is called. Is it possible to use two asynchronous
> transmission and reception by using above definition? At present, PIN_C6
> and PIN_C7 are used for RS232C. The complier is CCS C.
>
> I appreciate if anyone who tried this kind of situations or who knows
> any information would let me know a resolution.
>
> Sincerely yours,
>
> Keishiro Tabe

CCS can indeed do this and there is example code in the "Common Questions
and Answers" section of your PCM manual.

See page 79 of your PCM/PCW manual (rev. July 1999) or the section named
"How can I use two or more RS-232 ports on one PIC?" in your table of
contents.

Basically, you place the #use RS232 directive before any printf(), putc(),
getc() or kbhit() function invocation you use.

for example:

void MyTrivialFunction(void) {

#pragma use RS232 (baud=9600, xmit=PIN_B0, rcv=PIN_B1)
     printf("Hi, this is serial port 1 talking to a PC at 9600.\r\n");
#pragma use RS232 (baud=31250, xmit=PIN_B2,rcv=PIN_B3)
     printf("Hello, Mr. MIDI device, how are you this fine morning?\r\n");
}

would send, at 9600 baud, a message to a terminal listening to RB<0>.  It
would also send a message to a MIDI device listening on RB<2> at 31.250
Kbps.

-d

'[PIC]: [OT]: External SRAM on PIC (or AVR)'
2000\06\02@111927 by Bennett, Matt

flavicon
face
My own mistake there, I misread the data sheet and thought they were
incompatible- the /OE and /RD are, in fact, the same thing.  I'm going to
have to overlap the internal and external memory, since I want to get as
much RAM on the device as I can.- I lose 608 RAM locations, Oh well...  I've
decided to use 2 32Kx8 parts- the address decoding is simple- just an
inverter.  Unfortunately the 62C256 only has a /CS input- some other SRAMS
(which either I can't get in time, or aren't fast enough) have both a /CS
and a CS, so the inverter would be unnecessary.  This design is low volume,
so having an extra gate is not a terrible thing.

Matt
{Original Message removed}

2000\06\02@121932 by Dan Michaels

flavicon
face
Matt Bennett wrote:
>I have found 128Kx8 SRAMs, or at least evidence of their existence, but I
>can't seem to find any in stock (or at least with a <8 week delivery time).
>I think I'm going to have to use 2 32K*8 SRAMs and use a little bit of
>decoding logic.  Digikey has some Toshiba 128K parts in stock, but they
>aren't fast enough to operate without a wait state (on the AVR).  Pioneer
>appears to have some 62C256 parts from ISSI.  (for now)
>

Jameco has both fast Cypress 32Kx8 SRAMs [0.3"] and the slower
std 0.6" type. Also, if you have a spare line on your AVR you can
separate the /CS lines for the 2 SRAM chips and forgo the need for
external decoding logic.

Cheers,
- Dan Michaels
Oricom Technologies
===================

'[PIC]: 12C508 OSCCAL value'
2000\06\02@121938 by Bill Colville

flavicon
face
Date sent:              Fri, 2 Jun 2000 10:49:05 +0200
Send reply to:          pic microcontroller discussion list <spamPICLISTTakeThisOuTspamMITVMA.MIT.EDU>
From:                   Nebelong Bjarne <.....bjarne.nebelongspamspamBeGoneBINDOMATIC.SE>
Subject:                Re: [PIC] 12C508 OSCCAL value
To:                     .....PICLISTTakeThisOuTspamEraseMEMITVMA.MIT.EDU

Thanks to all who replied. The program is working fine now.

Bill

{Quote hidden}

> {Original Message removed}

'[PIC]: [OT]: External SRAM on PIC (or AVR)'
2000\06\02@145454 by Dan Michaels

flavicon
face
Matt Bennett wrote:
>I have found 128Kx8 SRAMs, or at least evidence of their existence, but I
>can't seem to find any in stock (or at least with a <8 week delivery time).
>I think I'm going to have to use 2 32K*8 SRAMs and use a little bit of
>decoding logic.  Digikey has some Toshiba 128K parts in stock, but they
>aren't fast enough to operate without a wait state (on the AVR).  Pioneer
>appears to have some 62C256 parts from ISSI.  (for now)
>

Also, checkout the SRAM modules sold by  http://www.accutekmicro.com

Cheers,
- Dan Michaels
Oricom Technologies
===================

'[PIC]: 12C508 OSCCAL value'
2000\06\02@194030 by miked

flavicon
face
>
> > The value is 0x70, use RETLW 0x70
> >
> > Friendly Regards
> >
> > Octavio Nogueira
> actually retlw 0x70 assembles to 0x870
>
> movlw 0x70 assembles to 0xC70
>
> John
>
Yes, this is at the last address which is the reset vector on 12 bit
core devices. The program counter rolls over to 000h and one of the
first instructions should be Movwf OSCAL. On EPROM devices the
movlw (cal value) will have to be placed there after eraser. On OTP
parts it is already there.
Note that the 12C67x are 14 bit core and have a RETLW (cal value)
at the last location. They reset to 000 where one of the first
instructions should be Call (last address).

'[PIC]: Phase of internal TMR0 clocking'
2000\06\03@005112 by Nikolai Golovchenko

flavicon
face
---- Original Message ----
From: Dmitry Kiryashov
Sent: Friday, June 02, 2000 16:31:18
Subj: Phase of internal TMR0 clocking

> Hi guys.

> As it was described in many PIC datasheets (notes A below) two cycles are required
> (fetch and execute cycles) to complete any PIC instruction. In fetch cycle PC is
> incremented, then instruction is latched. Then in the execution cycle, data memory
> is read during Q2 (operand read) and written during Q4 (destination write)

Hi Dmitry. Just a little correction (you know it): besides fetch and
execution an instruction may require also a dummy cycle. So for a goto
it would be fetch goto-execute previous instruction-fetch next
instruction after goto-execute goto-fetch instruction pointed by
goto-execute nothing-

It looks from the datasheets that read happens in the beginning
of Q2 (on rising edge of Q2) and write - in the beginning of Q4. Since
all file registers in PIC are probably the same, this should apply to
any file register.

> What internal phase (Q1 Q2 Q3 Q4 ???) TMR0 is incremented every cycle. Is it happened
> in every Q1 (simultaneously with PC increment) or there is another reason to do it
> during other phases of clocking ?

See Fig. 6-4 in F84 datasheet. It increments on Q4 phase.
BTW, Fig. 6-3 has a little mistake - there is an arrow pointing at Q2
beginning and a note "Write TMR0 executed", but the graph shows that
TMR0 write is executed at the beginning of Q4.

> Another question: I still can't understand what was the real reason to introduce
> 2 clocks delay in TMR0 increment after loading TMR0 with new value.

I wish I knew.

> If someone have discovered those questions and have precise answers please do not
> hesitate to share it. Couple of good hints are enough ;)

My answers are certainly not precise, but they don't seem to
contradict the datasheet :).

{Quote hidden}

Nikolai

'[PIC] Low voltage operation of 16F84 - how low can'
2000\06\03@074252 by Russell McMahon

picon face
QUESTION

Based on actual experience. - What is the lowest Vdd at which a 16F84 will
operate (including occasional EEROM read/write) reliably using an RC clock
at about 1 MHz.

Yes. I know what the data sheets say.
Yes, I know the answer is try it and see.
Yes, I know the results will vary.
No - I don't (yet) know what other people have tried and found works.

BACKGROUND:

Based on random aged 16F84 data sheet:

- The std 16F84 is specified to operate at a minimum Vdd of 4.5 V
- The 16LF84 is specified down to 2 volts

I am building a small 16F84 device where portability and battery life is
important (wearable aid for a disabled person), Essential aim is to drive a
beeper subject to certain constraints - irrelevant to following. Device will
be carried in top pocket / worn on cord around neck / clipped to clothing so
user but hopefully few others can hear the occasional beep. Another variant
may drive a pager vibrator instead.

I am running a 16F84-10 (10M parts happened to be in parts drawer)  .

This runs happily with physically small 3.6V 80 mAH NiMH battery and RC
clock (33K, 18pF) at 1MHz osc = 25o KHz PIC basic instruction rate.
This is very adequate for my task.

At 3.8V it draws 250 uA
At 2 volts it is still running and clock frequency has not moved markedly
and draws 100uA
At 1 volt it is STILL running but clock is MUCH slower (~ factor of 10?) and
draws under 10uA (!)

I don't need to run at 1 V but ability to run at 2V is interesting.
I haven't tried eerom read/writes yet at 2V.

What have other people found about low voltage operation of "standard"
parts.
Is this perhaps another example of Microchip 'select on test"ing parts and
many std parts are in fact capable of low voltage operation?

Yep - I could (try to) buy some 16LF84's but ...



TIA

       Russell McMahon

'[PIC]: Digital Alarm Clock source code and schemat'
2000\06\03@235035 by John Mullan

picon face
I would be tempted to use one of the 8pin RTCC (real-time clock/calendar)
chips.  Would give good accuracy and only need 2 i/o pins leaving plenty for
display drive.  since freq is only 32K, you can drive PIC and RTCC with this
crystal and save on power too.

John Mullan


{Original Message removed}

'[PIC]Re: Allowable ICD length'
2000\06\04@044510 by Stephan Kotze

picon face
I have built my own ICD and use the below mentioned cable with a length of 4
meters with no problems

Stephan
----- Original Message -----
From: Alan B Pearce <RemoveMEA.B.PearcespamspamKILLspamRL.AC.UK>
To: <STOPspamPICLISTEraseMEspamMITVMA.MIT.EDU>
Sent: Friday, June 02, 2000 9:48 AM
Subject: Re: [PIC]Re: Allowable ICD length


> To lengthen the cable, I would be very tempted to use the twisted pair Cat
5
> cable that is used for computer network connections. This would hopefully
get
> you around many of the noise problems.

'[PIC] picprog & ludipipo programmer'
2000\06\04@141414 by John De Villiers

flavicon
face
The schematics i have of the lidipipo programmer doesnt mention 16f84
although it does mention 16c84. Can this programmer handle the 16F84 as well
??

The software the i found for this programmer ( picprog v 0.6 by Tord
Anderson); is this the lastest and greatest and does it work for a 16F84 as
well ???

I have scoured the web for diy programmers and found many of them /
including many various versions of the same one, some of them years apart.
This makes it difficult trying to match programmers versions with software
versions.

What im looking for :
Serial port Programmer ( my parr. port has two devices on it already )
Windows 98 or compatible programming software
Simple simple simple programmer hardware

Oh, and the software should preferably be free.

I was considering getting the pic 'N poke range of hardware, but that was
before the exchange rate went belly up. in the mean time i need to program a
few f84's without spending a fortune on it.

Any suggestions ?

Regards
  John

'[PIC] SSP I2C Problems'
2000\06\04@184141 by Les

flavicon
picon face
part 0 324 bytes content-type:application/octet-stream;                                        Thanks guys

                                               Les

Content-Type: application/octet-stream;
       name="SSP_I2C.Asm"
Content-Disposition: attachment;
       filename="SSP_I2C.Asm"

Attachment converted: creation:SSP_I2C.Asm (????/----) (00016122)

'[PIC]: External SRAM on PIC (or AVR)'
2000\06\04@235358 by Harold Hallikainen

picon face
       There have been lots of discussions about serial SRAM on the list over
the years. As far as I can tell, there aren't any of any significant size
out there. I WAS using the Dallas RamPort (DS1380 and DS1381) 'til they
discontinued them on us...  I'm now moving designs over the the PIC18c452
which has enough RAM for several products. On one product I'm using the
18c452 with several latches to drive a 128kbyte SRAM (capacitor backed).
That takes several chips. Seems like SOMEONE would make a reasonably
large serial SRAM, but that doesn't seem to be the case.

Harold



On Fri, 2 Jun 2000 09:11:59 +0200 TOM THERON <mmsesysspamBeGonespamICON.CO.ZA> writes:
> PCF8570 from Philips,  256 x 8,  i2c interface.
>
> Tom
>
> {Original Message removed}

2000\06\05@044941 by Mark Willis

flavicon
face
Of all things, the palmtop I use a lot uses DRAM as it's main RAM - I
was CONVINCED this was SRAM, but it's not.  1/2Mb per chip, and I have 2
(1 Mb) pairs sitting here waiting for a future project.  These're
Hitachi RAM, set in TSOP Left & Right sets (reversed pinout for one -
you can Bus the tri-state pins this way) - Interesting stuff.  So I now
know that it's quite possible, WITH the right RAM, to go decently low
power (2 weeks off 2 1300mAh NiMH batt's with the rest of the machine
running off the same batteries) - Sorta shocked ME!  If I keep upgrading
these machines, someone could talk me out of a pair, certainly you could
talk me out of part numbers (KM416V256ALLTR is the reversed one) - I can
find the other number if you cannot get there from here <G>

I have some info I can dig out that may show how they handle the refresh
process, too.

 Mark

Harold Hallikainen wrote:
{Quote hidden}

> > {Original Message removed}

2000\06\05@060328 by Octavio Nogueira

flavicon
face
Is sequential access is ok, I'm using a Toshiba
TC554001 512K SRAM and two 74HC4040 counters. They work
great!

Friendly Regards

Octavio Nogueira
===================================================
spam_OUTnogueiraspamspampropic2.com                  ICQ# 19841898
ProPic tools - low cost PIC programmer and emulator
http://www.propic2.com
===================================================

{Original Message removed}

2000\06\05@065428 by Bob Ammerman

picon face
Exactly what my search turned up - nada nil nothing none :-(

Bob Ammerman
RAm Systems
(high function, high performance, low level software)


{Original Message removed}

'[PIC] picprog & ludipipo programmer'
2000\06\05@090638 by mark

flavicon
face
> The schematics i have of the lidipipo programmer doesnt mention 16f84
> although it does mention 16c84. Can this programmer handle the 16F84 as well ??

Yes, it can.

> The software the i found for this programmer ( picprog v 0.6 by Tord
> Anderson); is this the lastest and greatest and does it work for a 16F84 as well
> ???

Yes. But the PWRTE option meaning is reversed.

>
> What im looking for :
> Serial port Programmer ( my parr. port has two devices on it already )
> Windows 98 or compatible programming software
> Simple simple simple programmer hardware
> Oh, and the software should preferably be free.

Look for PIX113b.ZIP. It's a DOS based software, but the BEST I can find.




Marcelo Puhl
markspam_OUTspamRemoveMEplug-in.com.br
-------------------------------------------
Get paid to surf the WEB !
Ganhe dinheiro enquanto surfa na Internet !
http://alladvantage.com/go.asp?refid=DTJ608
-------------------------------------------

'[PIC]: External SRAM on PIC (or AVR)'
2000\06\05@091437 by Fansler, David

flavicon
face
Some one had suggested checking out http://www.ramtron.com
<http://www.ramtron.com>  - the make serial (SPI) FRAM - which is
non-volatile and has write speed of up to 5MHz.

David V. Fansler
Network Administrator
TriPath Imaging, Inc. (Formerly AutoCyte, Inc)
336-222-9707 Ext. 261
spamdfanslerspamBeGonespamTriPathImaging.com <spamdfanslerRemoveMEspamTriPathImaging.com>
Now Showing! http://www.dv-fansler.com <http://www.dv-fansler.com/>
Updated June 1, 2000
RF Ablation on Ann's Cancer

               {Original Message removed}

'[PIC]: Digital Alarm Clock source code and schemat'
2000\06\05@093520 by paulb

flavicon
face
Hello -=jugggernut=-.

 I've been working on a not too dissimilar project with ke Neehr
KILLspamneehrspam_OUTspamspam_OUTswipnet.se , so I can possibly help you with code.  You
might just ask him if he minds if I give you the code.

> 1. A certain website discuss about PIC 16F84 timer.  The 1 second
> delay well not be exactly 1 second because of the error.  How can I
> made an error correction with this?

 I'm not sure what sort of error you mean.  Care to explain?  I have
coded the clock to work with no error using a 4 MHz crystal.

> 2.Can I set an interrupt (ISR)? for the setting of the alarm time.

 You don't need *any* interrupts for this project.  Not only do you not
*need* them, you will find them a great hindrance.
--
 Cheers,
       Paul B.

'[PIC] - Debugging Tool Request'
2000\06\05@112134 by Shawn Yates

flavicon
face
Has anyone seen a debugging tool what will provide something that looks like
a logic analyser hooked up to all the IO pins on a PIC (16C74 if it
matters).  I just want to see a computer simulation of all the pins toggling
based exclusively on the program, not on the board or any external inputs.
I could do it 'manualy' by tracing the program flow, but I was hoping there
was a tool out there that does what I am looking for.

Thanks

Shawn

2000\06\05@113209 by Philippe

flavicon
face
At 11:23 05/06/00 -0400, you wrote:
>Has anyone seen a debugging tool what will provide something that looks like
>a logic analyser hooked up to all the IO pins on a PIC (16C74 if it
>matters).  I just want to see a computer simulation of all the pins toggling
>based exclusively on the program, not on the board or any external inputs.
>I could do it 'manualy' by tracing the program flow, but I was hoping there
>was a tool out there that does what I am looking for.
>Thanks
>Shawn

UMPS (http://www.vmdesign.com) will do the Job perfectly, even will print the graph
of your digital output, but not for 16C74, today UMPS can simulate a reduced
part of the PIC:

PIC16C52,54 C55 C56 C57 C58, C84 F84 F83
PIC16C71, PIC16C710, PIC16C711, PIC12C672, PIC12C671,
PIC16C554, C556, C558, PIC12C508, PIC12C509,
PIC16C620, 621, 622

Regards,
       Philippe.

 +--------------------------------------------------------+
 |  Virtual Micro Design                                  |
 |  Technopole Izarbel,                                   |
 |  64210 BIDART                                          |
 |  FRANCE                                                |
 |                                                        |
 |  Phone: ++33 559.438.458   Fax: ++33 559.438.401       |
 |                                                        |
 | E-Mail: p.techerspam_OUTspamTakeThisOuTvmdesign.com                          |
 | URL:    http://www.vmdesign.com                        |
 +--------------------------------------------------------+

'[PIC] SSP I2C Problems'
2000\06\05@113406 by Achim Vollhardt

flavicon
face
Hi Les,
it seems that your I2C-sending routine lacks of polling of the BusyFlag
BF in SSPSTAT
which will be cleared, when the transmission of the 8 bits is complete.

I2C_in and I2Cout are small subroutines that only change the direction
of the SDA Pin as acknowledging won't work with SDA configured as
output.
The byte supposed for transmission has to be delivered in W.


;************************* Send routine I2C-Bus : send_I2C
********************
send_I2C
       banksel PIR1
       bcf     PIR1,SSPIF

       banksel SSPBUF
       movwf   SSPBUF


       banksel SSPSTAT
i2ctx                           ; I2C send in process
       btfsc   SSPSTAT,BF
       goto    i2ctx


       call    I2C_in

       banksel PIR1
i2cnoack                        ; I2C frame complete
       btfss   PIR1,SSPIF
       goto    i2cnoack


       call    I2C_out


       banksel SSPCON2
       btfss   SSPCON2,ACKSTAT
       retlw   0               ; ACK
       retlw   1               ; no ACK
;*********************************************

Les wrote:
{Quote hidden}

--
--------------------------------------------------------------------
   Achim Vollhardt
   Universitaet Zuerich
   Physik Institut, 36J36
   Winterthurerstrasse 190
   CH-8057 Zuerich

   tel: 0041-1-6355771

   email: spamBeGoneavollharspamspamspamBeGonephysik.unizh.ch

'[PIC]: External SRAM on PIC (or AVR)'
2000\06\05@113644 by jamesnewton

face picon face
techref.massmind.org/mem/srams
how about the Toshiba TC551001?

---
James Newton @spam@jamesnewtonspamspamspam_OUTgeocities.com 1-619-652-0593


{Original Message removed}

'[PIC] - Debugging Tool Request'
2000\06\05@114029 by Shawn Yates

flavicon
face
Phillipe,

Thanks for the input, but I need something that will do one of the 40 pin
packages.  I am not using any of the high end features (AD, SPI etc), but I
do need to monitor all 33 of the IO pins.

Shawn

Display limited to first 300 matches. Add keywords to narrow the result set or browse by year:
- In 2000 , 2001 only
- Today
- New search...