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

No exact or substring matches. trying for part
PICList Thread
'[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"
spam_OUTspeffTakeThisOuTspaminterlog.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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

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]: 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: .....tony.kubekKILLspamspam@spam@flintab.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
> zarthragspamKILLspamintcon.net

'[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]: 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.
.....L.NelsonKILLspamspam.....ieee.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
===================================================
EraseMEnogueiraspam_OUTspamTakeThisOuTpropic2.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

jerrymspamspam_OUTtech-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
>
> @spam@WeslayKILLspamspamAol.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: KILLspamnewfoundKILLspamspampipeline.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

RemoveMEavollharTakeThisOuTspamphysik.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:spamBeGoneTekPhobiaspamBeGonespamAOL.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
TakeThisOuTjoshyEraseMEspamspam_OUTmb.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.NelsonspamTakeThisOuTieee.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}

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

RemoveMEjimspam_OUTspamKILLspamjpes.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
EraseMEjoshyspamspamspamBeGonemb.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
RemoveMEjoshyKILLspamspammb.sympatico.ca

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

'[PIC]: Audio Ideas?'
2000\05\27@071653 by Bob Ammerman

picon face
This sounds like a neat project.

If you want to do the Vu meter thing, you might consider the following
design:

Take each analog input, run it thru an op-amp to buffer it (so you don't
affect the signal in its normal use).

Take the output of the op-amp and half-wave rectify it with a diode
(actually, I think you have to include the diode in the op-amp's feedback
somehow so that you don't have the diode drop affecting your output).

Run the resulting DC signal thru a resistor to a cap. This forms a simple
low-pass filter.

Connect the cap to an A/D input on the PIC.

In your PIC code, periodically reprogram the A/D input to be an output and
drive it low. This will discharge the CAP.

Then, go back to an A/D input, give the signal time to charge the cap up
(this time interval should be very consistent), then read the voltage on the
cap.

Since you want a logarithmic display, you could actually just use each bit
of the converted result to drive one of the LED's (each LED would then
represent a factor of 2 (I think that is 3 dB!).

Have fun.

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

'[PIC]: PIC to PIC wireless transmission'
2000\05\27@072323 by Bob Ammerman

picon face
Since you are going 1-way, you will have no way of knowing if your data got
to the other side. Thus, you are going to need some form of 'forward error
correction'. The simplest way to do this is to just repeat your message
multiple times, and hope the other side gets it. Of course, there is NO way
to guarantee the other side get it. You can improve your chances if you send
the data in multiple small packets, each with an identifier. The receiver
then assembles the full message by piecing together whatever packets its
receives successfully.

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

'[PIC]: Audio Ideas?'
2000\05\27@074016 by Alok Dubey

flavicon
face
hi,
if u include the diode in the opamps f/b u have a log amp there itself...
might as well use an offset DC on it to make it fn as a log amp and simply
give this o/p to a A/D convertor.. and some nice math to compute the o/p in
db.
again ur diode should be a nice one.. and some temp compensation will be
reqd..
this is a std log amp ckt Vo/p =ln (Vi/p)=2.303log(Vi/p)
have fun and let me knw what u up to..

Alok


{Original Message removed}

'[PIC]: Were can i find source codes and schematics'
2000\05\27@080650 by Ricardo Reis

flavicon
face
Thank you

'[PIC]: Audio Ideas?'
2000\05\27@132915 by rottosen

flavicon
face
Josh Koffman wrote:
{Quote hidden}

How about a compromise on the coolness factor?

Use a PIC (or it may need the higher speed of an SX) to generate the
clocks to several switched capacitor filters.

Just a thought  :-)

-- Rich

2000\05\27@143919 by Jim P

flavicon
face
Oops! Did anyone else catch this?

"of the converted result to drive one of the LED's (each
LED would then represent a factor of 2 (I think that is 3 dB!)."

- S/B  "6" dB

(Not meaning to beat a dead horse or anything - but here's
 a quick review of the dB anyway ...)

Voltage factor of         2 = 6 dB
Voltage factor of  1.414 = 3 dB

Power ratio of 2 = 3 dB
Power ratio of 4 = 6 dB

Computing decibels:
Power ratio:    10 * log_sub_base10 (P1/P2) = dB
Voltage ratio:  20 * log_sub_base10 (P1/P2) = dB


{Original Message removed}

2000\05\27@150031 by Jim P

flavicon
face
Correction on the last formula:

Voltage ratio:  20 * log_sub_base10 (V1/V2) = dB



----- Original Message -----
From: Jim P <@spam@jvpoll@spam@spamspam_OUTdallas.net>
To: <spamBeGonePICLISTspamKILLspamMITVMA.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 <.....RAMMERMANspam_OUTspamPRODIGY.NET>
To: <TakeThisOuTPICLIST.....spamTakeThisOuTMITVMA.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 <TakeThisOuTjvpollKILLspamspamspamDALLAS.NET>
To: <.....PICLISTspamRemoveMEMITVMA.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
TakeThisOuTshb7spamspamcornell.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
>
>  avollharEraseMEspamphysik.unizh.ch

I have the Serial PIC'n book which has some I2C master mode routines in
it that I could probably get for you.. I'll have to look to see if I
legally can but I probably will be able to.. have you looked at the
techref site (link off of http://www.piclist.com) there's ALOT there (I don't
know much about I2C though) But I'd imagine it's there..

                       Damon Hopkins

'[PIC]: [EE]: Microcontroller with 4 USARTs'
2000\05\28@070501 by Alan B Pearce

face picon face
>Unfortunately, to receive you need to run your interrupt handler somewhat
>faster than the bit time.  I have successfully built a software UART using a
>interrupt 6x of the bit rate. I expect 5x would work pretty well.

You get away with 4 samples per bit time if you are not doing it synchronous to
the bit edges. Many years ago before high speed async modems were commonly
available we used to send async data through synchronous modems, and could do it
with no errors if the async baud rate was a quarter of the sync modem rate.

2000\05\28@082711 by Bob Ammerman

picon face
Of course this depends on the quality of your signal.

This thread has got me to thinking, and coding, and I am pretty sure I've
come up with a way to get 4 in and 4 out at 31250buad on a PIC18CXX2 at 10
MIPS. The trick involves accumulating input samples on each channel and
processing them 5 at a time instead of one-by-one. This idea was inspired by
byte-at-a-time CRC algorithms. Basically you end up with a monster state
machine, about 70 states, with 32 (ie: 2^5) possible inputs for each state.
The state machine is then stored as one whopping big (about 8K) table. But
hey, what's 8K when you've got 32K on chip? :-)

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

{Original Message removed}

'[EE]:[PIC]: How to measure level of liquids and se'
2000\05\28@201049 by Gennette, Bruce

flavicon
face
       Looks do-able to me.

       Reading proximity sensors, reading load cells and displaying values
on request while regularly logging them is simple PIC stuff.

       Measuring liquid heights can be done several ways, but as you are
already reading proximity switches why not use that method for this task
too?  Use a captive rod in a guide above a float to trip proximity switches
above your tanks (KISS principle).  Also gives a visual indication of the
amount in the tank as the rod rises above the rim.

          ______  _
            ||  <||
            ||x <|| sensors
            ||  <||
          _ || _ ||
       ___| || |_||_________
       |  | || |           |
       |  | || |           |  Use courier font to see diagram
       |    ||             |
       | ___||___          |
       |_|float |__________|
       | |______|          |
       |                   |
       |       liquid      |
       |                   |
       |___________________|

       This should also work for your special additive liquids as long as
you use compatible materials for the float and rod.  For increased accuracy
use tall, thin tanks (large, vertical pipes?).

       Humidity sensors are available in 1-wire devices.  [I assume you
need to know the humidity in several feeds to guess the amount of water
contained in the raw materials (sand and gravel) to calculate the real
amount of material being added and the water to be added]

       Good luck.

       <original message>

       To automate a plant of Concrete.

       The idea is to use a PC for the general control of the plant and to
arm a
       network (Possibly RS485) with terminals that will be slaves working
with
       PICs, to complete different tasks, as the following ones:

       1) To control the pneumatic servos and read proximity sensores and
other.

       2) To Sense the weight of the materials with cells of loads,
indicate the
       value measured in a  7 segments display and to send the measures
througt the
       network when they are requested or periodically. This partly would
be
       resolved, but I accept ideas and suggestions in this respect.

       3) To Sense the level of water in the main dosificador tank.
       <snip>

'[PIC]: Romzap'
2000\05\28@201308 by Tony Nixon

flavicon
picon face
Hi all,

I've just uploaded the new ROMzap which includes some new software to
aquire data from one of the A2D inputs.

You can get aquisition in auto, manual or burst mode.
The results are stored in the PC and are written to a text file with
time stamping and alarm triggers.
External triggers (pos or neg edge) on any IO pin
Graphical display of the data
Alarm set points which can also change state of any IO pin

http://www.picnpoke.com/demo/ROMzap.html

--
Best regards

Tony

http://www.picnpoke.com
RemoveMEsalesEraseMEspamspam_OUTpicnpoke.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]: WIZPIC'
2000\05\29@091627 by andy howard

flavicon
face
From: "Brian Devlin" <@spam@hitrackRemoveMEspamEraseMELINEONE.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
EraseMEjamesnewtonspam@spam@piclist.com
1-619-652-0593 phone
http://www.piclist.com

----- Original Message -----
From: Soon Lee <@spam@pslnspam_OUTspam.....CYBERWAY.COM.SG>
To: <spamBeGonePICLISTEraseMEspamMITVMA.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
salesspamBeGonespampicnpoke.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.kubek@spam@spamspamBeGoneflintab.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]: Pic tools & scenix chips ?'
2000\05\30@181308 by w. v. ooijen / f. hanneman

picon face
The compiler I wrote (Jal) targets both scenix and a few pics. It creates
(apart from a hex file) an asm file that can be assembled with mpasm. A few
macros take care of the scenix-specific instructions. You could take a look
at the header of the created asm file and copy the macros.
Wouter

PS I added a colon after the [PIC] so maybe you will not receive this
(.....)

> I want to try to use Scenix chips as a faster pic, but I don't want to
> mess around too much learning the Scenix stuff. I want to stick to
> Pic mnemonics. Is it possible to use Mplab to write code for
> scenix?

'[PIC]: 16F873 stopwatch code wanted'
2000\05\30@190317 by Tony Nixon

flavicon
picon face
Sorry for the logish post, but this may work better.

I wrote the other in a few spare minutes before knock off last night.

        include "P16f873.inc"

        CBLOCK 0x20

TimeH
TimeL
Debounce
Flags
DelayH
DelayL

        ENDC

;
; Set Delay value 1 - 65535 mS
;

Delay = 1

         org 0h

         clrf PORTA
         clrf PORTB
         clrf PORTC
         bsf STATUS,RP0
         movlw b'11000010'
         movwf OPTION_REG
         movlw b'00000001'
         movwf TRISA
         clrf TRISB
         clrf TRISC
         movlw b'10000110'
         movwf ADCON1
         bcf STATUS,RP0

         clrf Debounce
         movlw b'00000001'   ; flag key is up
         movwf Flags
         clrf TimeH
         clrf TimeL

         clrf DelayH
         clrf DelayL

         movlw 84h
         movwf TMR0
         bcf INTCON,T0IF

WtLoop    btfss INTCON,T0IF   ; 999uS @ 4MHz
         goto WtLoop

         bcf INTCON,T0IF
       movlw 84h
         movwf TMR0

       incf DelayL           ; increment delay count
       btfsc STATUS,Z
       incf DelayH

       movlw High(Delay)     ; if = Delay value then
       xorwf DelayH,W        ; increment the Time counter
       btfss STATUS,Z
       goto ButtChk

       movlw Low(Delay)
       xorwf DelayL,W
       btfss STATUS,Z
       goto ButtChk

       incf TimeL
       btfsc STATUS,Z
       incf TimeH

       clrf DelayH
       clrf DelayL

ButtChk movf Debounce         ; read key if debounce = 0
       btfsc STATUS,Z
       goto DoButt

       decf Debounce
       goto WtLoop
;
; Key input is high when released
;
DoButt  btfss PORTA,0         ; test for low
       goto IzLow

       btfsc Flags,0
       goto WtLoop           ; already released

       bsf Flags,0           ; flag key is now up
       movlw 10h
       movwf Debounce
       goto WtLoop

IzLow   btfss Flags,0
       goto WtLoop           ; already released

       bcf Flags,0           ; flag key now down
       movlw 10h
       movwf Debounce

       movf TimeH,w          ; output data to PortB & C
       movwf PORTB
       movf TimeL,w
       movwf PORTC

       clrf TimeH            ; reset timers
       clrf TimeL
       clrf DelayH
       clrf DelayL
       bcf INTCON,T0IF
       movlw 84h
       movwf TMR0
       goto WtLoop

       end

--
Best regards

Tony

http://www.picnpoke.com
.....sales@spam@spamEraseMEpicnpoke.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: .....tony.kubekRemoveMEspamflintab.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}

'[PIC]:School DAQ project'
2000\05\31@213241 by David and Melanie

flavicon
face
Hi,
   My name is David and I am going to a technical college in Victoria BC Canada.  In my data acquisition course we are setting up a small strain gauge scale feeding a ADC.  We will be using an f84.  I was wondering if anybody had any suggestions as how to go about processing the information being read in serailly from the ADC.  I was just going to take a series of readings and average them, but our instructor encourages us to use the internet for information.  I have been monitoring the list for a month now, but haven't seen much for this area.

   Thank you for your time.

David Gates

'[EE]:,[PIC]: How to measure level of liquids and s'
2000\05\31@213705 by Mark Willis

flavicon
face
Dan Michaels wrote:
{Quote hidden}

Aaah, you're thermally bonding the hot beads to the tube?  Perhaps
that'd work, might want to instead put a heater at the top of a small
rod, bond the thermistors to the rod, use them to measure along the rod,
maybe would work.

Good news is that you can use one larger PIC and run quite a few
thermistors simultaneously to get many data points simultaneously.
Sigma Delta code's not too hard to find <G>

 Mark


'[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]: 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
===================================================
.....nogueiraSTOPspamspam@spam@propic2.com                  ICQ# 19841898
ProPic tools - low cost PIC programmer and emulator
http://www.propic2.com
===================================================

{Original Message removed}

2000\06\01@110847 by Alan B Pearce

face picon face
>What about picking the fuel injector pulse? I was
>thinking in applying this to measure RPM and fuel
>consume.
>to measure the width of the pulse I will use CCP

probably easier to get at than the starter ring gear. Also kills two birds with
one stone, if you are needing fuel consumption data. I do not know how accurate
it would be, put probably accurate enough.

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

flavicon
face
If you've used the external SRAM (as in STATIC, not serial) on a PIC or AVR-
which SRAM did you use?  I'm having problems finding a 64Kx8 part that is
pin compatible (without gates other than an address latch) and is in stock
somewhere.  I could go to a 2 32K SRAMs, but I'd rather not.

The PIC (17C) uses an ALE, /OE, /WR scheme, and the AVR uses an ALE, /RD,
/WR scheme.  The PIC appears compatible with the 61XXX family of SRAMs (64Ks
are currently being made of Unobtanium [Un]), but in my brief search, I
haven't found any that are directly compatible with the AVR's scheme.
Serial RAMs are not an option, due to speed issues.

Matt Bennett

'[PIC]: Chip test program??'
2000\06\01@114458 by Don B. Roadman

flavicon
face
Is there any program written to exercise a PIC to see if it is working
properly? I know it couldnt be perfect, but I searched the net
looking for code that might have been used to verify probably good
operation of a pic. I'm interested in overclocking, and I'm sure
others are too, so I figured someone might have written a routine
that pretty well wrings out a pic to verify correct operation. I tested
some 4 mhz chips with a little sequential led flashing program, and
these chips "seemed" to work at 20 Mhz, but still, I feel uneasy
about overclocking anything unless I have a pretty good feel for it.

'[EE]:,[PIC]: How to measure level of liquids and s'
2000\06\01@115140 by Dan Michaels

flavicon
face
Mark  wrote:
.....
>> Not that I've ever tried this, but I figure the temperature variation
>> would distribute itself along the tube in some manner [to be measured
>> and calibrated empirically], and the math would be some weighted
>> averaging routine. Just a thought. The sorta thing you try once, and
>> immediately get a strong hunch whether it will ever work or not.
>>
>> - Dan
>
>Aaah, you're thermally bonding the hot beads to the tube?  Perhaps
>that'd work, might want to instead put a heater at the top of a small
>rod, bond the thermistors to the rod, use them to measure along the rod,
>maybe would work.
>

Yeah, that's pretty much what I had in mind. Although I am not a
thermal engineer, it seems to me there will generally be a temperature
difference between the fluid, now matter what it is, and the air
above it - due to thermal inertia - so a heater may not be required.
I'd have to try this to see how it would work. It might work with
3 thermistors this way - one at the bottom [in the fluid], one at the
top [out of the fluid], both of which act as references, and one in
between to do the actual weighted measurement - all bonded to the same
long tube.
=============

>Good news is that you can use one larger PIC and run quite a few
>thermistors simultaneously to get many data points simultaneously.
>Sigma Delta code's not too hard to find <G>
>

For production stuff, I think most companies would want to go with
as few parts as they could get away with --> costs, plus reliability
issues.

- Dan

'[PIC]: Truck tachometer'
2000\06\01@122155 by Dale Shelor

flavicon
face
>
>What about picking the fuel injector pulse? I was
>thinking in applying this to measure RPM and fuel
>consume.

If it is a Diesel it's probably mechanical injected.  Only the lastest
diesel trucks have electroniclly controlled injection.  It may be possible
to read the mechanical injection pulses with a load cell on one of the
injection lines.  If it is a newer electroniclly controlled diesel then you
can probably find the RPM as serial data from the engine fuel computer.
The new Volvo trucks have a Motorola 68HC11 in the dash just to control the
gauges.  It appears a lot of info (RPM, speed, temp, oil pressure) is sent
as signal serial data stream to the dash. (But they still run hoses all the
way to the dash and have mechanical air pressure gauges!)

For low RPM engines (like diesel trucks) the alternator is not real bad
source for RPM.  Oldsmobile did it for years on their diesel cars. (not
saying that Oldsmobile did anything right with a diesel car! 0-60 in 32
seconds, those were the days...)

Dale

'[EE]:,[PIC]: How to measure level of liquids and s'
2000\06\01@125948 by Mark Willis

flavicon
face
Dan Michaels wrote:
{Quote hidden}

It'd depend on situation, around here on a cold day that wouldn't work
well though - if the temp's 55F and the water pours in at 55F, you would
need to rethink - in hotter climes, 55F vs. 80F, easy to see the
difference.  Worth a try some time when you have "spare time", that
elusive thing we never have enough of <G>  I wouldn't expect
self-heating from the thermistors to work in this situation, bet you
don't either;  power resistors are cheap and plentiful though <G>  (Bond
a 5W or so resistor inside the top of the tube, use polyurethane power
cable out the top, seal the ends with PVC cement goop after scratching
the cable to give you good bonding and then using that purple MEK stuff
to prep the cable?  Seems to work pretty well in past, IME.  Run say
1-2W into the resistor so it won't be over stressed.)

> >Good news is that you can use one larger PIC and run quite a few
> >thermistors simultaneously to get many data points simultaneously.
> >Sigma Delta code's not too hard to find <G>
> >
>
> For production stuff, I think most companies would want to go with
> as few parts as they could get away with --> costs, plus reliability
> issues.

Sure - So long as it works <G>

> - Dan

--
I re-ship for small US & overseas businesses, world-wide.
(For private individuals at cost; ask.)

'[PIC]:School DAQ project'
2000\06\01@132103 by Matt Bonner

flavicon
face
David and Melanie wrote:

> My name is David and I am going to a technical college in
> Victoria BC Canada.

Hi David,  Chris gave you a good starting point.  Which
college in Victoria - Camosun College?  I taught the
embedded systems course (once) there a few years ago and
convinced the powers-that-be to move from Intel to PIC.  Say
Hi to Don Evans and Les Papp for me (if those old fogies are
still there).

--Matt

'[PIC]: Chip test program??'
2000\06\01@132507 by Mark Willis

flavicon
face
In the uChip Advanced seminars (IIRC) they discuss this;  Anyone know if
that concept's on the uChip web site?

Don't want to do this on an OTP part unless you make it part of your
power-up code, of course.

 Mark

Don B. Roadman wrote:
> Is there any program written to exercise a PIC to see if it is working
> properly? I know it couldnt be perfect, but I searched the net
> looking for code that might have been used to verify probably good
> operation of a pic. I'm interested in overclocking, and I'm sure
> others are too, so I figured someone might have written a routine
> that pretty well wrings out a pic to verify correct operation. I tested
> some 4 mhz chips with a little sequential led flashing program, and
> these chips "seemed" to work at 20 Mhz, but still, I feel uneasy
> about overclocking anything unless I have a pretty good feel for it.

--
I re-ship for small US & overseas businesses, world-wide.
(For private individuals at cost; ask.)

'[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 <zarthragEraseMEspam@spam@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:                RemoveMEjsandspamspamBeGonepixie.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
===================================================
spamBeGonenogueiraKILLspamspam@spam@propic2.com                  ICQ# 19841898
ProPic tools - low cost PIC programmer and emulator
http://www.propic2.com
===================================================

----- Original Message -----
From: Bill Colville <wtc3spam_OUTspam@spam@SUSCOM.NET>
To: <spamBeGonePICLIST@spam@spamMITVMA.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@142540 by John C. Frenzel

flavicon
face
----- Original Message -----
From: "Octavio Nogueira" <RemoveMEnogueiraEraseMEspamKILLspamAJATO.COM.BR>
To: <spamBeGonePICLISTspam_OUTspamRemoveMEMITVMA.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:

.....akunzspamRemoveMEtdipower.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]: 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

2000\06\02@050558 by TOM THERON

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

Tom

----- Original Message -----
From: Bob Ammerman
To: PICLISTspam@spam@MITVMA.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 <EraseMEMatt.BennettRemoveMEspamSTOPspamANDREW.COM>
To: <RemoveMEPICLISTKILLspamspamTakeThisOuTMITVMA.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:
 >   <              spamBeGonejuggernutzspam@spam@yahoo.com
/^      ^\            RemoveMEjuggernutspam_OUTspamcrosswinds.net
^      ^             imcecespamspamcrosswinds.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:
 >   <              spam_OUTjuggernutzspam_OUTspamspam_OUTyahoo.com
/^      ^\            juggernutspam_OUTspamcrosswinds.net
^      ^             RemoveMEimceceKILLspamspam@spam@crosswinds.net
just hoping that your key!!!

'[EE]: [PIC]: How to measure level of liquids and s'
2000\06\02@061225 by Peter L. Peres

picon face
> Not that I've ever tried this, but I figure the temperature variation
> would distribute itself along the tube in some manner [to be measured
> and calibrated empirically], and the math would be some weighted
> averaging routine. Just a thought. The sorta thing you try once, and
> immediately get a strong hunch whether it will ever work or not.

The way to do this is with 2 thermistors buried in a full cylinder such that
their sizes are negligible wrt to the cylinder diameter and whose
(cylinder's) heat conductivity approximates that of the liquid. The relation
that governs the output is so hard to match to reality that a lookup table
must be used. The output depends on the heat conductivity of the liquid and
the thermistors must be run very hot to get decent results. At the same time
the liquid must not boil or convect on the cylinder. If the liquid moves
(pump, drain, convection) without level change then the readout changes (the
conductivity changes).

However, there is a similar method, that is used, and works well. It is the
one with the thermistor wire that is partially immersed. This is what
measures the fuel level in your car's tank probably. The sensors are
available in lengths of up to 10 ft (can you say marine diesel tank ?).
Check out a National catalog for chips that interface to these, although you
can roll your own. Note that most sensors are 'bare' wires but there are
such sensors with teflon or ceramic clad wire which can go into evil liquids.
These are expensive and fragile. The fun part is, that this method is
imprevious to sloshing as it integrates the 'waves' away ;-)

bye,

       Peter

2000\06\02@061235 by Peter L. Peres

picon face
Hi,

the method that uses an air column raised by the liquid is actually VERY
accurate. The output value (air pressure in tube wrt atmosphere above free
surface of liquid) will practically depend only on the liquid density (rho)
and the height. Since 10 meters of water column ~= 1 at you can use a
differential pressure gauge for atmospheric use to read the height in most
usual tanks, and it will be accurate to within the height of the measuring
tube inlet (i.e. the vertical size of the tube opening under the liquid
surface). The readings will be off if the liquid is moving (flowing river =
Bernoulli suction on the tube inlet). Keeping the plumbing clean is a pain
however. Overflowed washing machine anyone ? <g>

Afaik, the humidity of construction materials (such as sand) is indeed taken
by weighing, cooking, and weighing, on a probe taken by a worker. They also
determine the density of the material after cooking. The measuring recipient
is a small round cylindrical pot with a hemispherical bottom which is to be
filled to the upper rim and evened. With a kid's sand tools ;-). They use a
sieve to make the input even and they push it in to remove air pockets. The
vessel I say holds about 2 liters of water (~ 5-7 kg of dry sand). The
density can be very important when working with large quantities (ever run
out of some ingredient with 95% of the concrete poured ? <g>). For materials
that cannot be heated (coffee, tobacco, more) the water is removed by using
vacuum at room temperature (0.3 at will dry it in a few hours). The rest is
the same as above. The recipient is also the same afaik. Another thing they
determine for concrete is the Ph of the input materials. This is done on the
wet material. Having a bad Ph in concrete input materials can really ruin
your day afaik.

Peter

'[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: RemoveMEvasileRemoveMEspamEraseMEl30.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
KILLspamwernersspamspamBeGonefsl.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
===================

'[EE]: [PIC]: How to measure level of liquids and s'
2000\06\02@121935 by Dan Michaels

flavicon
face
Peter L. Peres wrote:
....
>However, there is a similar method, that is used, and works well. It is the
>one with the thermistor wire that is partially immersed. This is what
>measures the fuel level in your car's tank probably. The sensors are
>available in lengths of up to 10 ft (can you say marine diesel tank ?).
>Check out a National catalog for chips that interface to these, although you
>can roll your own. Note that most sensors are 'bare' wires but there are
>such sensors with teflon or ceramic clad wire which can go into evil liquids.
>These are expensive and fragile. The fun part is, that this method is
>imprevious to sloshing as it integrates the 'waves' away ;-)
>

Peter, can you more fully describe the makeup of this 10' length
of sensor? I thought a thermistor was basically a resistive bead with
copper wires attached. Are you referring here to some kind of distributed
thermo-resistive element? Confusing.

- Dan Michaels

'[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 <PICLISTspamspamMITVMA.MIT.EDU>
From:                   Nebelong Bjarne <RemoveMEbjarne.nebelongspamBeGonespamRemoveMEBINDOMATIC.SE>
Subject:                Re: [PIC] 12C508 OSCCAL value
To:                     KILLspamPICLISTspamBeGonespamMITVMA.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).

'[EE]: [PIC]: How to measure level of liquids and s'
2000\06\02@225249 by Ian Wilkinson

flavicon
face
On Thu, 01 Jun 2000 in "Re: [EE]: [PIC]: How to measure level of liquids and sense", you wrote:
I don't know if this has been mentioned before as I've not been following this
until I noticed a system that uses two metal rods that are placed into the
liquid.  The resistance is measured and as the liquid rises the resistence
drops.  Now this will probably only work for water based liquids, but does look
to be a very quick solution...

Ian.
--
Hofstadter's Law:
The time and effort required to complete a project are always more than
you expect, even when you take into account Hofstadter's Law.

Uptime at  3:28am  up 1 day, 11:20,  4 users,

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

'[EE]: [PIC]: How to measure level of liquids and s'
2000\06\03@150830 by Peter L. Peres

picon face
>Peter, can you more fully describe the makeup of this 10' length
>of sensor? I thought a thermistor was basically a resistive bead with
>copper wires attached. Are you referring here to some kind of distributed
>thermo-resistive element? Confusing.

Dan,

normally thermistors are indeed bead-type using discoidal or cylindrical
active elements, but the original [tm] - ca. 1800's ? - way to do this, is
thermistor wire. Which comes on reels and is spec'd in ohms/meter. This is
different than resistor wire, as the latter has a near-zero temperature
coefficient, whereas the thermistor wire has a positive (and very linear vs.
other methods) coefficient. Tungsten wire comes to my mind as an inexpensive
<grin> candidate (note: tungsten wire: not tungsten steel. Chemical symbol
W, aka Wolfram in other parts of the world). This is what incandescent bulb
filaments are made of usually. In real life, complex and proprietary alloys
are used for the wire. The W wire is very fragile (it shatters like a
ferrite) so it has very limited uses. The tempco (for certain W alloys) is
about +0.03-0.05 ohms/K at around room temperature. You should really get
hold of a National Data Book that features the relevant chips, they go into
some depth with this (Automotive Section).

The wire is spanned in a frame (or a tube with openings), and immersed
vertically in the liquid. The liquid wets a part of the wire, and this part
will be cooled very efficiently. The part that sticks out heats up due to
the current passed through and this is what you measure. The wires used in
automotive apps. have a very high tempco (can't run them hot). The accuracy
depends directly on the temperature of the exposed wire and on the tempco of
the wire (both as high as possible to make it more accurate).

Peter

'[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]: 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 <@spam@mmsesysSTOPspamspam@spam@ICON.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
===================================================
spamBeGonenogueiraspampropic2.com                  ICQ# 19841898
ProPic tools - low cost PIC programmer and emulator
http://www.propic2.com
===================================================

{Original Message removed}

'[EE]:[PIC]: How to measure level of liquids and'
2000\06\05@063938 by Mike Witherden

flavicon
face
1 ¸ c worth:  

Dual band Infra Red transducers would also work and can be calibrated very accurately.
The absorption and reflection of Infra Red by a substance is greatly affected by the
substances water content. Using 2 bands of Infra Red improves the effect.

MikeW


.......
The normal method of measuring effective humidity in wood, concrete, sand,
etc., is by conductivity.
......

'[PIC]: External SRAM on PIC (or AVR)'
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}

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
spam_OUTdfanslerSTOPspamspamTriPathImaging.com <RemoveMEdfanslerspamspamTriPathImaging.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
TakeThisOuTneehrspamspamRemoveMEswipnet.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]: 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 KILLspamjamesnewtonspamspamspam_OUTgeocities.com 1-619-652-0593


{Original Message removed}

2000\06\05@114915 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 <mmsesysRemoveMEspamICON.CO.ZA> writes:
> PCF8570 from Philips,  256 x 8,  i2c interface.
>
> Tom
>
> {Original Message removed}

2000\06\05@115258 by Dan Michaels

flavicon
face
Harold wrote:
>        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.
>

Bob Ammerman wrote:
>Exactly what my search turned up - nada nil nothing none :-(
>

You can always go to a PIC with a large 68-84 pinout, like Harold
is doing, but adequate RAM definitely *is* a problem for small PICs.

Maybe nada [from practical perspective] but -->  Solutions Cubed has
the RAMPack, which has 8Kx8, RS-232 addressable, designed originally
for use with Basic Stamp, but expensive at $29.95 from Jameco. Can
expand to 32K.

I recently designed my own spin-off from the RAMPack. Uses 2 32Kx8
SRAMs, controlled by a PIC64 on a small 2"x2" pcb. Addressable via
RS-232, and also in byte-mode with address/data lines multiplexed.
Can also be addressed in nybble-mode, so you can run off a PIC using
as few as 8 interface lines. I just received the pcbs, but haven't
finished the s.w. yet. I may eventually add I2C access. Estimated
max read/write rate is 500KB/sec in burst-mode/byte-mode.

This is a more difficult approach [and more expensive] than going
to a larger pinout PIC, but I think a reasonable compromise for
drop-in to a system with a small PIC.

I had also considered going with a '4040, like Octavio, but you can't
have multiple data buffers or random access that way. An alternative
is 4 '161' chips, but that's a "real" PITA.

best regards,
- Dan Michaels
Oricom Technologies
http://www.sni.net/~oricom
==========================

2000\06\05@120133 by Michael Rigby-Jones

flavicon
face
{Quote hidden}

I would have though a PAL/GAL solution would have been better for speed and
cost in this type of application??

Mike

2000\06\05@120527 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@120531 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
===================================================
EraseMEnogueiraRemoveMEspampropic2.com                  ICQ# 19841898
ProPic tools - low cost PIC programmer and emulator
http://www.propic2.com
===================================================

{Original Message removed}

'[EE]:[PIC]: How to measure level of liquids and'
2000\06\05@120729 by Mike Witherden

flavicon
face
1 ¸ c worth:  

Dual band Infra Red transducers would also work and can be calibrated very accurately.
The absorption and reflection of Infra Red by a substance is greatly affected by the
substances water content. Using 2 bands of Infra Red improves the effect.

MikeW


.......
The normal method of measuring effective humidity in wood, concrete, sand,
etc., is by conductivity.
......

'[PIC]: External SRAM on PIC (or AVR)'
2000\06\05@121140 by Dan Michaels

flavicon
face
At 05:00 PM 6/5/00 +0100, you wrote:
.......
>>
>> I had also considered going with a '4040, like Octavio, but you can't
>> have multiple data buffers or random access that way. An alternative
>> is 4 '161' chips, but that's a "real" PITA.
>>
>I would have though a PAL/GAL solution would have been better for speed and
>cost in this type of application??
>
>Mike
>

Mike, yes, I considered that approach too. No good if you want
RS-232 or I2C accessibility. However, for simple counting, PAL
is possible. However, you do need 16 output registers [for 64KB],
8/16 inputs for addressing, and 3-4 control lines.

As far as I can tell this would require 2 24-bit PALs in series,
or else go need to go a gate-array. Got any specific suggestions
along this line? PAL or gate-array?

regards,
- Dan Michaels
==============

2000\06\05@122644 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
spamdfansler.....spamspamTriPathImaging.com <dfanslerspam_OUTspam@spam@TriPathImaging.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@122855 by paulb

flavicon
face
Hello -=jugggernut=-.

 I've been working on a not too dissimilar project with ke Neehr
.....neehrspamspam.....swipnet.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.

'[EE]: [PIC]: How to measure level of liquids and s'
2000\06\05@141742 by Craig Lee

flavicon
face
I use a conductivity system with two probes referenced to a common probe
for sensing and controlling liquid levels.  The system is designed using
AC voltage to limit mineral plating to the electrodes.  I wouldn't want
to use it in a flamable liquid! It acts as kind of a Schmitt Trigger.
An output relay is turned on once the top electrode is emersed, and the
output is turned off once the lower electrode is out of the liquid.

Is this of interest to anyone?

{Original Message removed}

2000\06\05@143702 by Craig Lee

flavicon
face
Why not just use a float in a tube connected to an indexed rotary
encoder.  Counterbalance the float to a spring on the shaft of the
encoder, so that the float will extend the length of the tube unless
liquid is present.  Or instead of a spring, just counterbalance with
another weight.

Then just read the gray code.  Some of them even come with their own
counter and SPI interface, making it even easier to connect to a pic.
I'm using a unit that has 4096 transitions per revolution and there
are standard models that do 16384, so resolution certainly shouldn't
be an issue.

See http://www.opticalencoder.com for rotaries that might work for ya.

No Bernoulli issues, no ADC noise problems, no lookup tables, no calcs,
no plating, or liquid specific issues....


Craig


{Original Message removed}

'[PIC]: - Debugging Tool Request'
2000\06\05@160245 by andy howard

flavicon
face
----- Original Message -----
From: "Shawn Yates" <syatesKILLspamspamEraseMECARETECHNOLOGIES.COM>
To: <EraseMEPICLIST@spam@spam@spam@MITVMA.MIT.EDU>
Sent: Monday, June 05, 2000 04:23
Subject: [PIC] - Debugging Tool Request


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


I'd really recommend the Wave Analyser function of PIC DE-Sim, part of
the WizPIC program-builder package from FED. It does that and much more.

Very handy for checking that your serial routines are really doing what
you think they are.

Which, of course, they aren't.

http://www.fored.co.uk/WavePicture.htm
You can wavetrace, in a variety of ways, pretty much anything your
program can see or wiggle. Splendid tool, surprised it isn't more
famous. It'll change your life. Simulates at "SX Turbo" speeds too.


No connection, satified punter only, etc.

Cheers,

Andy.













.

'[PIC]: External SRAM on PIC (or AVR)'
2000\06\05@160452 by Hugo Jorge Mller

flavicon
face
Where you buy TC554001 ? Cost ? Datasheets ?

Thanks

Hugo J. M|ller
H.J.M. Hardware & Software Diseqos Electrsnicos
San Nicolas 683
Tel-Fax : 54-(0)-343-424-5953
(3100) Parana (Entre Rmos) Argentina
Email : hmuller [ANTISPAM-QUITAR-ESTO] @arnet.com.ar
Web Site: http://www.pagina.de/hjm
UIN (ICQ) : 38.605.074

{Original Message removed}

2000\06\05@170018 by Octavio Nogueira

flavicon
face
I buy from digikey or Avnet for around $13.
datasheet available at Toshiba site at
http://www.toshiba.com/taec/components/Datasheet/4001.pdf

Friendly Regards

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

{Original Message removed}

'[pic]: about seminar'
2000\06\05@175631 by Andre Abelian

picon face
Hi to all.

I like to know if any one is going to be in microchip seminar
tomorrow June 6 (woodland hill).

Andre

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

picon face
Nonvolatile is nice, but this does have a limited cycle lifetime, even for
reads. Without care to avoid 'burning' some locations of the chip you could
easily reach the lifetime limits in a matter of months of normal operation.

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

----- Original Message -----
From: Fansler, David <spamBeGoneDFANSLERRemoveMEspamEraseMEAUTOCYTE.COM>
To: <RemoveMEPICLISTKILLspamspamRemoveMEMITVMA.MIT.EDU>
Sent: Monday, June 05, 2000 9:12 AM
Subject: Re: [PIC]: External SRAM on PIC (or AVR)


{Quote hidden}

>                 {Original Message removed}

2000\06\05@184331 by Bob Ammerman

picon face
Yep, the external RAM chip with a counter for address input makes a lot of
sense. I designed, but never implemented a scheme that would have the
following characteristics:

1: 12 I/O's (or maybe 11? if I recall correctly) required for access
2: easily adaptable to 2^16=64KB, 2^20=1MB, 2^24=16MB or more  bytes of RAM
maximum
3: '161 counter chips for address inputs
4: Random access time on the order of about 10-20 PIC instruction cycles.
5: Sequential read access time on the order of about 3 PIC instruction
cycles (bsf CLOCKBIT, bcf CLOCKBIT, movf DATAREG,W).
6: Sequential write access time on the order of about 5 PIC instruction
cycles (movwf DATAREG, bsf CLOCKBIT, bcf WRITEBIT, bsf WRITEBIT, bcf
CLOCKBIT)

By the way, we can kind of tie this thread to the 'PIC on Internet' thread.
A reasonable amount of SRAM, even if non-sequential access is rather
inefficient, would go a long way to implementing a decent protocol stack.

It seems reasonable, but I sure would like to find the logic all wrapped up
in one chip. I even considered something like the XILINX chips, but too many
$$ for chips and especially for tools.

Bob Ammerman
RAm Systems
(high function, high performance, low-level software)
[and occasionally hardware, if it's digital  :-)]

{Original Message removed}

'[PIC]: RS232 serial connection between a PIC17C42A'
2000\06\05@190818 by sertier

flavicon
face
Hi all!

I would like to read data from the PIC17C42A in-circuit and to send it to a
PC (hyperterminal) via a RS232 connection. I use the PIC's UART. Where can I
find help to realize this connection? I have found some help with
Microchip's web site, and also on the PIC FAQ, but I have never found a
document that would help for both the hardware and the software, and would
explain the serial connection from the beginning to the end.
Thank you very much for your time.
Regards,
Nathalie.
________________________________________
Nathalie SERTIER
Viosense Corporation

2400 Lincoln Avenue
Altadena, CA 91001-5436
phone:   (626) 296 6376
fax:     (626) 296 6371
email:   EraseMEsertier.....spamKILLspamviosense.com
website: http://www.viosense.com
___________________________________________

'[PIC]: External SRAM on PIC (or AVR)'
2000\06\05@190822 by Dan Michaels

flavicon
face
Bob Ammerman wrote:
>Yep, the external RAM chip with a counter for address input makes a lot of
>sense. I designed, but never implemented a scheme that would have the
>following characteristics:
>
>1: 12 I/O's (or maybe 11? if I recall correctly) required for access
>2: easily adaptable to 2^16=64KB, 2^20=1MB, 2^24=16MB or more  bytes of RAM
>maximum
>3: '161 counter chips for address inputs
>4: Random access time on the order of about 10-20 PIC instruction cycles.
>5: Sequential read access time on the order of about 3 PIC instruction
>cycles (bsf CLOCKBIT, bcf CLOCKBIT, movf DATAREG,W).
>6: Sequential write access time on the order of about 5 PIC instruction
>cycles (movwf DATAREG, bsf CLOCKBIT, bcf WRITEBIT, bsf WRITEBIT, bcf
>CLOCKBIT)
>

I have a 20Mhz SRAM board I designed/had built [but still sitting in the
box], which uses 4 74AC161 chips + logic, but this is rather bulky for
a little PIC embedded system. So, I looked at putting the counter/logic
in a PAL, but here it even takes 2 24-pin chips AFAICT.
===========

>By the way, we can kind of tie this thread to the 'PIC on Internet' thread.
>A reasonable amount of SRAM, even if non-sequential access is rather
>inefficient, would go a long way to implementing a decent protocol stack.
>

Would this stack require extra code space, or just data RAM?
==============

>It seems reasonable, but I sure would like to find the logic all wrapped up
>in one chip. I even considered something like the XILINX chips, but too many
>$$ for chips and especially for tools.
>

Ha, in my neighborhood that's what you call a 40-pin PIC. Seems a waste
of a nice little PICy just to access address/data/control lines, but it
does unfortunately take all the available lines on the PIC - but then you
also have RS-232/I2C/custom s.w./etc capability. Try that on XILINX.

best regards,
- Dan Michaels
Oricom Technologies
http://www.sni.net/~oricom
==========================

2000\06\05@192312 by Tony Nixon

flavicon
picon face
Bob Ammerman wrote:
>
> Yep, the external RAM chip with a counter for address input makes a lot of
> sense. I designed, but never implemented a scheme that would have the
> following characteristics:

I used this approach to aquire data from a PIC 74 at 10K samples and
store to a 128K RAM chip with inbuilt battery backup. (Dallas)

If you are using DIP RAM chips you can mount the address decoder
directly under the chip to save space. 10 pins to the PIC (8 for data),
but limitation is sequential read/write. Add a parallel to serial chip,
and probably 4 PIC pins used.

The track layout can be simplified because all the Q outputs from the
binary counter chip can be connected in any order to any of the RAM
address pins. The data will still read in or out the same for any given
address. Using this approach I just fanned out the address leads to the
nearest RAM pin.


--
Best regards

Tony

http://www.picnpoke.com
spamsalesspampicnpoke.com

2000\06\05@204317 by Bob Ammerman

picon face
See my comments marked '***' below

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


{Original Message removed}

2000\06\05@234205 by Dan Michaels

flavicon
face
Bob Ammerman wrote:
.....
>> I have a 20Mhz SRAM board I designed/had built [but still sitting in the
>> box], which uses 4 74AC161 chips + logic, but this is rather bulky for
>> a little PIC embedded system.
>
>*** Want to sell one?
>

Oops, I mis-spoke here. Should have said [note **additions** below]:

  I have a **LOGIC BOARD WITH** 20Mhz SRAM **CAPABILITY EMBEDDED INTO IT**,
  that I designed/had built [but still sitting in the box], which uses
  4 74AC161 chips + logic, but this **CONCEPT** is rather bulky for a
  little PIC embedded system.

Sorry. This isn't actually a RAM board, per se, but rather a logic board
with a bunch of other chips, all controlled by a 50mhz SX28, etc. It
has only 1 32Kx8 SRAM chip.

Hmmm, maybe I should redesign it, and sell it as a "RAM board". But
those 4 '161 chips/etc take up a lot of room. Would want to go with PAL
or something else in a re-design.

However, I do have actual "RAM board" pcbs in hand that I recently designed
--> 2 32Kx8 skinny SRAMs controlled by a PIC16C64/74. 2"x2", but much
slower/etc than above - as noted in a previous msg. Firmware is currently
vaporware.
===================

.........
{Quote hidden}

"right tools for the job" or the cheapest tools for the target market
:-)). Even at $4/PIC, the PIC sol'n is just about competitive I think with a
couple of 24-pin PALs, or 4 counters + misc logic [factoring in real
estate/etc],
XILINX, etc/etc. In small qty.

Another possible is going to a 48/52-pin Scenix - could probably get
4-5 MByte/sec read/writes. Plus, of course, ability for custom s.w. again.
I did consider this route - shrunk back at using PQFP chips.

I am still looking at a custom PAL design. On and on.

best regards,
- Dan Michaels
Oricom Technologies
http://www.sni.net/~oricom
==========================

'[PIC]: Ultraedit customization'
2000\06\06@011528 by Eric Earnst

flavicon
face
Hi,
Based on the recent discussion of code editors I've gone and paid for
Ultraedit32.  I'm curious if anybody has done any significant
customization of the Microchip wordfile or developed any useful macros
they would be willing to share.

Thanks,
Eric

2000\06\06@013725 by Tony Nixon

flavicon
picon face
Eric Earnst wrote:
>
> Hi,
> Based on the recent discussion of code editors I've gone and paid for
> Ultraedit32.  I'm curious if anybody has done any significant
> customization of the Microchip wordfile or developed any useful macros
> they would be willing to share.
>
> Thanks,
> Eric

These may be useful

http://www.picnpoke.com/projects/compares.asm

--
Best regards

Tony

http://www.picnpoke.com
salesSTOPspamspampicnpoke.com

2000\06\06@071553 by Les

flavicon
picon face
Hello eric
I have attached a wordfile that I have created over a period of a few years.
It is compatible with PBASIC, C, and ASM, aswell as a few for pascal. Also
attached are template files and macros (mainly for PBASIC). In the windows
config folder are my configurations for ULTRAEDIT, which will setup the user
tools and display them on the toolbar. If you use these files make a backup
of your original ultraedit configs from the windows directory. I hope this
help, ultraedit is an excellent programming base. I find it hard now to look
at code that isn't colour coded.



                               Regards
                                       Les
lesSTOPspamspamKILLspamtop204.freeserve.co.uk



----- Original Message -----
From: Eric Earnst <@spam@earnst.....spamspamSPRINTMAIL.COM>
To: <spamPICLIST.....spam.....MITVMA.MIT.EDU>
Sent: Tuesday, June 06, 2000 6:13 AM
Subject: [PIC]: Ultraedit customization


> Hi,
> Based on the recent discussion of code editors I've gone and paid for
> Ultraedit32.  I'm curious if anybody has done any significant
> customization of the Microchip wordfile or developed any useful macros
> they would be willing to share.
>
> Thanks,
> Eric
>

2000\06\06@074740 by Les

flavicon
picon face
part 0 1249 bytes
Hello eric
I have attached a wordfile that I have created over a period of a few years.
It is compatible with PBASIC, C, and ASM, aswell as a few for pascal. Also
attached are template files and macros (mainly for PBASIC). In the windows
config folder are my configurations for ULTRAEDIT, which will setup the user
tools and display them on the toolbar. If you use these files make a backup
of your original ultraedit configs from the windows directory. I hope this
help, ultraedit is an excellent programming base. I find it hard now to look
at code that isn't colour coded.



                               Regards
                                       Les
les.....spamtop204.freeserve.co.uk




{Original Message removed}

'[PIC]: Frequency Scaling - remapping'
2000\06\06@094036 by Peter Betts

picon face
Hello,

I'm Pete and I'm a recent convert to the PIC chip.

I am trying to build a project at home which measures the frequency of a
digital signal, modifies the frequency value and uses this to generate a new
frequency output.

e.g.  1kHz in gets scaled by 2/3 say and frequency output is 666.66Hz

Firstly I wanted to just get the reading of the frequency working (exact
frequency is not important just the relative scaling)
So I set up a timer at a rate of approx 3.9ms which I used to call an
interrupt routine. The interrupt routine then tested/checked the input
signal level (hi or lo) and then incremented a counter. This gave me a
resolution from 1Hz to 256Hz using a 5MHz XTAL. (Just using a single 8 bit
counter)

The counter was used to count the time between successive high pulses (this
was to ensure if I had an input which was not a 50:50 duty cycle I could
still scale it and generate a 50:50 duty cycle output.) The counter value/2
was the hi or lo period respectively.

First: Does anybody have a better way of measuring the period of an
incomming signal in order to generate a scaled frequency output.

Second: My output signal seems to gitter quite a bit and I don't know why.

Third: (and finally) I ideally want to remap the input so I guess I could
use a 256 element look up table and for every frequency input value I can
look up a new output value so I can have my own user defined mapping. Good
or bad?

I have a basic system working but it doesn't look at all elegant so I would
appreciate new ideas.

Thanks

Pete

2000\06\06@100109 by M. Adam Davis

flavicon
face
There are chips (which are less expensive) which do frequency scaling for you.
Is there a special reason why this must be done in PIC (aside from learning
about the PIC, which is a very good reason)?

Assuming you are using a 16f84, there is an input to a counter on it which
allows you to count pulses as well.  You may want to look into this.

The jitter depends on your program.  If you can show us the program we might be
able to point it out.  Otherwise we can give general ideas, but nothing
specific.

Is the ratio input/ouput set, or are you trying to change it while it is
operating?  What is the ratio range (ie, 1:256 - 1:1)?  What is the highest
frequency you are likely to use?

-Adam

Peter Betts wrote:
{Quote hidden}

'[PIC]: and [OT]: Measuring weight using TSL214 wi'
2000\06\06@101815 by Nebelong Bjarne

flavicon
face
My guess is that you forgot to connect pin 4 to 8 and 10 to 13.
If you don't do this, you will have to separate output lines.


HŠlsningar/ Regards,
Bjarne Nebelong
Manager Electrical Design
BINDOMATIC¨
KILLspambjarne.nebelongspam_OUTspambindomatic.se <spam_OUTbjarne.nebelongspamTakeThisOuTbindomatic.se>
http://www.bindomatic.com <http://www.bindomatic.com>
+46-(0)8709 5846 (dir)
+46-(0)70639 5846 (cell)

{Original Message removed}

'[PIC]: Frequency Scaling - remapping'
2000\06\06@102853 by stouchton

flavicon
face
I use the RTCC (TMR) for frequency counter duty.  You can change the
prescale, and shift the main oscillator freq externally under command of the
PIC to give more flexibility.  Multiple counts and averaging gives more
stable results.

You can use the RTCC to determine duty cycle by comparing count and overflow
times once frequency  is narrowed in on.

Lookup table is the quickest way to handle divides.  You can have multiple
tables on multiple top halves of memory pages.


.... or just use an LO and a mixer/bandpass... but that wouldn't be as
fun!!!!!!!!!

{Original Message removed}

2000\06\06@104623 by Peter Betts

picon face
> There are chips (which are less expensive) which do frequency
> scaling for you.

Are there? Do you have any part numbers?


> Is there a special reason why this must be done in PIC (aside
> from learning
> about the PIC, which is a very good reason)?

Mainly to learn from it and to expand the features in the future would be
easier in SW. O.K. I admit.. sounded like a good idea to try a multitude of
elements of PIC design out on.


> Assuming you are using a 16f84, there is an input to a
> counter on it which
> allows you to count pulses as well.  You may want to look into this.

Yes I've used the 12C508, the 16F84 and now starting to use the 16F873
I used the sampling method of data capture, you're suggesting having a known
capture period and counting the number of pulses during that period?


> The jitter depends on your program.  If you can show us the
> program we might be
> able to point it out.  Otherwise we can give general ideas,
> but nothing
> specific.

It's at home so I'll bring it in tomorrow. Thanks.


> Is the ratio input/ouput set, or are you trying to change it
> while it is
> operating?  What is the ratio range (ie, 1:256 - 1:1)?  What
> is the highest
> frequency you are likely to use?

To have a fixed MAP in EEROM or RAM and use this to scale the input.

Range would be max 4:1 to 1:4, so it can increase or decrease.

Thanks

Pete

ps. Hi Scott, hope you are well. Still at Plantronics I see. You must be a
manager by now ;-)

'[PIC]: ICD question'
2000\06\06@125957 by Phillip Vogel

flavicon
face
Did I do the tag right? :-)

Why can't the folks at Microchip get it through their heads that programming
EVERY location when you're only using a few hundred is a real waste of time?

I'm working on a small section of a program. I set the program range to 0x0000
- 0x200. As long as the debug box is checked, the damned thing wants to
program the WHOLE chip, which takes about forever. If the debug box is
unchecked, I have to unplug the 'phone' cable while running, and reconnect it
(and push the reconnect button) to program.

This is nuts, or am I just missing something obvious?

--
Phillip M. Vogel, President   | "It's not what you've been taught,
Bartal Design Group, Inc.     |  it's what you've learned." (me)
318 Marlboro Road             | +1-201-567-1343 FAX:+1-201-568-2891
Englewood, NJ 07631  USA      | .....phillip.....spamRemoveMEbartal.com

'[PIC]: Frequency Scaling - remapping'
2000\06\06@152326 by pandersn

flavicon
face
Pete....

To measure the frequency of an input signal (be it 50/50 or 60/40 duty
cycle - or whatever), you can do the following: set up the capture and
compare module (mid-range PICs) CCP1, using timer1, to sample the signal on
its rising edge (but not enable the interrupt for the CCP!), and then use
timer 2, to interrupt at a rate a bit faster than the rate of your incoming
signal, then at each interrupt save the count from the capture register (if
its flag is set) and subtract the previous value. That way you'll get a
count at 1/4 the crystal frequency that represents the time period of your
input signal.

Example: set CAP1 to gather timer1 count each rising edge. Let timer1 free
run. Use timer2 set to overflow at a count of say 250 and an interrupt on
overflow. That means you'll be sampling your "captured" signal every 1/4 ms
(250 useconds - assuming a 4 Mhz xtal). A signal of 2000 kHz would have a
count of 500 (plus or minus roughly one by jitter).

You can then map that signal to something else.

Hope that helps.

Phil.

On Tuesday, June 06, 2000 8:40 AM, Peter Betts [SMTP:spam_OUTpeter.bettsTakeThisOuTspamEraseMENOKIA.COM]
wrote:
> Hello,
>
> I'm Pete and I'm a recent convert to the PIC chip.
>
> I am trying to build a project at home which measures the frequency of a
> digital signal, modifies the frequency value and uses this to generate a
new
> frequency output.
>
> e.g.  1kHz in gets scaled by 2/3 say and frequency output is 666.66Hz
>
> Firstly I wanted to just get the reading of the frequency working (exact
> frequency is not important just the relative scaling)
> So I set up a timer at a rate of approx 3.9ms which I used to call an
> interrupt routine. The interrupt routine then tested/checked the input
> signal level (hi or lo) and then incremented a counter. This gave me a
> resolution from 1Hz to 256Hz using a 5MHz XTAL. (Just using a single 8
bit
> counter)
>
> The counter was used to count the time between successive high pulses
(this
> was to ensure if I had an input which was not a 50:50 duty cycle I could
> still scale it and generate a 50:50 duty cycle output.) The counter
value/2
> was the hi or lo period respectively.
>
> First: Does anybody have a better way of measuring the period of an
> incomming signal in order to generate a scaled frequency output.
>
> Second: My output signal seems to gitter quite a bit and I don't know
why.
>
> Third: (and finally) I ideally want to remap the input so I guess I could
> use a 256 element look up table and for every frequency input value I can
> look up a new output value so I can have my own user defined mapping.
Good
> or bad?
>
> I have a basic system working but it doesn't look at all elegant so I
would
> appreciate new ideas.
>
> Thanks
>
> Pete

'[PIC]: ICD question'
2000\06\06@171010 by Octavio Nogueira

flavicon
face
If you check the "erase all before programming" box
the ICD will write just your code and the debug code.
It's much faster!

Friendly Regards

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

{Original Message removed}

2000\06\06@172224 by John Hansen

flavicon
face
<x-flowed>At 06:08 PM 6/6/00 -0300, you wrote:
>If you check the "erase all before programming" box
>the ICD will write just your code and the debug code.
>It's much faster!
>
>Friendly Regards
>
>Octavio Nogueira

While this is true, I don't think this is what Phillip meant.  The ICD
doesn't write to blank locations when you check "erase all before
programming", but it writes all the locations in your program whether the
bytes have been changed or not.  It takes a lot longer to write a byte than
to read it, so this slows things down a lot.  From what I've heard, the
PicStart Plus does the same thing.   Except when working with 16F87X parts,
I use an old ITU programmer.  The software that came with it does this same
thing... writes every location that has program in it whether it has
changed or not.  Instead, I'm using the command line program PP.  It only
writes to locations that have changed.  Generally, when I'm debugging code,
it will write my changes into the chip in under 2 seconds.  Having been
spoiled by this, using the ICD is a bit of a pain.

John Hansen

</x-flowed>

'[PIC]: Operation of PICs from low voltage'
2000\06\06@231614 by Russell McMahon

picon face
Still coming to grips with this new fangled system - gotta put : after PIC
they tell me to ensure all the pure PIC people see it .... mumble, mumble
... try again.


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]: 'F87xx Config Programming'
2000\06\07@003821 by Heinz Czychun

flavicon
face
Hi All,

       Now that I've gotten one of the new Flash PIC chips (16F872), I
wanted to program it. As indicated by an email by Jim Robertson, my WARP-3
and MacPic will program the 'F872, by selecting the 'F84 as the chip to be
programmed. But it cannot program all the bits in the config register, and
I would like to put it into HVP mode to liberate RB3. So I looked at Tony
Nixon's RomZap, and saw that it used the PICs special address and data
registers to program the Flash Program Memory.

       I wrote a program that should have set the config reg to 0x3F3D.
But when I checked with TM4 it showed the bits still at 0x3FF1. I also then
loaded a flasher program that increments port B, and only pins RB0-2
oscillate as they should, the ones above these are low.

       Is what I'm trying to do possible or have I done something wrong in
the program ?

       The wording in DS30221 page 110 seems to preclude this, but then it
says "...LVP bit can only be charged when using high voltage on ~MCLR." So
this seems it might be possible since I am "discharging" the LVP bit, or is
this semantics?


TIA,
Heinz

My program follows.....

;======= Flash_PROM_Config_reg_Demo ===================== 6/6/2000 ==
; This program will use the special registers within the 'F872
; to set the Config register.
; This can be checked with TM4 on the Compaq
;
       list    p=16F84         ; used since there is no 16F872
                               ; this already means that MacPic
                               ; cannot be used to program the
                               ; config register, and may mean that
                               ; that the full 2K of the 'F872 may
                               ; not be accessable for programming
       radix   hex
;____________________________________________________________
;       cpu equates (memory map)
indf           equ     0x00     ; indirect addressing Reg
tmr0           equ     0x01     ; Timer/Counter register
pcl            equ     0x02     ; program counter (low byte)
status         equ     0x03     ; status reg
fsr            equ     0x04     ; file select register
porta          equ     0x05     ; port A
portb          equ     0x06     ; port B
portc          equ     0x07     ; port C
       ; Note these registers are on page 1
opt_reg        equ     0x01     ; MPU Option Register
trisa          equ     0x05     ; Data Direction Port A
trisb          equ     0x06     ; Data Direction Port B
trisc          equ     0x07     ; Data Direction Port C
       ; Note these registers are on page 2
EEData         equ     0x0C     ; EEPROM Data reg
EEDataH        equ     0x0E     ; EEPROM Data reg high byte
EEAdr          equ     0x0D     ; EEPROM Address reg
EEAdrH         equ     0x0F     ; EEPROM Address reg high byte
       ; Note these registers are on page 3
EECon1         equ     0x0C     ; EEPROM Control reg 1
EECon2         equ     0x0D     ; EEPROM Control reg 2
;
;____________________________________________________________
;       bit equates
rp0           equ     0x05      ; bank select low bit
rp1           equ     0x06      ; bank select high bit
zBit          equ     0x02      ; Zero flag
rd            equ     0x00      ; EEPROM read control bit
wr            equ     0x01      ; EEPROM write control bit
wren          equ     0x02      ; EEPROM write enable bit
eepgd         equ     0x07      ; Flash EPROM write enable bit
;
LED           equ     0x04      ; pin for LED
;____________________________________________________________
;
       org     0x000
       goto    main
;____________________________________________________________
init
       bsf     status,rp0      ; switch to bank 1
       movlw   b'00000000'     ; outputs
       movwf   trisa
       movwf   trisb
       movwf   trisc
       bcf     status,rp0      ; switch back to bank 0
       movlw   0xFF            ; all Port A & B outputs high
       movwf   porta           ;
       movwf   portb
       return
;____________________________________________________________
main
       call    init
Start
       ; setup Flash PROM to set config reg at 0x2007
       bsf     status,rp1      ; switch to bank 2
;
       movlw   0x20            ; initialize EEPROM address to
       movwf   EEAdrH          ; config register
       movlw   0x07
       movwf   EEAdr
;
       movlw   0x3F            ; initialize config register
       movwf   EEDataH         ; data to 0x3F3D
       movlw   0x3D            ; HV programming only
       movwf   EEData
;
       bcf     status,rp1      ; switch back to bank 0
;
       call    WriteEEPROM     ; load value into EEPROM
;
       bcf     portA, LED      ; turn LED on (diagnostic)
LoadDone
       goto    LoadDone        ; just wait here
;
;____________________________________________________________
; **** NOTE THIS STILL MUST BE UPDATED FOR 'F872 operation ***
; on entry addressPtr holds the address of the EEPROM to be read
; on exitdataPtr holds the data that was read
;
ReadEEPROM
       return
;____________________________________________________________
; Address and data already set-up
;
WriteEEPROM
;
;       Note that normally the set-up would be done here from
;       a 16bit data buffer (actually 14bit), and a 16bit address pointer
;
       bsf     status, rp0     ; page select, page 3
       bsf     status, rp1     ;
       bsf     EECon1, eepgd   ; point to flash (program) memory
       bsf     EECon1, wren    ; enable write
       movlw   0x55            ; send 'magic' numbers to
       movwf   EECon2          ; EEPROM Control reg 2
       movlw   0xAA
       movwf   EECon2
       bsf     EECon1, wr      ; initiate write command
;
       nop
       nop
;
;WriteCompl
;       btfsc   EECon1, wr      ;Spec sheets show this as not necessary
;       goto    WriteCompl      ;
                               ; write is now complete
       bcf     status, rp0     ; switch back to page 0
       bcf     status, rp1
       return
;____________________________________________________________
;
      end
;============================================================
;at blast time, select:
;       memory                          unprotected
;       Debug                           disabled
;       Flash Program Memeory write     enabled
;       Data EE Code protection         off
;       Low Voltage Programming         disabled
;       Brown-out reset                 disabled
;       watchdog timer                  disabled (default is enabled)
;       standard crystal                XT
;       (using 4 MHz osc for test)
;       power-up timer                  on
;
;============================================================

2000\06\07@010656 by Tony Nixon

flavicon
picon face
Heinz Czychun wrote:
>
> Hi All,
>
>         Now that I've gotten one of the new Flash PIC chips (16F872), I
> wanted to program it. As indicated by an email by Jim Robertson, my WARP-3
> and MacPic will program the 'F872, by selecting the 'F84 as the chip to be
> programmed. But it cannot program all the bits in the config register, and
> I would like to put it into HVP mode to liberate RB3. So I looked at Tony
> Nixon's RomZap, and saw that it used the PICs special address and data
> registers to program the Flash Program Memory.

ROMzap can program the config word when you boot program a blank chip by
using the simple programmer interface.

I don't think you can program the config word internally.


--
Best regards

Tony

http://www.picnpoke.com
RemoveMEsalesspamBeGonespamspampicnpoke.com

'[PIC]: Frequency Scaling - remapping'
2000\06\07@024001 by Peter Betts

picon face
Phil,

> Example: set CAP1 to gather timer1 count each rising edge.
> Let timer1 free
> run.

Sorry for being dumb but this means at the internal clock rate, no
prescaler. i.e. timer1 increments every 4th clock cycle?  Yes?


> Use timer2 set to overflow at a count of say 250 and an
> interrupt on
> overflow.

Doh! I must have missed that. I didn't know you could set where the overflow
would occur, I've been assuming it was always on 255->256 count! Hows that
done then?


>That means you'll be sampling your "captured"
> signal every 1/4 ms
> (250 useconds - assuming a 4 Mhz xtal). A signal of 2000 kHz
> would have a
> count of 500 (plus or minus roughly one by jitter).

So run a 16bit counter/storage to get so decent resolution.

I've included my PIC code in another reply to this posting so maybe you can
point out some NOVICE mistakes! Can anyone point me to some example code?

Excellent help from the list by the way, expecially the maths stuff in the
archives :-)

Pete

2000\06\07@024600 by Peter Betts

picon face
> If you can show us the program we might be able to point it out.

Here it is (hope is doesn't break the list etiquette)....
It works but it's a bit "wobbly"

;***************************************************************************
***
;                            PIC Hardware?
;***************************************************************************
***
; Use PIC16F84 and set radix system to decimal
       LIST P=16F84, R=DEC

;***************************************************************************
***
; Include header file
;***************************************************************************
***
#include "p16f84.inc"

;***************************************************************************
***
;                        Configuration Settings
;***************************************************************************
***
; Use XTAL clock, watch dog timer off and power up timer on.
       __config _XT_OSC & _WDT_OFF & _PWRTE_ON


;***************************************************************************
***
;                               equates
;***************************************************************************
***
; WORDS
count_in                equ     0x0c    ; Input Counter
count_out               equ     0x0d    ; Output Counter
new_output_counter      equ     0x0e    ; Next Output Counter Threshold
count_status            equ     0x0f    ; Status Condition of Counters
output_state            equ     0x10    ; State of the output pin

;BITS
trigger                 equ     0       ; Bit 0 of count_status
overflow                equ     1       ; Bit 1 of count_status

;GENERAL
frequency_input         equ     1       ; Bit RA1 of PortA

;***************************************************************************
***
;                            START of CODE
;***************************************************************************
***
       org     0x0                     ; reset vector
       goto    init                    ; jump over subroutines

       org     0x4                     ; Timer Interrupt Vector
       goto    timer_int               ; Goto this service routine

;***************************************************************************
***
;                              Subroutines
;***************************************************************************
***
toggle_output
       movlw   0x1
       xorwf   output_state,1          ; XOR output bit with 1 and store
back again
                                       ; This TOGGLES the state of the pin
from high to low.

       movf    new_output_counter,0    ; copy new_output_counter to 'w'
       movwf   count_out               ; Reset output counter
       goto    timer_int_end           ; Finished!

;---------------------------------------------------------------------------
---
no_toggle_output
       movlw   0x0
       movwf   output_state            ; Set output low.

       movlw   0x1                     ; else reload count_out with 1
       movwf   count_out
       goto    timer_int_end           ; Finished!

;---------------------------------------------------------------------------
---
remap_frequency
       nop                             ; Remap the input frequency value to
a new value
                                       ; Could just be a fixed ratio or..
                                       ; Use a look up table to scale it.
                                       ; Only (8bit) 256 counter values so
only 256 mapping points.
       goto    change_output_level

;***************************************************************************
***
;                       Interrupt Service Routine
;***************************************************************************
***
timer_int
       bcf     INTCON,T0IF             ; Clear pending interrupt flag

output_pulse                            ; Set output pin to correct state.
       movf    output_state,0          ; Load output_state into 'w'
       movwf   PORTB                   ; Output that bit

input_pulse                             ; "count_in = count_in + 1"
       incfsz  count_in,1              ; Increment input counter,
       goto    test_input_pin          ; If counter didn't wrap round to
zero, no_overflow

set_overflow                            ; count_in > 256 therefore a slow
input frequency
       bsf     count_status,overflow   ; Set OVERFLOW condition flag
       movlw   0x0
       movwf   new_output_counter

test_input_pin
       btfss   PORTA,frequency_input   ; Test input pin, high or low.
       goto    test_trigger            ; Is low so test if just triggered
from a high to low transition
       bsf     count_status,trigger    ; Input pin is high so set TRIGGER
condition flag and
       goto    change_output_level     ; then set next output pin state

test_trigger                            ; Test if trigger flag was set in
previous int'
       btfss   count_status,trigger    ; i.e. is a falling edge, high to
low.
       goto    change_output_level     ; If not then skip the rest and set
the condition of the next output pin state

       movlw   0x0                     ; Set 'w' to 0 incase overflow
condition is true
test_overflow                           ; Test if input counter overflowed
at any time when low or high
       btfss   count_status,overflow
       movf    count_in,0              ; No overflow so load count_in into
'w'
       movwf   new_output_counter      ; Load 'w' as the new output counter
threshold
       movlw   0x0
       movwf   count_in                ; Reset the input counter
       bcf     count_status,trigger    ; Reset the TRIGGER condition
       bcf     count_status,overflow   ; Reset the OVERFLOW condition, if
there was one!

remapping
       goto    remap_frequency

change_output_level
       decf    count_out,1             ; Decrement output counter,
"count_out = count_out - 1"
       btfss   STATUS,Z                ; Test ZERO flag is set
       goto    timer_int_end           ; count_out > 0

       movlw   0xffff
       andwf   new_output_counter,1
       btfss   STATUS,Z                ; Is new_output_counter = zero
       goto    toggle_output           ; if it isn't toggle_output
       goto    no_toggle_output

timer_int_end                           ; That's it!
       retfie                          ; Return from interrupt service
routine

;***************************************************************************
***
;                            initalisation
;***************************************************************************
***

init    clrf    PORTB                   ; set = 0
       bsf     STATUS,RP0              ; BANK1
       movlw   0ffh                    ; set porta as inputs
       movwf   TRISA
       movlw   00h                     ; set port b as outputs
       movwf   TRISB
       bcf     STATUS,RP0              ; BANK0

       movwf   count_in                ; Clear Input Counter
       movwf   count_out               ; Clear Output Counter
       movwf   new_output_counter      ; Clear Next Output Counter
Threshold
       movwf   count_status            ; Reset Counter Status
       movwf   output_state            ; Clear output pin state

       bsf     STATUS,RP0              ; BANK1
       movlw   0x0
       movwf   TMR0                    ; Reset Timer0
       movlw   b'10000011'             ; Prescaler of 1:16 (i.e. interrupt
every 3.9ms approx)
       movwf   OPTION_REG              ; Set Timer ON and use prescaler of
256
                                       ; (currently tunning from 5MHz XTAL)


;***************************************************************************
***
;                             main program
;***************************************************************************
***

main
       bcf     STATUS,RP0      ; BANK0
       bsf     INTCON,T0IE     ; Turn Timer Interrupts On
       bsf     INTCON,GIE      ; Turn Global Interrupts On

forever goto    forever

       end

'[PIC]: Operation of PICs from low voltage'
2000\06\07@024802 by William Chops Westfield

face picon face
A somewhat related question: Are the "low voltage" PICS generally similar to
the "high speed" parts?  Ie, identical execpt for testing?  That is, are the
chances pretty good that a standard 5V part will run at 3V or so?

BillW

'[PIC]: LCD Graphics Routines'
2000\06\07@065317 by Peter Betts

picon face
Having looked at Steve Lawther's web page on the T6963 LCD controller PIC
code I wondered if there was a web link anyone can give me that explains how
to generate graphics procedures. (Thanks to Steve, I'm about to try it out
on a 240*64 pixel Varitronix display)

Things like drawing circles, rotating line vectors say for creating a
virtual speedometer or rev counter?

With all the games code out there I'm sure there must be a concise web
location with mathematical methods/routines for doing quite complex graphic
front ends.

Oh... I realise Steve had some graphics routines in his PIC code but I'm
after maybe a more generic source of material explaining the most efficient
way to produce various graphical shapes and or vector/dot drawings

Anyone help?

Pete

2000\06\07@071019 by John Perkinton

flavicon
face
part 0 1002 bytes
-----Original Message-----
From: Peter Betts [@spam@peter.bettsspamspamNOKIA.COM]
Sent: 07 June 2000 10:49
To: TakeThisOuTPICLISTKILLspamspam@spam@MITVMA.MIT.EDU
Subject: [PIC]: LCD Graphics Routines


Having looked at Steve Lawther's web page on the T6963 LCD controller PIC
code I wondered if there was a web link anyone can give me that explains how
to generate graphics procedures. (Thanks to Steve, I'm about to try it out
on a 240*64 pixel Varitronix display)

Things like drawing circles, rotating line vectors say for creating a
virtual speedometer or rev counter?

With all the games code out there I'm sure there must be a concise web
location with mathematical methods/routines for doing quite complex graphic
front ends.

Oh... I realise Steve had some graphics routines in his PIC code but I'm
after maybe a more generic source of material explaining the most efficient
way to produce various graphical shapes and or vector/dot drawings

Anyone help?

Pete


Attachment converted: creation:t6963.zip (pZIP/pZIP) (0001626C)

2000\06\07@091914 by Octavio Nogueira

flavicon
face
I'm trying to do the same thing, but in C.
Currently I have just a line routine and it's
not finished yet. Please let me know is you
find anything.
Are you using the fuel injection pulse to measure
RPM and fuel?

Friendly Regards

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

{Original Message removed}

2000\06\07@094619 by Peter Betts

picon face
> Please let me know is you find anything.
I've searched the web but can't find a concise list of equations or methods
of 2D or even 3D drawings. Everything I find seems to relate to some form of
software CAD package which is no good.


> Are you using the fuel injection pulse to measure
> RPM and fuel?

Yes. I want to measure the duty cycle of the injector pulse and display this
as either a bar (like a VU meter) or a rotating dial like a rev counter.
Oh and also have the same for a rev counter.

I could go back to basics and translate the duty cycle into a rotation angle
and do some trigonometry but I don't want to do it the long winded way if
there are easier ways of doing this kind of thing.

Pete

'[PIC]: 'F87xx Config Programming'
2000\06\07@095656 by Heinz Czychun

flavicon
face
Thanks Tony,

       Not what I wanted to hear, but better that, than go too far down a
blind ally.

Heinz

At 3:04 PM 6/7/2000, Tony Nixon wrote:
{Quote hidden}

       Wow, alot of changes to ROMzap since January.

       The 'F872 doesn't have a hardware async port. Will ROMzap still
program the config register of this PIC? And what connections are needed to
the PIC ?


{Quote hidden}

'[PIC]: LCD Graphics Routines'
2000\06\07@110726 by Sergio Masci

flavicon
picon face
{Quote hidden}

The simplest way to do this (also turns out to be the most efficent in
terms of processing power) is to have a list of all the points on your
gage that will be effected by whatever it is you are trying to messure.
Say you have a range between 0 and 99, divide your list into 100
sections. Section 0 contains all the points that will be in the on state
at value 0, section 1 contains all the points that will be in the on
state at value 0 and 1, section 2 contains all the points that will be
in th on state at value 0 and 1 and 2. Now when your value moves from 0
to 5 you set all the pixels on that belong to section 5 when the value
moves down (from 5) to 3 you set all the pixels off that belong to
sections 5 and not section 3. when the value again goes up to 6 (from 3)
you set all the pixels on that belong to section 6 and not section 3.

If the range is 0 to 99 but the steps between each division are too big,
multiply the range so that the steps become smaller (keep 100 divisions
just increase the resolution).

If the list of pixels is kept ordered (section 0, section 1, section 2
etc) then you can superimpose each section onto a common list and have
pointers to the sections in the common list. With a little creative
pointer aritmetic you end up with a list of points that must be turned
on or off and an incredibly tight and efficient loop.

This method allows you to have both a needle and flood fill gage with
superimposed divisions, numbers etc.

e.g.


                  |   |   <- section 4   --|       GOING UP
                  |   |                    |
                  |   |                    |-- All pixels that must
              |       |   <- section 3     |   be turned on when value
              |       |                    |   moves from 2 to 4
              |       |                    |
          |           |   <- section 2   --|
          |           |
          |           |
      |               |   <- section 1
      |               |
      |               |
  |                   |   <- section 0


                      ^
                      |
                      common list of pixels





                  |   |   <- section 4   --|       GOING DOWN
                  |   |                    |
                  |   |                    |-- All pixels that must
              |       |   <- section 3   --|   be turned off when value
              |       |                        moves from 4 to 3
              |       |
          |           |   <- section 2
          |           |
          |           |
      |               |   <- section 1
      |               |
      |               |
  |                   |   <- section 0


                      ^
                      |
                      common list of pixels


This isn't taken from a game but a commercial product called XEBOT.
This is the internal mechanism it uses to update user defined gages.
The user describes a gage using two curves and XEBOT does the rest.
Sorry XEBOT wont run on a PIC.

Sergio Masci
Sentient Real Time Systems Ltd
http://www.xcprod.com/titan

'[PIC]: tmr0 delays in CC5X c'
2000\06\07@110729 by Andy Kelley N1YEW

picon face
Hi,

Can anyone provide me with source for a timer (using TMR0) in cc5x c?  I want to be able to use interrupt for this.  I want to run a routine every 10 minutes if a certain bit in ram is not low.

thanks,
Andy K.
Amateur Radio Callsign: N1YEW

'[PIC]: Operation of PICs from low voltage'
2000\06\07@111937 by Bob Blick

face
flavicon
face
Only experience I've had is running a PIC16F84 on two alkaline C cells at
4 MHz. Ran fine down to 2.6 or 2.7 volts, whereupon it had trouble
starting the oscillator, but I didn't spend any time tweaking the
oscillator, because by that time the batteries were low enough that the
rest of the circuit wanted fresh batteries(not pic-related).

This was crystal controlled, likely RC oscillator will run at lower
voltages with no tweaking just like your experience showed.

Also it was not the low-voltage part, don't know if there's any real
difference in silicon.

For those interested, it was a radio-controlled remote "talkback" switch
that generated MIDI for a Yamaha O2R mixer. I used a wireless doorbell and
disabled the boinger. Put a 16F84 in the receiver to generate MIDI note-on
and note-off(the Yamaha mixer accepted all sorts of commands through MIDI
and talkback was one of them). Then the "producer" got to hold the
doorbell button and could push it whenever he wanted to talk to the
"talent", saving him from having to ask the engineer to push the talkback
button on the mixer. heh. Birthday gift for my nephew the engineer.

-Bob

2000\06\07@121455 by stouchton

flavicon
face
At the old company, we were running PIC's @ 2V and below before anything was
spec'd that low.  The xtal oscillators were very finnicky(?), but the RC
would always get up and fly (pretty much it has too by design).  We did see
RAM problems when the processor was cold (<32F).  Basically, bits flipped on
their own accord.

Processors we were using were the C54, L84, and the LF84.  Had success with
all of these (>85% yield).  LV parts are what is standardized on now, 100%
yield.

LP oscillator leaves alot to be desired at 5 volts in term of startup,
wouldn't even try it at 2 volts!!!

Most parts listed above would fly down to 1.8V, but I would be nervous about
the bit flipping issue.

'[PIC]: Writing 16F84 EEPROM'
2000\06\07@195135 by Sebastian Garcia

flavicon
face
Hi TakeThisOuTlu01tsspamspam_OUTGMX.NET ,

I suggest the following:

(assuming You're in bank0)

    movlw   0x00
    movwf   EEDATA
    movwf   EEADR

This is why your code don't work, when You did it was in bank1.

|        bsf     STATUS,RP0


    bcf INTCON,GIE    ;to disable interrupts meanwhile the write is in
process

|        bsf     EECON1,WREN
|        movlw   0x55
|        movwf   EECON2
|        movlw   0xAA
|        movwf   EECON2
|        bsf     EECON1,WR

    bsf INTCON,GIE;         ;to enable the interrupts.



Remember that the write time is aprox. 10 ms.

Best Regards,

S.-

'[PIC]: 'F87xx Config Programming'
2000\06\07@195349 by Tony Nixon

flavicon
picon face
Heinz Czychun wrote:

>         Wow, alot of changes to ROMzap since January.

Updated again today.

>         The 'F872 doesn't have a hardware async port. Will ROMzap still
> program the config register of this PIC? And what connections are needed to
> the PIC ?

I didn't even know the 872 existed. I will try to add bit banging
support for it and also for the F870/1 chips.

--
Best regards

Tony

http://www.picnpoke.com
RemoveMEsalesspamspamSTOPspampicnpoke.com

'[PIC]: Operation of PICs from low voltage'
2000\06\08@034239 by JP.BROWN

flavicon
face
One surprising experience I had was to find that the 16F84 would run
happily with a supply voltage of zero volts!, yes thats right zero volts,
on further inspection of the circuit I found that the 16F84 was leaching a
supply from the I/O pins (the external circuit was independently supplied)
Even though I have had years of experience with other microcontrollers the
PIC chip still surprises me with it's flexibility, robustness and other
unexpected qualities (I am amazed to hear that it will run down at 1V).

On Wed, 7 Jun 2000, Bob Blick wrote:

{Quote hidden}

         -----  John P. Brown      .....J.P.BrownEraseMEspambradford.ac.uk ----
          \            --- Witty remark goes here ---         /
           --------------------------------------------------

2000\06\08@040023 by James Wilson

flavicon
face
Of course it's not the IO input circiut leaking - it's the pair of static
protection diodes. One conducts from 0V to IO pin, the other from IO pin to
Vcc. These diodes can be used for other things like putting mains directly
into a PIC simply by current limiting. You can tie 240VAC (UK) into a pic
that's battery powered. Tie Neutral to 0V and LIVE to IO pin  via a 10M
resistor. This can be used to synchronise the PIC with the phase of the AC
and to derive an accurate 50Hz time base (very accurate over a period, less
so over short times). The 10M resistor limits the current and the static
prtection diodes leak the small current through to the battery. First time
you rig it up take a deep breath before switching on!

| -----Original Message-----
| From: JP.BROWN [spamBeGoneJ.P.BrownspamRemoveMEBRADFORD.AC.UK]
| Sent: 08 June 2000 08:48
| To: .....PICLISTEraseMEspamMITVMA.MIT.EDU
| Subject: Re: [PIC]: Operation of PICs from low voltage

| on further inspection of the circuit I found that the 16F84
| was leaching a
| supply from the I/O pins (the external circuit was
| independently supplied)

2000\06\08@040621 by Mike Witherden

flavicon
face
Yup I had one running with no supply as well. I was watching
what happened to the output on a scope when I removed the battery
supply. The signal just kept on going! (way off freq and greatly
attenuated) but still measurable.

MikeW

>>> spamJ.P.Brownspam_OUTspam@spam@BRADFORD.AC.UK 06/08/00 09:47AM >>>
One surprising experience I had was to find that the 16F84 would run
happily with a supply voltage of zero volts!, yes thats right zero volts,
on further inspection of the circuit I found that the 16F84 was leaching a
supply from the I/O pins (the external circuit was independently supplied)
Even though I have had years of experience with other microcontrollers the
PIC chip still surprises me with it's flexibility, robustness and other
unexpected qualities (I am amazed to hear that it will run down at 1V).

'[PIC]: 32bit binary to ASCII conversion'
2000\06\08@064801 by Henrik Holmgrd

flavicon
face
Hi all
I have a project where I have to convert a 32 bit binary or hex number to
ASCII to be displayed on a LCD. Does some one on this list have done this
before, if so are you willing to share the solution with me or give me some
hints. I have done decimal to ASCII conversion no problem, but now my
project end up with a 32 bit number and then I have only very complicated
solutions.

tnx in advance.

                   \||||||/
_____oo0o__( o o )__o0oo_____
                     (_)

    Henrik HolmgŒrd

2000\06\08@073145 by John Perkinton

flavicon
face
I remember having to so this for integrating an ip address to a pic chip.
look for a project on the net called the worlds smallest web server. it uses
a seiko s7600a to connect a 16f84 to the internet. I'm sure it has some good
example code for dealing with 32bit addresses. if i remember right. I will
try to find the stuff I did myself and post it up soon.

{Original Message removed}

2000\06\08@084956 by Octavio Nogueira

flavicon
face
If you want the routine in C here it is:
/*--------------------------------------------*/
/* d - number to display                      */
/* dig - number of digits                     */
/* dec - decimal point position               */
/*--------------------------------------------*/
void print(unsigned long d, char dig, char dec)
{
unsigned long n;
char i,j;

n=1;
for(i=dig;i!=1;i--) n*=10;

while(n!=1)
{
 if(d>=n)
 {
  j=(d/n) % n;
  putch(j+0x30);
  d-=j*n;
 }
 else
  putch('0');
 n/=10;
 if(--dig==dec) putch(',');
}
putch((d % 10)+0x30);

}


Friendly Regards

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

{Original Message removed}

'[PIC]: Richard Beales' Web Server / DS1820 / I2C R'
2000\06\08@092518 by Jeff Frohwein

flavicon
face
Link to a PIC web server using 16F84 and a SLIP connection.
Schematics & C source code is available.

Also temperature reading and I2C C code for the 16F877.

http://www.devrs.com  (Look under NEWS or PIC/SCENIX.)

Jeff

'[PIC]: 32bit binary to ASCII conversion'
2000\06\08@103330 by Thomas McGahee

flavicon
face
Henrik,

You have to convert the 32 bit binary number to a decimal
form and then convert the decimal form to ascii by adding
30h to each decimal digit.

I will run through the example for an 8 bit binary conversion
just to show you the principles involved. Using pseudo-code:

bin_to_dec:
 ;assume that upon entry 8 bit number is in bin_holder.
 ;assume that decimal result will be placed in dec3, dec2, dec1
 ;where dec3 is most significant decimal digit.
 ;uses temp holder <decnum>.
 ;upon exit bin_holder will be trashed.
 CLEAR dec1 ;clear all decimal holders to zero.
 CLEAR dec2
 CLEAR dec3
 ROTATE bin_holder RIGHT INTO CARRY ;bit0 <1> handled first...
 IF CARRY=1
   SET decnum=1
   CALL ADD_ONES
 ENDIF
 ROTATE bin_holder RIGHT INTO CARRY ;bit1 <2> handled next...
 IF CARRY=1
   SET decnum=2
   CALL ADD_ONES
 ENDIF
 ROTATE bin_holder RIGHT INTO CARRY ;bit2 <4> handled next...
 IF CARRY=1
   SET decnum=4
   CALL ADD_ONES
 ENDIF
 ROTATE bin_holder RIGHT INTO CARRY ;bit3 <8> handled next...
 IF CARRY=1
   SET decnum=8
   CALL ADD_ONES
 ENDIF
 ROTATE bin_holder RIGHT INTO CARRY ;bit4 <16> handled next...
 IF CARRY=1
   SET decnum=1
   CALL ADD_TENS
   SET decnum=6
   CALL ADD_ONES
 ENDIF
 ROTATE bin_holder RIGHT INTO CARRY ;bit5 <32> handled next...
 IF CARRY=1
   SET decnum=3
   CALL ADD_TENS
   SET decnum=2
   CALL ADD_ONES
 ENDIF
 ROTATE bin_holder RIGHT INTO CARRY ;bit6 <64>
 IF CARRY=1
   SET decnum=6
   CALL ADD_TENS
   SET decnum=4
   CALL ADD_ONES
 ENDIF
 ROTATE bin_holder RIGHT INTO CARRY ;bit7 <128>
 IF CARRY=1
   SET decnum=1
   CALL ADD_HUNDREDS
   SET decnum=2
   CALL ADD_TENS
   SET decnum=8
   CALL ADD_ONES
 ENDIF
 RETURN

ADD_ONES:
 ADD decnum to dec1
 IF dec1 > 9
  SUBTRACT 10d from dec1
  GOTO ADD_TENS
 ENDIF
 RETURN

ADD_TENS:
 ADD decnum to dec2
 IF dec2 > 9
  SUBTRACT 10d from dec2
  GOTO ADD_HUNDREDS
 ENDIF
 RETURN

ADD_HUNDREDS:
 ADD decnum to dec3
 IF dec3 > 9
  SUBTRACT 10d from dec3
  GOTO ADD_TENS
 ENDIF
 RETURN

*** END OF PROGRAM ***

There are many ways to improve upon this code, but
this code fragment should give you an idea of what the
basic algorithm is like. For a full 32 bit implementation
you would need ADD routines for thousands, tens_thousands,
hundreds_thousands, millions, all the way up to
thousand_millions (billions to some of us).

That means 32 code segments to handle the 32 bits, and
10 decimal ADD routines.

Note that any decimal carry required is handled by the
GOTOs. This method is easy to understand, but in reality it
would be more efficient to implement the decimal additions
using indirect addressing via the FSR. That cuts the code
SIZE down a lot.

Note that the decimal ADD routines can also be used by
other parts of your program

Fr. Tom McGahee

{Original Message removed}

2000\06\08@121317 by jamesnewton

face picon face
www.piclist.com/../microchip/math/radix

---
James Newton (PICList Admin #3)
spamBeGonejamesnewtonspamBeGonespam@spam@piclist.com 1-619-652-0593
PIC/PICList FAQ: http://www.piclist.com or .org


{Original Message removed}

'[PIC]: Silicon af PIC's'
2000\06\08@125546 by Jilles Oldenbeuving

flavicon
face
Today, at work a PIC16C558 JW blew up. That gave me the chance to take it
apart
(the ceramic that is) and put the silicon under a microscope. The microscope
showed
nice pictures of the silicon. I think i could see the program memory (not
sure about this)
becouse there was a 'smooth' area (when viewed with the naked eye) that
consisted
of 14 rows (instruction width = 14 bits)...

I also noticed the microchip logo between 2 bonding pads! It constisted of
the cicle-with-the-M-cut-out-of-it (tm). Also, under the logo where 4 lines
of
alphanumeric characters. My best guess is that it is the silicon rev number
and some other things. Does anybody know what the 4 lines below the logo
mean?


Regards,

Jilles Oldenbeuving
RemoveMEjillesRemoveMEspamRemoveMErendo.dekooi.nl

'[PIC]: Operation of PICs from low voltage'
2000\06\08@131118 by Jilles Oldenbeuving

flavicon
face
>First time
>you rig it up take a deep breath before switching on!


Where i work they let pic's run off 220V AC, trough a couple of
resistors and an X2-type capacitor, or capacitive power supply.

Jilles

2000\06\08@131732 by Andrew Kunz

flavicon
face
Any relation of this one with your previous note about blowing up the JW part?

Andy










Jilles Oldenbeuving <jillesKILLspamspamspamRENDO.DEKOOI.NL> on 06/08/2000 01:12:25 PM

Please respond to pic microcontroller discussion list <spam_OUTPICLIST@spam@spamMITVMA.MIT.EDU>








To:      TakeThisOuTPICLISTspam_OUTspamMITVMA.MIT.EDU

cc:      (bcc: Andrew Kunz/TDI_NOTES)



Subject: Re: [PIC]: Operation of PICs from low voltage








>First time
>you rig it up take a deep breath before switching on!


Where i work they let pic's run off 220V AC, trough a couple of
resistors and an X2-type capacitor, or capacitive power supply.

Jilles

'[PIC]: Silicon af PIC's'
2000\06\08@131735 by Tim Hamel

picon face
Howdy,

I'm not sure what the 4 lines are, but I do know that Microchip isn't the
first company to do this Silicon Art. This is awesome:

http://micro.magnet.fsu.edu/micro/gallery/chips/chipshots.html

Regards,

Tim Hamel

In a message dated 6/8/00 9:56:17 AM Pacific Daylight Time,
KILLspamjilles.....spamTakeThisOuTRENDO.DEKOOI.NL writes:

> Today, at work a PIC16C558 JW blew up. That gave me the chance to take it
>  apart
>  (the ceramic that is) and put the silicon under a microscope. The
microscope
{Quote hidden}

2000\06\08@171948 by Kris Wilk

flavicon
face
<x-flowed>At 01:15 PM 6/8/00, you wrote:
>Howdy,
>
>I'm not sure what the 4 lines are, but I do know that Microchip isn't the
>first company to do this Silicon Art. This is awesome:
>
>http://micro.magnet.fsu.edu/micro/gallery/chips/chipshots.html

The link above isn't the best part of that web site. The REAL silicon art
is in the section called "Silicon Zoo" at:

http://micro.magnet.fsu.edu/creatures/index.html

Personally I like the piece titled "More Buffalo Chips", midway down the
page. Very clever!

Kris

</x-flowed>

'[PIC]: Silicon af PIC's [OT]'
2000\06\09@044212 by Alan B. Pearce

face picon face
To see other creatures that manufacturers have put on chips, go to the "Silicon Zoo" at
http://www.microscopy.fsu.edu/creatures/index.html

'[PIC]: 32bit binary to ASCII conversion'
2000\06\09@080911 by Bob Ammerman

picon face
There is a simple trick, outlined in the following pseudo-code for doing
this conversion:


ANSWER - an ascii decimal number - 10 digits
SOURCE - a 32-bit binary number

ANSWER <- '000000000'

for I = 1 to 32
   ANSWER = ANSWER + ANSWER
   if high bit of SOURCE is set then
       ANSWER = ANSWER + 1
   end if

   SOURCE = SOURCE + SOURCE
next i

Note that the arithmetic on 'ANSWER' is done directly on the ASCII
representation.
For example, to compute ANSWER + ANSWER:

carry = 0
for digit = 0 to 9
   temp = ANSWER[digit]+ANSWER[digit]+carry-'0'
   carry = 0
   if (temp > '9') then
      temp = temp - 10
      carry = 1
   end if
   ANSWER[digit] = ANSWER[digit]+ANSWER[diit
next digit

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

'[PIC]: XTAL startup issues on PIC 73B'
2000\06\09@083259 by D. Schouten

picon face
Hi All,

In one of my applications I'm using a PIC16C73B 20MHz part
running at 18,432MHz. The xtal is connected the standard way
i.e. with two 33pF caps (loadcapacitance spec of xtal is 32pF)
to ground and layout wise everything as close as possible to
the PIC chip.

The problem is that from the 1000 boards I test, about 25 aren't
running at all. Replacing the xtal usually solves this problem.
Sometimes the board works well in the pretesting phase, but fails
at the final test. Current xtal brand is TXC, but we've had similar
problems with other brands too.

My question is, is this 2.5% failure rate normal, or is something
wrong with my application?

Is the PIC16C73B sensitive in HS mode, or do I have to add small
series
resistance with the xtal, or large parallel resistance?

The application which has his problem is quite price sensitive, so
there isn't any room for varicaps or other tweaking stuff.

Thanks for any help.

Daniel...

2000\06\09@084751 by Jim P

flavicon
face
Daniel -

Short of fully characterizing a crystal that works against a
crystal that doesn't work in a crystal text fixture using
appropriate test equipment -

Does a change to the parallel cap values have any effect
in getting a bad crystal to work?

Can you change just one of the parallel caps and get
the crystal to work?

By now you should have a pile of 'bad' parts - when a
difference that 'cures' the problem is found - try several
different bad xtals. I have used small machine pin sockets
with xtals successfully in the past to 'socket' xtals.

These are the kind of 'general' things I would try in order
to 'see' what works then go from there ...

Jim P


{Original Message removed}

2000\06\09@090248 by Andrew Kunz

flavicon
face
I've heard there are many reports on the '73B (and '77 and F87x) having problems
starting up crystals.

We have had to go to HS mode even with 4.000 MHz crystals.

Haven't had problems on my products with ceramic resonators, though.

Andy

'[PIC]: 'F87xx Config Programming'
2000\06\09@091326 by pandersn

flavicon
face
Tony....

I am using the 16F873 and program the config fully with my MPLAB software
and the PICSTART  PLUS. In *.inc file contains all the names of the various
config bits. I found that the low voltage name in the inc file is LVE
(rather than that listed which I don't recall...LVF, LVP?). Seems to work
fine. I haven't looked at the 872? but if it is like the 873, remember to
turn off the A/D converter since it is set ON at POR unless configured OFF.
Also, turn LVE OFF.

Hope that helps.

Phil.

On Wednesday, June 07, 2000 12:05 AM, Tony Nixon
[SMTP:spam_OUTTony.NixonRemoveMEspam.....ENG.MONASH.EDU.AU] wrote:
> Heinz Czychun wrote:
> >
> > Hi All,
> >
> >         Now that I've gotten one of the new Flash PIC chips (16F872), I
> > wanted to program it. As indicated by an email by Jim Robertson, my
WARP-3
> > and MacPic will program the 'F872, by selecting the 'F84 as the chip to
be
> > programmed. But it cannot program all the bits in the config register,
and
> > I would like to put it into HVP mode to liberate RB3. So I looked at
Tony
{Quote hidden}

'[PIC]:'
2000\06\09@091503 by Jilles Oldenbeuving

flavicon
face
Hi Piclisters,

I'd like to know if someone on this list has ever done something with
serielizeing their productions. I have to give a PIC16F83 a
serialnumber/unique adress
at program time. Does anybody know how i can do this?



Regards,

Jilles Oldenbeuving
spamjillesspam_OUTspamrendo.dekooi.nl

'[PIC]: Frequency Scaling - remapping'
2000\06\09@091714 by pandersn

flavicon
face
Right. Say xtal running at 4 Mhz. Then your instruction or "clock" rate
will be 1 Mhz. Timer2 will count once each instruction cycle. Setting a
timer2 at 250 will give you then a 4 kHz rate. Turn off the pre-scalar and
post-scalar, just set 250 in timer2 reg. Enable interrupts for timer2 of
course. Then process your flags at the capture input during each timer2
interrupt - this gives you a constant sampling rate.

You are sampling an event (a flag), so you do NOT have to sample at > twice
the freq content of the input signal (sampling theorem), that is for audio,
not freq measuring!.

Hope that helps. Hey, download (adobe) the Embedded  Micro Book from
Microchip's web site. It does a reasonable job of explaining all of the
peripherals, including the timers.

Phil Anderson....have a good day! Go kick a Tae Kwon Do bag!


On Wednesday, June 07, 2000 1:39 AM, Peter Betts
[SMTP:STOPspampeter.bettsspam_OUTspamspamBeGoneNOKIA.COM] wrote:
{Quote hidden}

overflow
> would occur, I've been assuming it was always on 255->256 count! Hows
that
{Quote hidden}

can
> point out some NOVICE mistakes! Can anyone point me to some example code?
>
> Excellent help from the list by the way, expecially the maths stuff in
the
> archives :-)
>
> Pete

'[PIC]: XTAL startup issues on PIC 73B'
2000\06\09@092745 by stouchton

flavicon
face
Primarily, all crystals are different, and all oscillator circuits are
different.  If these differences line up the wrong way, no oscillation.
Most manufacturers of oscillator circuits never fully characterize its
parameters at wafer level, and unknown variances go into the marketplace. I
went around and around with Microchip on this one several years ago, and
could not find one engineer that could state exactly what the crystal
specifications are.  They primarily spec'd load capacitance, but this is
only a small part of the crystal spec.  Equally important is the loss of the
crystal (Rs).

Here is a trick that worked for me with RF Microdevices:   Contact the
crystal manufacturers and let them know what you are up to.  After
contacting about 10 of them, I lucked onto the people that supplied the
original spec to RFMD for their design spec (Bomar Crystal).  you might get
lucky too.



ALSO:   Power supply is critical for xtal startup / run.  Make sure your DC
is reaaaaal good.  Make sure you have a GOOD decoupling cap, and limit lead
length.  (High quality ceramic, short heavy leads, avoid 90 degree bends).
Harmonics running around on the supply seem to really effect the PIC's
oscillator circuit.


My bet is that the Rs spec on your xtal is marginal.  If you have a network
analyzer (or spectrum analyzer, or scope and sig gen) you can compare good
to bad xtals and determine what spec is pushing the limit.  I would first
primarily focus on the loss through the xtal.

{Original Message removed}

'[PIC]: programming serial numbers'
2000\06\09@095225 by Martin Hill

picon face
I believe the new version of the EPIC programmer software will do
this.  Free downloads are available for users who have an older
version.  I'm still using the older version as I don't need this feature
currently.

Martin

{Quote hidden}

'[PIC]: Serializing'
2000\06\09@100220 by Jilles Oldenbeuving

flavicon
face
>> Hi Piclisters,
>>
>> I'd like to know if someone on this list has ever done something with
>> serielizeing their productions. I have to give a PIC16F83 a
>> serialnumber/unique adress
>> at program time. Does anybody know how i can do this?
>
>
>MPLAB supports  serialization via the SQTP feature. Look under the PROMATE
>menu.


Okay, i will check it out. But what if i use the ICD-Debugger's ICSP
capability?

Thnx.


Regards,
Jilles

'[EE]: [PIC]: In-Circuit programming'
2000\06\09@103343 by riest

flavicon
face
Hai,

I'm currently creating a ISA board with a PIC18x442 on top of it.
This isa board will do some IO to other chips (AD converters, DA
motor controller, counters and digital IO lines) Host system is build
around Windows NT 4.0. That's for my setup.

I want to enable in-circuit programming so I can update the
firmware of the PIC without opening the computer and replacing the
pic's.

My questions are:
1) Do I really only need Vpp, Vss, pData and pClock?
2) Where can I find an example schematic?
3) What's the data structure to send to the PIC?

Happy pic programming
Ries

(see subject line) Can I make double tags?

'[PIC]: XTAL startup issues on PIC 73B'
2000\06\09@110726 by Don B. Roadman

flavicon
face
On 9 Jun 2000, at 14:29, D. Schouten wrote:

> n one of my applications I'm using a PIC16C73B 20MHz part
> running at 18,432MHz. The xtal is connected the standard way
> i.e. with two 33pF caps (loadcapacitance spec of xtal is 32pF)
> to ground and layout wise everything as close as possible to
> the PIC chip.
>
> The problem is that from the 1000 boards I test, about 25 aren't
> running at all. Replacing the xtal usually solves this problem.
> Sometimes the board works well in the pretesting phase, but fails at
> the final test. Current xtal brand is TXC, but we've had similar
> problems with other brands too.

I'm posting this reluctantly because it is not a solution. Some
others had some good Ideas, and I thought I'd submit this little
piece of info for what its worth. I was playing with some 16F84s. I
had a 10 Mhz part that I bought back in 98, I believe, and had been
using it with some 8.7Mhz crystals that came in a grab bag from
Dan's. I tried a bunch of them and they all worked fine with this 10
Mhz pic. About a month ago, I yanked this pic to use temporarily
untill some new ones came.  The vendor screwed up and sent 4
Mhz parts, and I tried them anyway using the 8.7M crystals. None
of them worked and I tried several crystals, so I figured that pics
arent capable of much overclocking. They did work with some 4.7
Mhz crystals.

Just recently, I got very bored and hooked up a 10 Mhz crystal to
one of these 4 Mhz pics, and it ran fine with a simple little led
flashing program. I was amazed, so I stuck a 20 mhz crystal on,
and it still worked! I tried several of both 10 and 20 Mhz crystals
and it always worked. Also tried 3 or 4 of the pics, and always, it
worked. I didnt have any higher freq. crystals to try, so I still dont
know where these chipc would crap out. I didn't have the presence
of mind to examine the oscillator ouput with a hi impedance probe,
so I dont know if the osc wasnt running or the chip crapped out.
Now I suspect the oscillator didnt start. I  surmise that there are
some crystals that some pics just don't like, but I don't know why,
and I guess I never will short of doing fully instrumented detective
work.

I posted a querry looking for test programs that are designed to
wring out a pic and put it through its paces to see if it is a good
part as far as possible, but I still havent found anything done just
as a thorough chip test program. I've only played with the '877 parts
a llittle, so I am interested in this thread and its eventual outcome.

'[PIC]: programming serial numbers'
2000\06\09@110919 by Don B. Roadman

flavicon
face
>  I have to give a PIC16F83 a
> > serialnumber/unique adress at program time. Does anybody know how i
> > can do this?

FWIW, the propic programming software is supposed to do this,
and there are probably lots of others.

'[PIC]: Spep & Windows'
2000\06\09@113227 by weslay

flavicon
face
Hello
How I can run Spep under windows ?

Thank

Jacky

'[PIC]: XTAL startup issues on PIC 73B'
2000\06\09@113435 by JP.BROWN

flavicon
face
Closely related to this problem, I had trouble with unreliable start up
some time ago using the 16C61 chip (running at 20MHz), I built a number of
these circuits and they where all a bit iffy on start up. If I started to
probe around the reset pin the circuits would spring to life, I cured the
problem by using the reset circuit in the PIC data book (the one with 2 Rs
a cap and a diode) after this I had no problems at all with start up.
(before I had been using a simple pull up R and PWRTE enabled)

On Fri, 9 Jun 2000, Don B. Roadman wrote:

{Quote hidden}

         -----  John P. Brown      EraseMEJ.P.BrownspamKILLspambradford.ac.uk ----
          \            --- Witty remark goes here ---         /
           --------------------------------------------------

2000\06\09@125807 by Harold M Hallikainen

picon face
       I also went round and round trying to get resonators that were
guaranteed to work on a 16c74 at 16 MHz. I finally found muRata
characterizes their resonators for specific chips and frequencies (see
http://www.murata.co.jp/search/ic-e.html). Microchip could not give me
characteristics on the oscillator (gain and phase versus frequency plot),
and the resonator companies generally could not do anything without that.
One resonator company told me the resonator was fine if it worked in
their test circuit (CMOS gate with feedback resistor). The fact that they
could not supply a resonator (with internal capacitors) that worked in MY
circuit (a 16c74 with the resonator hung between two pins, center pin of
the resonator grounded) lost them a sale for a few thousand resonators.
       Another issue I noticed was on one board I thought I'd "improve" it by
increasing the width of the very short traces from the 16c74 pins to the
resonator from 12 mils to 25 mils. Worked fine... 'til Microchip came out
with the 16c74b. Would not oscillate. We had to continue to use the
16c74a on that board. All my other "unimproved" boards worked fine with
the 16c74b...
       So, a corollary to Murphy's law (this one from the broadcast industry)
is that amplifiers will oscillate, and oscillators won't.

Harold



FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
dl.http://www.juno.com/get/tagj.

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...