Searching \ for 'Driving' 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/index.htm?key=driving
Search entire site for: 'Driving'.

No exact or substring matches. trying for part
PICList Thread
'PIC driving triac'
1994\12\08@045559 by crocontroller discussion list

flavicon
face
I was at a PIC seminar in Edinburgh recently and I met one of the
Microchip Applications Engineers who said he was using a PIC to drive a
triac. The interesting bit was that he had one of the PIC input pins
connected to 240v a.c. via a 1M resistor to do the zero crossing
detection. Because PICs have clamp diodes on the inputs, with the
addition of a (very large) current limiting resistor this doesn't result
in the top being blown off the chip, instead giving a fairly good logic
level input that can be read by the port. Of course you have to be
fairly careful where you stick your fingers during prototyping :-)
Thought you lot might find this interesting.
                                               -Alasdair

[ The opinions expressed are my own and are therefore undeniably correct ]
[ beyond a shadow of a doubt.                                            ]

Alasdair MacLean, University of Edinburgh, Dept. of Artificial
Intelligence, 5 Forrest Hill, Edinburgh, EH1 2QL
tel. (+44) 0131 650 4497        fax. 0131-650-6899
email spam_OUTalasdairTakeThisOuTspamaifh.ed.ac.uk
http://www.dai.ed.ac.uk:80/staff/personal_pages/alasdair

1994\12\08@045559 by crocontroller discussion list

flavicon
face
I was at a PIC seminar in Edinburgh recently and I met one of the
Microchip Applications Engineers who said he was using a PIC to drive a
triac. The interesting bit was that he had one of the PIC input pins
connected to 240v a.c. via a 1M resistor to do the zero crossing
detection. Because PICs have clamp diodes on the inputs, with the
addition of a (very large) current limiting resistor this doesn't result
in the top being blown off the chip, instead giving a fairly good logic
level input that can be read by the port. Of course you have to be
fairly careful where you stick your fingers during prototyping :-)
Thought you lot might find this interesting.
                                               -Alasdair

[ The opinions expressed are my own and are therefore undeniably correct ]
[ beyond a shadow of a doubt.                                            ]

Alasdair MacLean, University of Edinburgh, Dept. of Artificial
Intelligence, 5 Forrest Hill, Edinburgh, EH1 2QL
tel. (+44) 0131 650 4497        fax. 0131-650-6899
email .....alasdairKILLspamspam@spam@aifh.ed.ac.uk
http://www.dai.ed.ac.uk:80/staff/personal_pages/alasdair


'LCD driving (an563)'
1995\07\06@014305 by Conny Andersson
picon face
Kalle wrote about driving LCD:s directly from a PIC and maybe connect some
capacitors in series with each segment.

The problem is that all segments act as capacitors itself (more or less) so
I guess that won't fix the problem.
You have to work with the LCD spec. instead and set all the nescessary voltagess
with the IO-ports. I recently built a RPM counter with a multiplexed display
(7x6 segments) and I couldnn't get it to work according to how you usually
drive LCD:s, probably because you cannnot easily set up all the nescessary
voltages.
However, I fixed the problem by connecting resistors (470k) in series with each
segment and then connect all resistors to half the operating voltage of the
circuit. Then I used the tristate option along with low and high to obtain
voltages such as -5,-2.5,0,2.5,5 volts.

Hope this helps,
-----------------------
Conny Andersson, LiTH

'Driving sensitive gate triacs directly'
1995\07\28@090937 by Harrison Cooper

flavicon
face
There was some discussion on interfacing with a SSR, but I don't remember
reading how it turned out.

How about this one - since the output current is quite hefty from a PIC
(40 mA if I remember right), can you drive a sensitive gate triac directly ?
Data sheet for a MAC228A would indicate 5mA trigger with a 15mA hold.
Anyone done this before ?  Normally, I use a optocoupler but it would be
nice to eliminate another part.

hcooperspamKILLspames.com

1995\07\28@094156 by Reg Neale
flavicon
face
On Jul 28,  7:09am, Harrison Cooper wrote:
|Subject: Driving sensitive gate triacs directly
| There was some discussion on interfacing with a SSR, but I don't remember
| reading how it turned out.
|
| How about this one - since the output current is quite hefty from a PIC
| (40 mA if I remember right), can you drive a sensitive gate triac directly ?
| Data sheet for a MAC228A would indicate 5mA trigger with a 15mA hold.
| Anyone done this before ?  Normally, I use a optocoupler but it would be
| nice to eliminate another part.
|
| .....hcooperKILLspamspam.....es.com
|-- End of excerpt from Harrison Cooper

Depends on how vulnerable you are to getting fried. One of the functions
of SSR's is isolation from the line. Sure, you can do what you suggested,
but be aware that your PIC and whatever circuitry is attached will be
connected to potentially lethal power source.


*Reg Neale=EraseMEnealespam_OUTspamTakeThisOuTee.rochester.edu ....standard disclaimer applies...*
*..."Ignorance is a renewable resource."....P.J. O'Rourke............*

1995\07\28@102224 by Kevin P. Fleming

picon face
At 07:09 AM 7/28/95 -0600, Harrison Cooper wrote:
>There was some discussion on interfacing with a SSR, but I don't remember
>reading how it turned out.
>
>How about this one - since the output current is quite hefty from a PIC
>(40 mA if I remember right), can you drive a sensitive gate triac directly ?
>Data sheet for a MAC228A would indicate 5mA trigger with a 15mA hold.
>Anyone done this before ?  Normally, I use a optocoupler but it would be
>nice to eliminate another part.
>
>hcooperspamspam_OUTes.com
>
>

I thought about this too, but I wanted zero-crossing, and the triac-output
optocouplers are pretty cheap and reliable (and easy to use).

I think I'd rather pay the extra two bucks per triac than risk blowing up my
PIC and all its attached hardware with 115 VAC...
Kevin Fleming, Reliable Networx, Inc.
Phoenix, AZ
Internet: @spam@kpfhomeKILLspamspamprimenet.com


"Please, don't change colors while I'm talking to you."

'followup: driving triacs, being on-line'
1995\07\28@121050 by Harrison Cooper

flavicon
face
As Mr. Neale mentioned, there is lethal power running around.  However, in
this case I will be using a on-line power supply (AT&T signle chip with a
couple of parts) for the Vcc, with the whole thing in a sealed unit so no
fingers will be poking around within it.  Its kinda a smart appliance type
application, but due to size constraints can't use a SSR so just using a
triac to switch a 9 amp load.

KILLspamhcooperKILLspamspames.com

1995\07\31@112005 by Kevin P. Fleming

picon face
At 10:11 AM 7/28/95 -0600, Harrison Cooper wrote:
>As Mr. Neale mentioned, there is lethal power running around.  However, in
>this case I will be using a on-line power supply (AT&T signle chip with a
>couple of parts) for the Vcc, with the whole thing in a sealed unit so no
>fingers will be poking around within it.  Its kinda a smart appliance type
>application, but due to size constraints can't use a SSR so just using a
>triac to switch a 9 amp load.
>
>RemoveMEhcooperTakeThisOuTspames.com
>
>

Would you mind passing along some info on your single-chip power supply? Thanks.
Kevin Fleming, Reliable Networx, Inc.
Phoenix, AZ
Internet: spamBeGonekpfhomespamBeGonespamprimenet.com


"Please, don't change colors while I'm talking to you."


'Driving a ultrasonic transducer from a PIC'
1995\12\05@145922 by Harrison Cooper
flavicon
face
At one time, there was a thread talking about ultrasonic
transducers, and interfacing with a PIC.  Looking thru my
saved mail, I don't see this.

So, sorry to ask again, but can a ultrasonic transducer be
driven directly from a PIC I/O pin ?  I believe there may
be some danger from the transducer drawing spikes of current
from the PIC, and possibly damaging it.  Also, if a single
pin can't supply enough current, can multiple pins be used
to drive the transducer ?  I suppose that the mask to the
output port is registered in fast enough that all the outputs
should switch at about the same time.  Of course the other
drawback is the amplitude of the signal being transmitted.

By range to detect is around 12-14", and is not a moving target,
giving me the luxury of taking multiple readings and determing if
the object is in the field of view.

Harrison Cooper
TakeThisOuThcooperEraseMEspamspam_OUTes.com

1995\12\05@201214 by Rolan

flavicon
face
I had done that at one time. Driving a piezo tranceiver, I was able to
produce a realtively loud tone. Therefore, I assumed that driving a
40 kHz transducer would also be relatively loud (though it was not
audible).  If you would like, I can mail you the source which gives
40 Hkz exactly using a 16c84 and a 1 MHz oscillator.

So the answer is YES it can be driven by the pin alone. I'm sure it would
be much louder if you drove the xcvr with a transistor though.

I was having problems with the receiving end of my device.

-()---()---()---()---()---()---()---()---()---()---()---()---()---()---()-
Rolan Yang            http://hertz.njit.edu/~rxy5310   Electrical Engineer
RemoveMErxy5310spamTakeThisOuThertz.njit.edu                             kyuriusEraseMEspam.....tsb.weschke.com
VR,ROBOTICS,FENCING,HACKING,INDUSTRIAL MUSIC,ART,EXPLOSIVES,INLINE SKATING
                   THESE ARE A FEW OF MY FAVORITE THINGS.
-()---()---()---()---()---()-----()-()---()---()---()---()---()---()---()-
4 out of 10 people are annoyed by ^ this.

'Driving a ultrasonic transducer from a PIC (fwd)'
1995\12\06@172648 by Rolan

flavicon
face
many people have requested the code. I shouldn't post it without
trying it, but here it is. I hope this is the right program.
If this one does not give you
a clean 40 kHz, then I will dig deep into my tape backups to find the
right one. I kind of remember taking out the swl (small wait loop)
and replacing it with a few nop's and then a return. Well, play with
it and see what you get.

Remember to use a 16c84 and a 1 Mhz oscillator.



include <p16cxx.inc>
     lo      equ     0
     hi      equ     1
     inuse   equ     2
     level   equ     0ch
     level2  equ     0dh
     counter equ     0eh
     durat   equ     0fh
     tmpout  equ     10h
     org     0x0000
     goto    init
     org     0x0010
init
     bsf     status,rp0
     movlw   B'00000000'
     movwf   TRISB
     movlw   B'00011111'
     movwf   trisa
     bcf     status,rp0
     movlw   0x01
     movwf   portb
     movwf   tmpout
begin                                   ;main program
       call    chirp
       call pause
       goto begin
chirp                                   ;make sound for dur
       movlw   0x30
       movwf           durat
cycle   bsf             tmpout,0         ;on and offs
       movfw           tmpout
       movwf           portb
       call            smwait
       bcf             tmpout,0
       movfw           tmpout
       movwf           portb
       call            smwait
       decfsz  durat
       return
       goto            cycle

smwait                                   ;small wait loop
       movlw           0xff
       movwf           level
swl
       decfsz  level
       goto swl
       return

pause                           ;big wait loop
       movlw   0xff
       movwf   level
       movlw   0x10
       movwf   level2
loop
       decfsz  level2,1
       goto    next
       return
next    decfsz  level,1
       goto    next
       goto    loop
         end

1995\12\06@183023 by Rolan

flavicon
face
many people have requested the code. I shouldn't post it without
trying it, but here it is. I hope this is the right program.
If this one does not give you
a clean 40 kHz, then I will dig deep into my tape backups to find the
right one. I kind of remember taking out the swl (small wait loop)
and replacing it with a few nop's and then a return. Well, play with
it and see what you get.

Remember to use a 16c84 and a 1 Mhz oscillator.



include <p16cxx.inc>
     lo      equ     0
     hi      equ     1
     inuse   equ     2
     level   equ     0ch
     level2  equ     0dh
     counter equ     0eh
     durat   equ     0fh
     tmpout  equ     10h
     org     0x0000
     goto    init
     org     0x0010
init
     bsf     status,rp0
     movlw   B'00000000'
     movwf   TRISB
     movlw   B'00011111'
     movwf   trisa
     bcf     status,rp0
     movlw   0x01
     movwf   portb
     movwf   tmpout
begin                                   ;main program
       call    chirp
       call pause
       goto begin
chirp                                   ;make sound for dur
       movlw   0x30
       movwf           durat
cycle   bsf             tmpout,0         ;on and offs
       movfw           tmpout
       movwf           portb
       call            smwait
       bcf             tmpout,0
       movfw           tmpout
       movwf           portb
       call            smwait
       decfsz  durat
       return
       goto            cycle

smwait                                   ;small wait loop
       movlw           0xff
       movwf           level
swl
       decfsz  level
       goto swl
       return

pause                           ;big wait loop
       movlw   0xff
       movwf   level
       movlw   0x10
       movwf   level2
loop
       decfsz  level2,1
       goto    next
       return
next    decfsz  level,1
       goto    next
       goto    loop
         end

1995\12\06@205447 by Rolan

flavicon
face
many people have requested the code. It's been a while since I used
it. I hope this is the right program. The program is far from compact
or efficient, but it works (I think).

Remember to use a 16c84 and a 1 Mhz oscillator.



include <p16cxx.inc>
     lo      equ     0
     hi      equ     1
     inuse   equ     2
     level   equ     0ch
     level2  equ     0dh
     counter equ     0eh
     durat   equ     0fh
     tmpout  equ     10h
     org     0x0000
     goto    init
     org     0x0010
init
     bsf     status,rp0
     movlw   B'00000000'
     movwf   TRISB
     movlw   B'00011111'
     movwf   trisa
     bcf     status,rp0
     movlw   0x01
     movwf   portb
     movwf   tmpout
begin                                   ;main program
       call    chirp
       call pause
       goto begin
chirp                                   ;make sound for dur
       movlw   0x30
       movwf           durat
cycle   bsf             tmpout,0         ;on and offs
       movfw           tmpout
       movwf           portb
       call            smwait
       bcf             tmpout,0
       movfw           tmpout
       movwf           portb
       call            smwait
       decfsz  durat
       return
       goto            cycle

smwait                                   ;small wait loop
       movlw           0xff
       movwf           level
swl
       decfsz  level
       goto swl
       return

pause                           ;big wait loop
       movlw   0xff
       movwf   level
       movlw   0x10
       movwf   level2
loop
       decfsz  level2,1
       goto    next
       return
next    decfsz  level,1
       goto    next
       goto    loop
         end

1995\12\06@222726 by Rolan

flavicon
face
many people have requested the code. It's been a while since I used
it. I hope this is the right program. The program is far from compact
or efficient, but it works (I think).

Remember to use a 16c84 and a 1 Mhz oscillator.



include <p16cxx.inc>
     lo      equ     0
     hi      equ     1
     inuse   equ     2
     level   equ     0ch
     level2  equ     0dh
     counter equ     0eh
     durat   equ     0fh
     tmpout  equ     10h
     org     0x0000
     goto    init
     org     0x0010
init
     bsf     status,rp0
     movlw   B'00000000'
     movwf   TRISB
     movlw   B'00011111'
     movwf   trisa
     bcf     status,rp0
     movlw   0x01
     movwf   portb
     movwf   tmpout
begin                                   ;main program
       call    chirp
       call pause
       goto begin
chirp                                   ;make sound for dur
       movlw   0x30
       movwf           durat
cycle   bsf             tmpout,0         ;on and offs
       movfw           tmpout
       movwf           portb
       call            smwait
       bcf             tmpout,0
       movfw           tmpout
       movwf           portb
       call            smwait
       decfsz  durat
       return
       goto            cycle

smwait                                   ;small wait loop
       movlw           0xff
       movwf           level
swl
       decfsz  level
       goto swl
       return

pause                           ;big wait loop
       movlw   0xff
       movwf   level
       movlw   0x10
       movwf   level2
loop
       decfsz  level2,1
       goto    next
       return
next    decfsz  level,1
       goto    next
       goto    loop
         end

'PIC driving LCD question'
1995\12\21@234231 by Mike Goelzer

flavicon
face
       I have a snippet of code here which is from a Parallax app note
on interfacing a PIC to a standard character LCD module.  It is very
sparsely commented, and basically I was wondering if someone could help
me figure out how it works.  Here's the code:

               mov     temp2,#00110000b
                                     ;Initialize LCD: set 8-bit, 1-line
                                     ;operation

               call    blip_E
               mov     temp2,#00001110b
               call    blip_E
               mov     temp2,#00000110b
               call    blip_E

In case you're not familiar with this particular app note, the blip_E
routine basically just sends the data in temp2 to the LCD.  The reason
its in its own routine is that blip_E first waits until the LCD is not
busy before blipping the Enable line (hence the name, blip_E).

Anyway, according the that lone comment, this code sets the LCD to
8-bit, 1 line operation.  Can someone explain to me what each of
those three instructions which are being sent to the LCD are doing?
I'm actually working with a 2-line LCD, and I therefore want to know
which of those 3 instructions is setting the LCD to singe-line mode, so
I can change it to 2-line mode.  Also, any pointers to a good reference
book/article on controlling LCDs -- one that might have all the control
instructions such as the above 3 listed in it -- would be appreciated.

Thanks for any help.

-mike

1995\12\22@003635 by Andrew Warren

flavicon
face
Mike Goelzer <EraseMEPICLISTspamMITVMA.MIT.EDU> wrote:

{Quote hidden}

Mike:

The first instruction, "00110000", is called "Function Set".  Its
bits are structured as follows:

       001LNF00        - L: Interface Data Length (0=4 bits, 1=8 bits)
                               - N: Number of Display Lines (0=1 line, 1=2 line
s)
                               - F: Font (0=5x7, 1=5x10)

The next instruction, "00001110", is called "Display On/Off Control".
The structure of this instruction is:

       00001DCB0       - D: Display On/Off (0=Off, 1=On)
                               - C: Cursor On/Off (0=Off, 1=On)
                               - B: Blink at Cursor position On/Off (0=Off, 1=O
n)

The final instruction "00000110", is called "Entry Mode Set".  It's
structured as follows:

       000001JS        - J: Cursor-Move Direction (0=Rightward, 1=Leftward)
                               - S: Shift (0=Leave Display static & Move Cursor
,
                                          (1=Leave Cursor static and Shift Disp
lay)

To modify this code for a 2-line display, change the first
instruction to "00111000".  Remember that the LCD controller treats
each line of the display as though it were 64 columns wide, so the
address of the first character of the second line is 40 hex, no
matter how wide your display actually is.

For more information, get the LCD databook from Hitachi, AND,
Stanley, EPSON, or any of the other manufacturers of these things...
They all use the same Hitachi LCD controller chip.

-Andy

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

1995\12\22@040738 by Robert Lunn

flavicon
picon face
>         I have a snippet of code here which is from a Parallax app note
> on interfacing a PIC to a standard character LCD module.
>
...snip...
>
> Anyway, according the that lone comment, this code sets the LCD to
> 8-bit, 1 line operation.  Can someone explain to me what each of
> those three instructions which are being sent to the LCD are doing?
> I'm actually working with a 2-line LCD, and I therefore want to know
> which of those 3 instructions is setting the LCD to singe-line mode, so
> I can change it to 2-line mode.  Also, any pointers to a good reference
> book/article on controlling LCDs -- one that might have all the control
> instructions such as the above 3 listed in it -- would be appreciated.

When you say "standard character LCD module" you seem to mean an LCD
module using an Hitachi HD44780 Dot Matrix LCD Controller/Driver.
This is a _very_ common controller chip for small one, and two, line
displays; but "standard" might be stretching it.

You need a copy of the "Hitachi LCD Controller/Driver LSI" databook.
Or a datasheet for the HD44780 (or HD44780A, or LCD-II, or other
compatible) IC.

To keep you going, here is the command set for the chip:

       00000001        Clear display and Home cursor
       0000001*        Home cursor
       000001AB        Set cursor move and display shift
       00001CDE        Turn on/off display, cursor, blink
       0001FG**        Move cursor and shift display
       001HJK**        Set interface, lines, font
       01aaaaaa        Set character generator address
       1aaaaaaa        Set data ram address (Set cursor)

Where:

       *  = don't care (usually set to 0)
       A  = 1 for cursor increment, 0 for cursor decrement
       B  = 1 for display shift on cursor move, 0 otherwise
       C  = 1 to turn display on, 0 to turn display off
       D  = 1 to turn cusor on, 0 to turn cursor off
       E  = 1 to turn cursor blink on, 0 to turn blink off
       F  = 1 to shift display, 0 to move cursor
       G  = 1 to shift/move to the right, 0 to move left
       H  = 1 for 8-bit interface, 0 for 4-bit interface
       J  = 1 for 2-line display, 0 for 1-line display
       K  = 1 for 5x10 dot characters, 0 for 5x7 characters

All these instructions must be written to the command register (RS=0,
R/W=0).  Having configured the display and set the cursor, you then
display characters by writing ascii codes to the data register (RS=1,
R/W=0).  You cannot send commands/data to the chip while it is busy.
You must poll the BUSY flag by reading the command register (RS=0,
R/W=1).  The BUSY flag is bit#7, and is high when the chip is busy.
Bits #6..#0 are the current data ram address (cursor address).

If you don't want to poll the BUSY flag you must provide software
delays that are long enough to ensure the chip has finished executing
each command that you send.  The execution time of all commands is
40us, except for the "Clear display" and "Home cursor" commands,
which both take 1.64ms to execute.

Note that the '44780 chip is difficult to initialize.  The built-in
power-on reset circuit is unreliable, and a software initialization
sequence must usually be executed.

___Bob

1995\12\22@202114 by AV Presentations

picon face
Try ComputerCraft magazine, formerly Modern Electronics, September '91
issue.  The article by Jan Axelson has quite a bit of info. HTH

morris beverly     RemoveMEavpresspam_OUTspamKILLspamworld.std.com


'Driving HC parts with PIC16C84'
1996\03\12@135947 by Norm Cramer
flavicon
face
I remember reading that the PIC can directly drive HC parts.  I can't find
where I read it.  Is it true or do you need to use pullups as if interfacing
to a TTL part?

Thanks,

Norm

1996\03\12@165625 by Kalle Pihlajasaari

flavicon
face
> I remember reading that the PIC can directly drive HC parts.  I can't find
> where I read it.  Is it true or do you need to use pullups as if interfacing
> to a TTL part?

They will drive pretty much any 5 V logic without any external components.

Remember that the old 74xx and 74Sxx chips should not have their inputs
driven hard above Vcc - 0.7V due to the quirky inputs, they should have a
470 Ohm resistor in series.  All other technologies should be a straight
connection.  No guarantees for ECL stuff though, there are TTL to ECL
converters if you must use them.

Cheers
--
Kalle Pihlajasaari     RemoveMEkalleTakeThisOuTspamspamdata.co.za
Interface Products     Box 15775, Doornfontein, 2028, South Africa
+27 (11) 402-7750      Fax: +27 (11) 402-7751


'Loudspeaker driving from PIC pin'
1996\05\21@040134 by Mungo Henning
flavicon
picon face
I'm still in the 'prototype' stage of building a PIC based alarm system
(nothing too grand, using the 16C84) and I toggle one output pin to create
the sound tones which (for now) feed a piezo buzzer (I guess standard stuff
so far).
The volume isn't great (and I don't want to drive it in 'bridge' mode), hence
I need some amplification which will feed a reasonable-sized speaker
(not quite mega-loud, but an 8ohm 8watt speaker which is kicking around in
my workshop). I've had a quick trawl through old Electronics magazines and
it looks like using a TDA2030 device might be my best bet.
Can I solicit any ideas/opinions on my plan please?

Whilst this solution will do for now (like, bigger problems to tackle
first), ultimately I would like to investigate producing 'gentle' (for lack
of a better word!) 'chime' sounds rather than pushing a square wave through
an amp. Anyone done this already?

Thanks in Advance

Mungo Henning

1996\05\21@055336 by paul

flavicon
picon face
In message <PICLIST%EraseME96052104013521spamspamspamBeGoneMITVMA.MIT.EDU> you recently said:

> I'm still in the 'prototype' stage of building a PIC based alarm system
> (nothing too grand, using the 16C84) and I toggle one output pin to create
> the sound tones which (for now) feed a piezo buzzer (I guess standard stuff
> so far).
> The volume isn't great (and I don't want to drive it in 'bridge' mode), hence
> I need some amplification which will feed a reasonable-sized speaker
> (not quite mega-loud, but an 8ohm 8watt speaker which is kicking around in
> my workshop). I've had a quick trawl through old Electronics magazines and
> it looks like using a TDA2030 device might be my best bet.
> Can I solicit any ideas/opinions on my plan please?
>
> Whilst this solution will do for now (like, bigger problems to tackle
> first), ultimately I would like to investigate producing 'gentle' (for lack
> of a better word!) 'chime' sounds rather than pushing a square wave through
> an amp. Anyone done this already?
>
> Thanks in Advance
>
> Mungo Henning
>
AN543 in the microchip embedded control handbook shows how to
generate tones, unfortunately it is for the 17c42 but it may
be some help.



--
Paul Waterfield
TECHNIQUEST Exhibit Developer
RemoveMEpaulKILLspamspamtquest.demon.co.uk

1996\05\21@082116 by Clyde Smith-Stubbs

flavicon
face
Mungo Henning <mungohSTOPspamspamspam_OUTitacs.strath.ac.uk> wrote:

> The volume isn't great (and I don't want to drive it in 'bridge' mode), hence
> I need some amplification which will feed a reasonable-sized speaker

Why not use an LM386 - it will deliver 300mW or so into 8ohms with a 6V
supply. There is also the LM4880 - a dual audio amp in an 8 pin package
with a shutdown input (<1uA in shutdown mode). It will deliver over 300mW
per channel on a 5V supply.

You can get data on these from National Semiconductor's Web site -
http://www.national.com.

To generate sounds other than square waves, the easiest way is to do
a pulse-width-modulation technique, but this requires producing a
pulse train at a rate several times your desired maximum output frequency.


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

1996\05\21@132404 by Russell Politzky

flavicon
face
Mungo Henning wrote:
>
> I'm still in the 'prototype' stage of building a PIC based alarm system
> (nothing too grand, using the 16C84) and I toggle one output pin to create
> the sound tones which (for now) feed a piezo buzzer (I guess standard stuff
> so far).
> The volume isn't great (and I don't want to drive it in 'bridge' mode), hence
> I need some amplification which will feed a reasonable-sized speaker
> (not quite mega-loud, but an 8ohm 8watt speaker which is kicking around in
> my workshop). I've had a quick trawl through old Electronics magazines and
> it looks like using a TDA2030 device might be my best bet.
> Can I solicit any ideas/opinions on my plan please?

I would  not bother with a dedicated amp IC just to produce a square wave.  A
simple class B push-pull output stage hooked up to the 5V supply and capacitivly
coupled to the speaker will do the job if you just want to generate square
waves.
You will need the amp IC to generate the chimes.

>
> Whilst this solution will do for now (like, bigger problems to tackle
> first), ultimately I would like to investigate producing 'gentle' (for lack
> of a better word!) 'chime' sounds rather than pushing a square wave through
> an amp. Anyone done this already?
>
> Thanks in Advance
>
> Mungo Henning

--
-------------------------------------
E-mail: EraseMEpolitzkyspamEraseMEicon.co.za

Its better not to know than to know what aint so
-------------------------------------

1996\05\21@182942 by Scott Dattalo

face
flavicon
face
Mungo Henning wrote:
>
> Whilst this solution will do for now (like, bigger problems to tackle
> first), ultimately I would like to investigate producing 'gentle' (for lack
> of a better word!) 'chime' sounds rather than pushing a square wave through
> an amp. Anyone done this already?
>

I've never done it. However, I know that there are sound drivers that produce
fairly decent sound out of the PC's cheap speaker. I presume they use some sort
of pulse width modulation scheme and let the speaker's relatively low frequency
response smooth things out. There are two things that you would need to control
to get the 'gentle' waveforms: amplitude and frequency. The pulse width
variation
can control the perceived amplitude, while the pulse frequency controls the
perceived
frequency. It's theoretically possible...


Scott

1996\05\21@215149 by John Payson

flavicon
face
> I've never done it. However, I know that there are sound drivers that produce
> fairly decent sound out of the PC's cheap speaker. I presume they use some
sort
> of pulse width modulation scheme and let the speaker's relatively low
frequency
> response smooth things out. There are two things that you would need to
control
> to get the 'gentle' waveforms: amplitude and frequency. The pulse width
>  variation
> can control the perceived amplitude, while the pulse frequency controls the
>  perceived
> frequency. It's theoretically possible...

PWM is a good way to get nice sounds out of a speaker, BUT your PWM frequency
should be higher than your output wave frequency: a pulse-modulated wave will
be harmonically very rich and if the harmonics are audible things will sound
tinny or worse.

Just to illustrate, if your wave goes through the stages:

________--------________--------________--------

________------__________------__________------__

________----____________----____________----____

________--______________--______________--______

the resulting sound will be somewhat wierd at the end (try it--you might
always like it).  If you want a more bell-like sound, you should do your
modulation more like this:

________--------________--------________--------

________---_---_________---_---_________---_---_

________-_-_-_-_________-_-_-_-_________-_-_-_-_

________-___-___________-___-___________-___-___

[preferably with the waves being chopped more finely].  Alternatively, if
your only need for PWM'ing is to produce "dings" and if you can conveniently
alter the tris'age of your output port pin, you could wire your piezo speaker
to the port pin along in parallel with a series RC to ground.

PORT PIN------+-------+
             R       |
             |       Peizo
             C       |
             |       |
             gnd     gnd

When your tone is hard-off, set the port pin active high.  This will leave
the cap charged; most piezos are capacitive and don't pass DC current.  When
it's necessary to produce a tone, alternate the port between active-low and
tristate.  As long as the cap has charge, the voltage to the speaker will be
set by the cap voltage.  As that voltage decreases [which it will probably
do more or less exponentially] the piezo will get quieter.

The biggest problem with the circuit--remediable with another port pin--is
that it's necessary to let the cap charge between tones.  If another port
pin were wired "directly" to the cap, the cap could be charged quickly bet-
ween tones; otherwise charging the cap will take some time. [adding a diode
across the resistor might improve this].

1996\05\21@230717 by Dave

picon face
>
> Mungo Henning wrote:
>
> I've never done it. However, I know that there are sound drivers that produce
> fairly decent sound out of the PC's cheap speaker. I presume they use some
sort
> of pulse width modulation scheme and let the speaker's relatively low
frequency
> response smooth things out. There are two things that you would need to
control
> to get the 'gentle' waveforms: amplitude and frequency. The pulse width
>  variation
> can control the perceived amplitude, while the pulse frequency controls the
>  perceived
> frequency. It's theoretically possible...

I was thinking it would be possible to have two tones on a single pin,
but am not sure how.  Gee is this related to DTMF?  It'd be kind of a
rainy day project to have chimes coming from a 16C84.  I don't have any
code related to telephone stuff so if someone would point me to a
resorce, I'd be posting some code soon!

'PWM driving H-Bridge'
1996\05\30@120103 by LEUNG LAUREN KWAN-KIT

flavicon
face
I'm currently seeking for a H-Bridge component that can be driven by a
PIC16C74 PWM port and to drive a fairly small motor... something like an old
5-1/4" floppy drive motor..... can anyone give me some suggestion??

- Lauren

1996\05\30@122606 by Mark K Sullivan

flavicon
face
>I'm currently seeking for a H-Bridge component that can be driven by a
>PIC16C74 PWM port and to drive a fairly small motor... something like an old
>5-1/4" floppy drive motor..... can anyone give me some suggestion??

The old L298 is good.  Up to 2 amps at 45 volts.  TI makes a couple of versions
of it now.  TPIC0298 is generally preferred.  This is actually a dual driver.
For 600mA in a DIP, there is the L293, also available these days from TI.

- Mark Sullivan -


'Driving LEDs (was: Suggestions for new PIC person)'
1996\06\06@001125 by Byron A Jeff
face picon face
>
> > The "hello world" of the PIC is to blink an LED tied to a pin.  I have
watched
> > several people implement this and have one warning:
> > If you can't see the LED blinking, check with a 'scope.  PICs aren't very
good
{Quote hidden}

Hmmm, I was having a discussion about bipolar LED's driven by PIC pins in
one of my classes I'm teaching this summer just this morning. The objective
was to drive 6 bi-polar LEDS (2 pin) using as few PIC port pins as possible.
Each LED should be able to show red,green,yellow, and off.

The design I hit upon after thinking a bit revolved around multiplexing
the 6 LEDs utilizing a common pin on one side. Something like:

Port pin---+-[220ohm]--+---[LED]------  Port pin
           |
           +-[220ohm]--+---[LED]------- Port pin
           |
           +-[220ohm]--+---[LED]------- Port pin
           |
           +-[220ohm]--+---[LED]------- Port pin

And so on. One led can be selected by tristating all but one port pin
on the right side. The selected LED's color can be picked by twiddling
with the left port pin and the one non-tristated port pin.

The question that popped into my mind during this design discussion was
the relevance of the position of the resistor. Does it matter if the resistor
is on the anode or the cathode side of an LED. Is putting the resistor on
the anode side simply a convention or is there some other reason that justifies
its placement. Should a bi-polar have resistance on both sides (I've done this
in previous designs)?

THe above configuration would be ideal because the left port pin could be
tied to the common terminal of a resistor pack somewhat simplifing the
wiring.

Thanks for any advice,

BAJ

1996\06\06@005341 by Steve Hardy

flavicon
face
{Quote hidden}

justifies
> its placement. Should a bi-polar have resistance on both sides (I've done this
> in previous designs)?
>

It makes no electrical difference which side the R is on.  Two 2-pin
devices in series may be used in any order.

BTW, the above circuit can also drive any 2 LEDs to arbitrary polarity
so long as consistent brightness isn't a problem.  How about 3 or more?
Have to think about that...

Regards,
SJH
Canberra, Australia

1996\06\06@013039 by Onat Ahmet

flavicon
face
       > I would suggest an easy remedy to this is to use a bipolar LED
       one of
       > the two-lead red/green types, available at Radio Shack or any
       mail-order
       > electronics house) connected as shown:
       >
       > Gnd----[220ohm]---+---[220ohm]----+5
       >                   |
       >                   +---[LED]------- Port pin
       >
       > that this can be a useful trick for driving more than one
       "independently-
       Hmmm, I was having a discussion about bipolar LED's driven by PIC
       pins in
       one of my classes I'm teaching this summer just this morning. The
       objective
       was to drive 6 bi-polar LEDS (2 pin) using as few PIC port pins as
       possible.
       Each LED should be able to show red,green,yellow, and off.

       The design I hit upon after thinking a bit revolved around
       multiplexing
       the 6 LEDs utilizing a common pin on one side. Something like:

        Port pin---+-[220ohm]--+---[LED]------  Port pin
                   |
                   +-[220ohm]--+---[LED]------- Port pin
                   |
                   +-[220ohm]--+---[LED]------- Port pin
                   |
                   +-[220ohm]--+---[LED]------- Port pin

       And so on. One led can be selected by tristating all but one port
       pin
       on the right side. The selected LED's color can be picked by
       twiddling
       with the left port pin and the one non-tristated port pin.

Actually, I think there is nothing new under the sun really ;)
If you know about LED sign boards, this is how they work! You
seem to have simplified it into a single line! (the initial
poster did it down to a single pixel!) I think it is a nice idea
though!

       The question that popped into my mind during this design discussion
       was the relevance of the position of the resistor. Does it matter if
       the resistor is on the anode or the cathode side of an LED.

       BAJ

Theoretically both are identical. You don't need to put a resistor
to both ends of a bipolar LED either. I do not know how this setup
works with high frequencies (well, we have seen radio beacons
recently), so I cannot comment on that... (Not that many people would
drive their LED's at these frequencies!)

Is there any "catch 22" to this?


| Ahmet ONAT  Kyoto Univ. Japan                                 |
| E-mail    : spamBeGoneonatspamKILLspamkuee.kyoto-u.ac.jp                           |
| WWW page  : http://turbine.kuee.kyoto-u.ac.jp/staff/onat.html |
|             My 6 leg walker, RC airplanes & more in home page |

1996\06\06@031027 by Keith Dowsett

flavicon
face
>        the 6 LEDs utilizing a common pin on one side. Something like:
>
>         Port pin---+-[220ohm]--+---[LED]------  Port pin
>                    |
>                    +-[220ohm]--+---[LED]------- Port pin
>                    |
>                    +-[220ohm]--+---[LED]------- Port pin
>                    |
>                    +-[220ohm]--+---[LED]------- Port pin

Hi,

  the problem with this design arises when you want all four LEDs running.
If we allow for 10mA through each LED the common pin has to source and sink
40mA. According to the 16C5X data sheet in front of me the specification is
sink 25mA and source 20mA. In addition to which there are limits on total
currents for each port, and for the total device.

One way around this is to use the common pin to drive a pair of transistors
but that increases the part count and we are still faced with a 40mA per
port limitation. Perhaps someone has a better solution.

Keith.
==========================================================
Keith Dowsett         "Variables won't; constants aren't."

E-mail:      .....kdowsettspam_OUTspamrpms.ac.uk
Phone:       0181-740-3162
Fax:         0181-743-3987

Snail mail:  MRC Clinical Sciences Centre, Cyclotron Unit.
                Hammersmith Hospital. London W12 0NN.

1996\06\06@084308 by Rick Miller

picon face
Byron!!
Byron A Jeff wrote:

It *DOES* make a difference where you put the resistor,
since programmers invariably make *mistakes*.  With only
one resistor, it would be possible to burn out the left-hand
port pin if you were to drive too many of the right-hand
pins to the opposite polarity *simultaneously*.  That's all.

If you're careful, *really* careful, not to do that, then
all is well with only one resistor.  It makes absolutely
no difference which side of the LED you put the resistor
on, unless you want to use the roughly 1.3 V drop for some
sort of measurement purposes.

Use one "file" to hold bits to be driven during the "RED"
cycle and another to hold bits to be driven during the
"GREEN" cycle.  Yellow gets a bit in both.  Then cycle
through both files, one bit at a time.  That way you
can be pretty certain you're not going to drive more than
one LED at a time.

How 'bout loading the flag file into the data output
latches and then rotating the TRIS file with one bit
cleared?  :-)  Now you know I'm going to have to build
this thing, just to see it run.

You might also wish to lower the value of the current-
limiting resistor to allow the full 20mA that the pins
can put through it.  Since you're only going to be driving
the LEDs for very small duty cycles (1/12 at most) you
certainly won't have to worry about burning them out.
--
Rick Miller
<TakeThisOuTrdmiller.....spamTakeThisOuTexecpc.com>

1996\06\06@131538 by Reginald Neale

flavicon
face
electronics house) connected as shown:
>>
>> Gnd----[220ohm]---+---[220ohm]----+5
>>                   |
>>                   +---[LED]------- Port pin
>>

This can also be used with separate red and green LEDs in inverse parallel,
e.g. a panel display to indicate TOO HIGH (red LED); TOO LOW (green LED);
or within range (tri-stated to open circuit - no LEDs).


{Quote hidden}

In a series circuit, the same current flows through all elements, so it
makes no difference which side the resistor is on. Also, if you only need
to light one of the LEDs at a time, you can simplify this by using a single
resistor at the port pin.

.....................Reg Neale.....................
"Ignorance is a renewable resource"   P.J. O'Rourke

1996\06\06@135517 by Byron A Jeff

face picon face
>
> >        the 6 LEDs utilizing a common pin on one side. Something like:
> >
> >         Port pin---+-[220ohm]--+---[LED]------  Port pin
> >                    |
> >                    +-[220ohm]--+---[LED]------- Port pin
> >                    |
> >                    +-[220ohm]--+---[LED]------- Port pin
> >                    |
> >                    +-[220ohm]--+---[LED]------- Port pin
>
> Hi,
>
>    the problem with this design arises when you want all four LEDs running.

I definitely do not want all four LEDs running at the same time. That defeats
the original spec which is that each bi-polar LED can have a color independant
of the others. If all four are driven simulteanously then only two of the
possible 4 colors can be achieved (One color and off).

The plan is to multiplex them: i.e. turn on one LED at a time with the corrent
color, show that color for a while, turn that LED off and move on to the next
one which can be turned on with a completely different color. If you do this
fast enough, the eye blends the flashing LED's into a solid (but dimmer)
color.

And as Rick Miller pointed out in another post, with careful programming
it's not even necessary to have one resistor per led but one resistor
period. The current will only flow through the LED activated. And it seems
that the order of the LED and resistor isn't important. That's good to know.

> If we allow for 10mA through each LED the common pin has to source and sink
> 40mA. According to the 16C5X data sheet in front of me the specification is
> sink 25mA and source 20mA. In addition to which there are limits on total
> currents for each port, and for the total device.

I'd pull the full 20ma through the currently activated LED.. It's only one
LED, not all 6 that turn on at once so there's no need to limit the current to
10 ma
>
> One way around this is to use the common pin to drive a pair of transistors
> but that increases the part count and we are still faced with a 40mA per
> port limitation. Perhaps someone has a better solution.

Correct. If brightness is a real problem (and in this application it isn't)
then each port pin would have to drive a transistor pair. But that raises
the next question: Can a transistor pair be tri-stated? If so how would you
do it?

Thanks for the reply,

BAJ

1996\06\06@212913 by Steve Hardy

flavicon
face
{Quote hidden}

A transistor buffer can be tristated using only one output port, providing
that the output leakage is insufficient to bias either transistor.  In the
case of leakage, beware that the following circuit divides the output
impedance by the transistor beta (approximately).

                  Vcc
                  /
          -------|NPN
         |        \
port -----|         +---- out
         |        /
         --------|PNP
                  \
                  GND

(Geez I hate ascii graphics).  The emitters are tied together.  The output
follows the state of the port (High, Low or hi-Z).  The only problem is that
to output is no longer that good old rail-to-rail CMOS swing.  Instead,
the output falls short of the supply by one Vbe. (about 0.6V).

The available current is the port current times the transistor beta; in
practise limited by the allowable transistor collector current - approx 500mA.

One question I have is whether the datasheet limitations for port current
may be exceeded if a reduced duty cycle is used.  E.g. for continuous
operation 25mA is OK, is 100mA OK for 25% duty cycle?  My guess is
probably not due to excessive voltage drop in the output drivers due to
FET channel resistance, however it would be interesting to experiment.

Regards,
SJH
Canberra, Australia

1996\06\07@104539 by Mark K Sullivan

flavicon
face
>A transistor buffer can be tristated using only one output port, providing
>that the output leakage is insufficient to bias either transistor.  In the
>case of leakage, beware that the following circuit divides the output
>impedance by the transistor beta (approximately).

Won't your circuit hold the port pin

1996\06\08@162506 by Dwayne Reid

flavicon
face
>                   Vcc
>                   /
>           -------|NPN
>          |        \
>port -----|--/\/\/-+---- out
>          |        /
>          --------|PNP
>                   \
>                   GND
>

>SJH
>Canberra, Australia
>

Steve - if you add a 10K resistor from bases to emitters, leakage becomes
MUCH less of a factor.

Dwayne

1996\06\09@072743 by David Knell

flavicon
face
[diagram snipped]

>Steve - if you add a 10K resistor from bases to emitters, leakage becomes
>MUCH less of a factor.

And, if the Vbe drop is a problem, you can swap the transistors over,
resulting in output swinging to the rails - Vce(sat) (typically 0.2-0.3V).

                    Vcc
                    /
           -------|PNP
           |        \
port -/\/\/ +        +---- out
           |        /
           --------|NPN
                    \
                    GND

This has a disadvantage that it can't be tristated & that both transistors
are turned on during switching, resulting in potentially large amounts
of current being drawn.

Rearranging like this:

                       Vcc
                 +--+-----
                 |  |
                 /  |
                 \  /
           --/\/\+-|PNP
           |        \
port -------+        +---- out
           |        /
           --/\/\+-|NPN
                 \  \
                 /  |
                 |  |  GND
                 +--+-----

with about a 5:1 ratio between the series resistors and the B-E
resistors ought to be OK for a 5V Vcc.  Your resistors need to
be large enough for the standing current drawn to be acceptable,
and small enough so that there's enough base drive to the transistors.

I guess that another worthwhile observation is that the PIC port
outputs cease to swing rail-rail as soon as you draw any current;
I think I remember measuring one at something like Vcc-0.4 V when
sourcing 4mA.  The original circuit adds a further 0.7V drop to this;
the one above should be generally oblivious to such things.

Dave
------------------------------------------------------------
David Knell
Tel: 01843 846558
Fax: 01843 846608
E-mail: .....davespamRemoveMEdave-ltd.co.uk

1996\06\10@184335 by Dwayne Reid

flavicon
face
OUCH, Dave!

>And, if the Vbe drop is a problem, you can swap the transistors over,
>resulting in output swinging to the rails - Vce(sat) (typically 0.2-0.3V).
>
>                     Vcc
>                     /
>            -------|PNP
>            |        \
>port -/\/\/ +        +---- out
>            |        /
>            --------|NPN
>                     \
>                     GND
>

NO! NO!  BOTH transistors will immediately destroy themselves with VCC
anything above 2Vbe!  Note: each emitter-base junction is forward biased and
with the bases tied together, it doesn't matter what the port pin is doing!
Its crispy critter time!  Using individual base resistors is barely better
since stored charge means that both transistors will conduct during the
switching transition.

{Quote hidden}

This is somewhat better - but you will still have a problem during the
switching transition where both transistors are conducting at the same time.
This WILL cause an enormous current glitch on your power supply.

>
>I guess that another worthwhile observation is that the PIC port
>outputs cease to swing rail-rail as soon as you draw any current;
>I think I remember measuring one at something like Vcc-0.4 V when
>sourcing 4mA.  The original circuit adds a further 0.7V drop to this;
>the one above should be generally oblivious to such things.

The original circuit should swing to within about 0.8v since the current
drawn from the port pins is Io/beta - assuming typical 2n4401 / 2n4403
transistors with gain of about 100 at 200 mA - even at 200 mA output that is
only about 2 mA from the port pin.

If you modify your circuit to include some current limit, it will work without
collapsing your supply.

dwayne

1996\06\11@051224 by David Knell

flavicon
face
>OUCH, Dave!

[duff circuit snipped]

>NO! NO!  BOTH transistors will immediately destroy themselves with VCC
>anything above 2Vbe!  Note: each emitter-base junction is forward biased and
>with the bases tied together, it doesn't matter what the port pin is doing!
>Its crispy critter time!  Using individual base resistors is barely better
>since stored charge means that both transistors will conduct during the
>switching transition.

Err - I guess that's probably what I meant to draw.  I'll go and touch the
hot end of my soldering iron (that's the one with the metal point on, isn't
it?) with a finger to simulate the result of the above.

{Quote hidden}

Erm - will it?  With the port pin mid-rail (on its way up or down) both
transistors have a Vbe of about 0.4V & are therefore turned off, which is
the same state as with the port pin tri-stated.  Whether there is a period
when they both conduct will depend on the slew rate of the driving pin, the
amount of stored charge on the transistor's BE junction and the value of the
resistor between base and emitter.

Dave


'Driving Motors - Help!'
1996\07\12@113242 by myke predko
flavicon
face
Hi Folks,

Does anybody have any hints on driving motors with the PIC?  I'm still
trying to get my I/R Robot working and my biggest (and hopefully last)
problem is with the motors.

I originally tried to copy the circuit presented in the "Runabout Robot" in
Electronics Now, but I've reached a stumbling block.  The motor driver is an
"H" transistor Driver (a PNP 2N4403 from 3 Volts (battery) to a motor
terminal to an NPN 2N4401 dropping the circuit to Ground).  The Transistor
bases are connected to a PIC driver via a 750 Ohm resistor.

The mechanical pieces I used is from two Tamiya tracked vehicle kits (one
motor and gearbox to drive each set of tracks).  Actually, if you are
interested in building a simple device that runs along the floor and uses
differential motors for steering, Tamiya has the tracked vehicle kit (which
I used two for the motors and gearboxes) and the "wall hugging mouse", which
uses two motors in a similar fasion to the Runabout Robot.

I originally set up the circuit as shown in the article (with an individual
PIC Pin driving a PNP/NPN combination).

Two problems arose from this.

The first was that the PIC was locking up intermittantly when a Motor was
energized.  The second was that the transistor circuit was not driving
enough current for the Motors to run (I measured the motors as requiring
roughly 400 mA - The circuit would only provide 300 mA).

I went after the second problem, thinking that I had a flakey connection
causing the locking up.  I decided to drop the in line resistor value to
increase the current - a 220 Ohm resistor was used.

In doing this, the PIC locked up right from application of power (making the
first problem a lot worse).  Going through the Datasheets (I am using a
'C84), I found that I was exceeding the PIC's Source/Sink currents and this
seemed to be causing the lockup.  I removed some of the load from the PIC
Port (I was using PORTA to drive the Transistors) and the locking up has
gone away.

Now, doing the math, it's pretty obvious that the way I'm going is the wrong
one.  I was going to split out the PNP/NPN pin controls to two PIC Pins from
one, but that will help the Pin Current Requirements, but not the PORT POWER
PROBLEMS (which is what seemed to be causing the PIC to Lock-Up).

I would like to use Darlington Pair Transistors (I've used NPN arrays such
as the ULN2003A in the past to drive relays) to drive the motors.  This
should eliminate the Port Power consumption problems.  Before I jump in and
do this, I have a few questions:

1.  Does anybody have experience with PNP Darlington Pairs?

2.  Can I replace the "top" PNP with a NPN and make the motor terminal drive
like a totem pole output?

3.  What PIC Pin to Transistor Base Resistor Value should I use?  Assuming
an Hfe of 5K for the Darlington NPN Array and current requirements of 600 mA
(for some guardband):

 C-E Current = Hfe x B-E Current ("BEI")
 600mA       = 5K (for example) x BEI
 BEI         = 600mA/5K
             = 0.12 mA

 Resistor    = PIC Output Voltage / BEI
             = 4.8 Volts / 0.12mA
             = 40K

So, from these calculations, a 40K resistor should give me approximately 600
mA through a Darlington Pair NPN Transistor driven by a PIC Pin.  Is this
correct?

4.  Is is possible to do away with the in-line resistor all together?  When
I've used the ULN2003A in the past, I've driven the Darlington pairs
directly from TTL/CMOS.

Ideally, I would like to use four NPN Darlington Pair Transistors driven
directly from the PIC.

Sorry for the long note, I appreciate any answers or ideas you can give me.
And before I start adding parts, I would like to see if what I want to do
has any merit.

Thanx,

Myke

Do you ever feel like an XT Clone caught in the Pentium Pro Zone?

1996\07\12@121908 by Mark K Sullivan

flavicon
face
>Does anybody have any hints on driving motors with the PIC?  I'm still
<snip>
>The motor driver is an "H" transistor Driver (a PNP 2N4403 from 3 Volts
>(battery) to a motor terminal to an NPN 2N4401 dropping the circuit to Ground).
>The Transistor bases are connected to a PIC driver via a 750 Ohm resistor.

Are the collectors tied together (at the motor) and the bases tied together?
This won't work.  I don't understand your circuit.  (I don't have the magazine).
You could drive the bases from four port pins, each with it's own resistor.
Does anybody have any hints on driving motors with the PIC?  I'm still
trying to get my I/R Robot working and my biggest (and hopefully last)
problem is with the motors.

You are talking quite a bit of current for the 4401/4403.  Note that Beta
will be lower than expected.

>I originally set up the circuit as shown in the article (with an individual
>PIC Pin driving a PNP/NPN combination).
<snip>
>The first [problem] was that the PIC was locking up intermittantly when a Motor
>was energized.  The second was that the transistor circuit was not driving
>enough current for the Motors to run (I measured the motors as requiring
>roughly 400 mA - The circuit would only provide 300 mA).

Watch out for brush noise, either on the power supply or getting back into the
PIC I/O pin.  This can easily lock up the PIC.  Try an R/C snubber such as .1uF
in series with, say, 47 ohms across each motor.  Connect this as close as
possible to the motor itself, ideally right across the brushes.

<snip>
>I would like to use Darlington Pair Transistors (I've used NPN arrays such
>as the ULN2003A in the past to drive relays) to drive the motors.  This
>should eliminate the Port Power consumption problems.  Before I jump in and
>do this, I have a few questions:

You're going to lose a lot of power across the voltage drops of two darlingtons
with a 3 volt supply.

>1.  Does anybody have experience with PNP Darlington Pairs?
>
>2.  Can I replace the "top" PNP with a NPN and make the motor terminal drive
>like a totem pole output?

This might work pretty well since the PIC drives to the rail, but your top
transistor becomes an emitter follower and you will have Vce voltage at least
the magnitude of the Vbe drop. Like the darlingtion, this wastes power and
reduces motor voltage.

>4.  Is is possible to do away with the in-line resistor all together?  When
>I've used the ULN2003A in the past, I've driven the Darlington pairs
>directly from TTL/CMOS.

The ULN2003 has a built-in base resistor.  You wouldn't need a base resistor for
the NPN emitter follower (question 2) configuration.

I would use a seperate port pin for each transistor so the emitters can be
connected to the rails.  Use resistors on all four bases calculated to set
the base current pretty high, say 10 mA for 4401/4403.  Design the software
for "dead time" between driving one direction and driving the other direction
to avoid rail-to-rail current when the transistors are switching.

You should look into low-threshold MOSFETs, too.  MOSFETs don't need gate
current (except when switching) and won't need any gate resistors in your
application.

- Mark Sullivan -

1996\07\12@124703 by Martin J. Maney

flavicon
face
On Fri, 12 Jul 1996, myke predko wrote:

> The first was that the PIC was locking up intermittantly when a Motor was
> energized.  The second was that the transistor circuit was not driving
> enough current for the Motors to run (I measured the motors as requiring
> roughly 400 mA - The circuit would only provide 300 mA).

That's a pretty hefty load - perhaps the intermittent lockup is due to
dips in the supply?  I mention this because it seems fairly likely, and
could be a completely separate problem from the other design issues.

> I would like to use Darlington Pair Transistors (I've used NPN arrays such
> as the ULN2003A in the past to drive relays) to drive the motors.  This
> should eliminate the Port Power consumption problems.  Before I jump in and
> do this, I have a few questions:
>
> 1.  Does anybody have experience with PNP Darlington Pairs?

Yeah, in the power range you seem to need they're just like the NPN parts
except for reversed polarity.

> 2.  Can I replace the "top" PNP with a NPN and make the motor terminal drive
> like a totem pole output?

If you can stand to lose 1.5 to 2 volts across the transistor, sure.  For
a battery-operated unit I would expect that you don't want to give up so
much.

> So, from these calculations, a 40K resistor should give me approximately 600
> mA through a Darlington Pair NPN Transistor driven by a PIC Pin.  Is this
> correct?

In this case, one problem is that you want those transistors to be
solidly in saturation to keep voltage drop to a minimum.  In saturation,
you can expect the output device to have a beta perhaps 1/10 (ballpark)
of its linear-mode value; the latter is what the beta of 5000 in he
datasheet is based upon.  Without looking into it in greater detail,
then, I would advise using a resistor at least ten times smaller.  The
only disadvantage in lowering it even further would be loading on the PIC
(and its supply, which really ought to be at least a a bit decoupled from
the raw supply that feeds the motors!) and total current consumption.
The latter seems unlikely to matter when you expect 300 to 400 mA to flow
in the motor windings.  :-)

> 4.  Is is possible to do away with the in-line resistor all together?  When
> I've used the ULN2003A in the past, I've driven the Darlington pairs
> directly from TTL/CMOS.

Bad idea for common-emitter switches.  Even if you do decide to use a
follower for the "high" driver, the series resistor provides soemthing
other than the PIC that can be sacrificed when the output dies, etc.

> Ideally, I would like to use four NPN Darlington Pair Transistors driven
> directly from the PIC.

To keep the switching losses low, I would suggest complementary drivers.
Probably the simplest way to do this would be to use four PIC pins, each
wired to a single transistor through a suitable resistance.  You would
want to turn the currently-conducting devices off, delay a few uSec
(check out the storage time and turn-off specs), and then apply drive to
the pair that you wish to turn on.

'Driving Motors - Help! -Reply'
1996\07\12@130811 by Mark Jurras

flavicon
face
From your description you talk about using a 3V
battery. In your calculations for #3 you use 4.8
volts for the PIC. Do you have two supplies. If so
are the grounds common? If not tell me what you do
have 'cause the calculation are different.

Don't forget the 1.4V base emitter voltage drop
for a darlington.
Resistor    = (PIC Output Voltage-Vbe) / BEI
             = (4.8 -1.4)Volts / 0.12mA
             = 28.3K

Working the equation backwards with the 40K
resistor you calculate and a Hfe of 5K you still
should get 0.425 amps. Maybe not enough to start
the motors but enough to run them. What is the
starting current required?

- -Mark
>>> myke predko <RemoveMEmykespamspamBeGonePASSPORT.CA> 12 July 1996
11:31 am >>>
Hi Folks,

- -snip- -

I originally tried to copy the circuit presented
in the "Runabout Robot" in
Electronics Now, but I've reached a stumbling
block.  The motor driver is an
"H" transistor Driver (a PNP 2N4403 from 3 Volts
(battery) to a motor
terminal to an NPN 2N4401 dropping the circuit to
Ground).  The Transistor
bases are connected to a PIC driver via a 750 Ohm
resistor.

- -snip- -

3.  What PIC Pin to Transistor Base Resistor Value
should I use?  Assuming
an Hfe of 5K for the Darlington NPN Array and
current requirements of 600 mA
(for some guardband):

 C-E Current = Hfe x B-E Current ("BEI")
 600mA       = 5K (for example) x BEI
 BEI         = 600mA/5K
             = 0.12 mA

 Resistor    = PIC Output Voltage / BEI
             = 4.8 Volts / 0.12mA
             = 40K

So, from these calculations, a 40K resistor should
give me approximately 600
mA through a Darlington Pair NPN Transistor driven
by a PIC Pin.  Is this
correct?




Do you ever feel like an XT Clone caught in the
Pentium Pro Zone?

1996\07\12@132515 by myke predko

flavicon
face
Hi Mark,

I've got a few answers to your questions:

The Driver Circuit is:

               3 Volts
                  |
                  |
                |<
   o----220-----|       2N4403 PNP Transistor
   |            |\
   |              |
   |              |
PIC-o              o------ To Motor and 0.68 uF Cap in Parallel
   |              |        - Other Terminal of Motor has an
   |              |          Identical Circuit
   |            |/
   o----220-----|       2N4401 NPN Transistor
                |>
                  |
                  |
                  |
                 Gnd

All four Driver Circuits have a 10uF cap across 3Volts and Gnd for surge
protection.  Two of these circuits are used to drive the motor (one on each
motor terminal).

I've looked at the motors running on the PIC and I haven't seen any
significant brush noise (at least not compared to the 3-5 Volt Step Up).  I
will keep that in mind, however.

I was wondering about using N-Channel MOSFETs for this application.  Do you
have any recommendations for circuits?

Thanx for taking the time to read through the post and reply.  It's muchly
appreciated,

Myke

>>Does anybody have any hints on driving motors with the PIC?  I'm still
><snip>
>>The motor driver is an "H" transistor Driver (a PNP 2N4403 from 3 Volts
>>(battery) to a motor terminal to an NPN 2N4401 dropping the circuit to
Ground).
>>The Transistor bases are connected to a PIC driver via a 750 Ohm resistor.
>
>Are the collectors tied together (at the motor) and the bases tied together?
>This won't work.  I don't understand your circuit.  (I don't have the
magazine).
{Quote hidden}

Motor
{Quote hidden}

resistor for
{Quote hidden}

Do you ever feel like an XT Clone caught in the Pentium Pro Zone?

1996\07\12@132918 by myke predko

flavicon
face
For Power, I'm using two 1.5 volt dry cells for driving the motors and a
Linear Technology LT1111 which provides 5V to the PIC and I/R Receivers.
The Grounds are common.

Thanx for pointing out my error in the Darlington Calculation.  I don't know
what the start up current is -  I haven't been able to get a good
measurement of it.

Myke
{Quote hidden}

Do you ever feel like an XT Clone caught in the Pentium Pro Zone?

1996\07\12@134001 by Mark Jurras

flavicon
face
I need to do this in one of my apps. Can you point
me in the right direction for Application
assistance and manufacturers. Who's parts have you
used?

- -Mark

>>> Mark K Sullivan <TakeThisOuTmsullivanspamspamVAX.NIOBRARA.COM>
12 July 1996  12:16 pm >>>
- -snip- -
You should look into low-threshold MOSFETs, too.
MOSFETs don't need gate
current (except when switching) and won't need any
gate resistors in your
application.

- Mark Sullivan -

1996\07\12@161437 by Don McKenzie

flavicon
face
Mark Jurras wrote:
>
> I need to do this in one of my apps. Can you point
> me in the right direction for Application
> assistance and manufacturers. Who's parts have you
> used?
>
> - -Mark
> try:
http://www.cec.wustl.edu/~blw2/
They have some driver IC's and/or boards that make it simple.


Don McKenzie donmckEraseMEspamlabyrinth.net.au
DonTronics Tullamarine, Australia
http://www.labyrinth.net.au/~donmck

Picosaurus(tm) 40 pin PICBasic with 8 channels of A-D, and real Uart.
PIC Basic Compiler. Programmers from 15 USD.  Pic-Axe(tm) A New Tool.

1996\07\12@163817 by Mark K Sullivan

flavicon
face
I missed the fact that the PIC also has a 4.8V supply.  You *could* use this to
drive the base of an NPN high side driver, but I like the complementary version
better.

How about this:


                         3 Volts
                            |
                            |
                          |<
                o---------|       2N4403 PNP Transistor
                |         |\
                |           |
              |<            |
PIC---4.7K----|             o------ To motor, etc
              |\            |
                |           |
                |           |
    GND----78---o           |
                            |
                            |
    3V ----78---o           |
                |           |
              |/            |
PIC---4.7K----|             |
              |>            |
                |         |/
                o---------|       2N4401 NPN Transistor
                          |>
                            |
                            |
                            |
                           Gnd

As I suggested before, use the PIC software to insert appropriate delays (a few
10s of uSec) between turning of the PNP and on the NPN.  If you're short on I/O,
go ahead and tie the PIC ends of the 4.7Ks together like your original circuit.

Adjust drive by changing 78 ohm resistors.  I figured it for 600 mA of output at
Beta of 20.  This may be excessive (but I bet it'll work).  You could cut back
to, say 120 ohms, and conserve power.

I have used Zetex low threshold (aka logic compatible) N channel MOSFETS from
Digi-Key with good results.  I don't know if they have a suitable P channel.
Check also Supertex, Unitrode, Motorola, and IR.

- Mark Sullivan -

1996\07\12@174602 by Ben L Wirz

flavicon
face
       Dons right, we have just recently designed a Motor Driver board
that accepts TTL inputs and will control a wide range of currents
and voltages depending on which of the three configurations you use.
Bare double-sided printed circuit boards are available for $17.  This
board really makes it easy to get your motors up and running quick.  If
you would like more information, visit my WEB page at:
http://cec.wustl.edu/~blw2/index.html or email me and I will send it via
snail mail.  I also have the LMD18200 and L293D driver IC's available if
you want to homebrew your own.

H-Bridge Driver Board Specifications

Driver IC Configuration         L293D   L293    LMD18200

Characteristics
Number of Channels              2       2       2        per Board
Avg Drive Current, I avg        1.2     2       3        Amps per Channel
Peak Drive Current, I max       2.4     4       6        Amps per Channel
Min Drive Voltage, Vc/Vs        4.5     4.5     12       Volts
Max Drive Voltage, Vc/Vs        36      36      55       Volts

Features
Dynamic Braking                 No      No      Yes
Over Current Protection         No      No      Yes
Over Temp Protection            Yes     Yes     Yes
Over Temp Flag                  No      No      Yes
Current Feedback Output         No      No      Yes

Price for Complete Kit *        $27.00  N/A     $49.50
Price per Driver Chip           $4.00   N/A     $16.00
Price for Unpopulated PCB       $17.00  $17.00  $17.00

* Complete Kit Includes Driver IC's, PCB Board, and Connectors

Ben,

Ben Wirz                For Great Deals on Nitinol Wire, H-Bridge IC's,
Wirz Electronics        Polaroid Sonar Units, PIC 16C84's, and more
RemoveMEblw2EraseMEspamspam_OUTcec.wustl.edu      Hobbyist Robotic & Electronic Supplies, visit:
                       http://cec.wustl.edu/~blw2/index.html

On Sat, 13 Jul 1996, Don McKenzie wrote:

{Quote hidden}

1996\07\13@130625 by Mark K Sullivan

flavicon
face
I have used IRF7201, IRF7202 for logic level FETs.  I don't know if they have a
P channel.

- Mark Sullivan -

1996\07\15@025811 by Prashant Bhandary

flavicon
picon face
At 11:31 AM 12/07/96 EDT, you wrote:
>Does anybody have any hints on driving motors with the PIC?  I'm still
>trying to get my I/R Robot working and my biggest (and hopefully last)
>problem is with the motors.
>
>should eliminate the Port Power consumption problems.  Before I jump in and
>do this, I have a few questions:
>
>1.  Does anybody have experience with PNP Darlington Pairs?
>
>2.  Can I replace the "top" PNP with a NPN and make the motor terminal drive
>like a totem pole output?

How about using an L293 IC? They are a bit expensive but have 2 H bridges and
operate off logic level signals. I've used it successfully  to drive 1 amp
motors
using a PIC 16C84. Speed control is done with PWM which is what I did. They cost
about AU$15 and handle up to 600mA(1A on some versions).

Regards

Prashant
+----------------+  -------------------------------------------------
|                |    Prashant Bhandary
|   +---+        |    Spatial Information Systems Section
|   |   |        |    Roads and Traffic Authority
|   |   |        |    Rosebery NSW 2018, AUSTRALIA
|   |   |        |    Tel:  +61-2-662 5299
|   |   +----+   |    Fax:  +61-2-662 5348
|   |        |   |    Email: EraseMEprashbspam@spam@rta.nsw.gov.au
|   +--------+   |
| Still a newbie |    "2b|!2b" - William Shakespeare
+----------------+  -------------------------------------------------

1996\07\15@105932 by Mark K Sullivan

flavicon
face
The L293 is a good part but will not work with 3V supplies.  You might find a
brushless motor driver (three half-bridges) for this power supply but I don't
know of one of the top of my head.

- Mark Sullivan -

'More on Driving Motors'
1996\07\15@115018 by myke predko

flavicon
face
Well, I spent the weekend doing what I probably should have been doing right
from the start, trying to understand how Motors work under Digital Control
and understanding how the transistors work when they are driving motors.

Going right from the start, I measured two AA Cells in series at 2.9 Volts
(which is what I want to use for driving the motors).  Maximum (Short
Circuit) current was 750 mA for Alkiline Cells and 7.6 Amps for NiCads.

I then looked at the motors and found that they run with no load at 160 mA
with a stalled current of 450 mA.  When the motors are in the Tamiya "Tank"
application, they require between 250 mA and 400 mA when running (according
to my DMM).

I tried to characterize the noise produced by the motors, but didn't have a
lot of luck, I will be putting a Resistor and Capacitor (in Series) across
the motor terminals, does anybody have any recommendations on what values
should be used?  The PIC does seem to run fine with the motors running with
the negative voltage common to the PIC and the motors.

In terms of the LM1111 Step-Up Power supply, I found that it produced a 200
mV noise spike on Gnd and a 500 mV spike ( very fast rising edge with
something that looks like a R/C decay on the downward side).  As I've
indicated, the noise produced by both the Step-Up Power Supply and the
motors does not seem to bother the PIC when the negative voltages (grounds)
are common.

In characterizing the Transistor controls, I found that using 2N7000
N-Channel FETs (in a TO-92 package) would give me a 2.7 Volts for the Motor.
Using the 2N4403/2N4401 as suggested in the article gave me 1.8Volts for the
Motor.

Now on a proto-board, I then tried running a motor.  With the Bipolar
(2N4403/2N4401) combination, I could *never* get the motor to run.  I found
that the PNP 2N4403s could source 300 mA of current, but the NPN 2N4401s
that I had couldn't source more than 100 mA of current.  The 2N4403s could
also drive the motor when it was put back into the Tamiya "Tank" kit (with
Gearbox and drive motors).  On both devices, when tested on my DMM, I got a
Hfe of approximately 150.

Next, I then used the 2N7000 N-Channel FETs.  In the catalog and supplier I
ordered the parts from (Electrosonic, here in Toronto), the FETs are rated
at 500 mA.  Using two FETS in a totem-pole arrangement to drive the unloaded
motor worked fine, but when I put the Motor back into the "Tank" and drove
the application, the motor worked for a few seconds until the transistor at
the "top" (between the motor and the positive voltage) literally exploded.
I tried it again and terminated the experiment when the replacement
transistor got hot (about a second after 5 Volts was applied to the gate).
Looking in the Digi-Key catalog, I see that these devices are rated for only
300 mA.

One interesting thing with the FETs, when I first put them into the circuit
(with the gates floating), the motor started running (ie current was going
through the FETs) at about half the speed they would be when hooked up to
the batteries directly.  When I put the gates on 5 Volts the motor would run
at full speed, and when the gates were at 0 Volts, the motors would stop.
Interestingly enough, when I disconnected the gate from the voltage rails,
the motors would continue operating as if the voltage (or lack of) was still
applied.

Where am I now?  Well, I think I will be going with the FETs (once I find a
truly 1 Amp capable device) - not requiring the load resistor is an
advantage for me (less wiring in an application that is hand-wired).  I'm
curious to find out why the 2N4401s can only source/sink so little current
although I'm not going to knock myself out, if anybody knows why, please
post it here.

I'm also surprised at the number of different parameters different catalogs
give for different devices.  For the 2N440x, I have two different catalogs
giving a HFe of "at least" 100 and "nominal" or 200 as well as a current
rating of 600 mA and 500 mA for both.  For the 2N7000, I have a current
rating of 500 mA and 300 mA.  Does anybody have any comments on this.

As for the original article (the "Runabout Robot"), I realize that I should
have known better (especially in light of some of my previous experiences)
to take it at face value, but I did because of my limited experience in
driving motors (I've now got a whole bunch more).  With this project, I have
not been able to locate the specified Step Up Voltage convertor (the Maxim
756), I have not been able to get the code to assemble or run (It has
Microchip mnemonics, but won't run under MPASM without a LOT of
modifications and once I got it to run, I couldn't get it to read I/R data
at all), and now I have had to redesign the motor drive section.

What is that latin phrase?  "Caveat Emptor?"

Once I get some 1 Amp capable FETs and try them out I'll let you know what's
going on.

Thanx for all the replies and suggestions,

Myke

Do you ever feel like an XT Clone caught in the Pentium Pro Zone?

1996\07\15@123047 by Mark K Sullivan

flavicon
face
1 Amp FETS
Try IRF7201 or 7101 and Zetex ZVN4306A, both available from Digi-Key.  I've had
good luck with both, driven direct from PIC I/O.  I can't suggest complements,
though.  I have only used the N-channel ones.

Exploding 2N7000
The 2N7000 is probably too small.  Your immediate problem wasn't too little
current capacity, though, but too little power handling capability.  It exploded
because it did not have enough gate voltage (relative to source).  I assume it
saw 4.8V-3V where the bottom one saw 4.8V.  With less gate voltage than required
for minimum on resistance (equivalent to saturation of a bipolar), it is a
resistor and heats up according to I*I*R.  This is the advantage of a
complementary drive circuit.

Two NiCds are only going to give you 2.4 V nominal, and less in practice.  It
will be real hard to make this work.  NiCds have flatter discharge, though.
This means less loss of terminal voltage toward end of discharge cycle.  You
should be thinking about what happens to the battery voltage as the batteries
run down.  By the way, this would all be much easier with 4 NiCd or 3 alkaline
cells.

Motor snubbers:
Try 4.7 to 10 ohm in series with .1uF.  Keep leads short or it won't do any
good.  Use stacked film cap or monolithic ceramic.

200mV on the power supply is not too bad but 500 or 700 (between rails) is
marginal.  The type of capacitor you use on the output of the step-up is
important.  It should have low ESR or low inductance.  Also, paralleling smaller
value capacitors is better than one large one.  You may just need fatter and/or
shorter power conductors.

Motor runs with FET gate open.
Unlike bipolar transistors which (more or less) operate from a current into the
base and therefore will (more or less) turn off when unconnected, FETs are
controlled by the voltage on the gate.  The gate is like a capacitor.  What you
saw is that, once you charge up the capacitor, it stays charged (and therefore
turned on) until the charge can leak away.  When you first hooked up the FETs,
they had a residual charge on the gate, mayeb just from being handled.

1996\07\15@131912 by Martin J. Maney

flavicon
face
On Mon, 15 Jul 1996, myke predko wrote:

> I then looked at the motors and found that they run with no load at 160 mA
> with a stalled current of 450 mA.  When the motors are in the Tamiya "Tank"
> application, they require between 250 mA and 400 mA when running (according
> to my DMM).

> Using the 2N4403/2N4401 as suggested in the article gave me 1.8Volts for the
> Motor.

Without a source of base current on the order of 1/10 the required
collector current, bipolar transistors are not going to be operating in
saturation.  A monolithic darlington would make the design easy but with
somewhat higher voltage drop; OTOH, it wouldn't "waste" the output's base
current.  Either approach could be made to work with some small pros &
cons, but with a 450 mA stall current I'd suggest the 4401/03 are a bit
marginal.  I'd probably reach for a TIP29/30 for this - they're cheap and
readily available (okay, I almost certainly have a couple in the parts
bin, and this does influsence me <grin>).

> Gearbox and drive motors).  On both devices, when tested on my DMM, I got a
> Hfe of approximately 150.

That Hfe measurement is meaningless for use as a power switch - you're
measuring it at a very low current and far from saturation.  The actual
beta will be lower when (trying) to drive the motors both because of the
much higher collector current and the lower (ideally under 700mV) C-E
voltage.

> motor worked fine, but when I put the Motor back into the "Tank" and drove
> the application, the motor worked for a few seconds until the transistor at
> the "top" (between the motor and the positive voltage) literally exploded.
> I tried it again and terminated the experiment when the replacement
> transistor got hot (about a second after 5 Volts was applied to the gate).
> Looking in the Digi-Key catalog, I see that these devices are rated for only
> 300 mA.

It could be that these particular FETs are underrated for this
application, but the immediate cause of the high-side deriver's
destruction is almost certainly that the gate drive voltage wasn't high
enough.  This has a similar effect to insufficent base drive in bipolars:
the device isn't solidly turned on, so it drops more voltage and
therefore disspiates more power than it needs to - or, in this case, than
it can stand to!

> I'm also surprised at the number of different parameters different catalogs
> give for different devices.  For the 2N440x, I have two different catalogs
> giving a HFe of "at least" 100 and "nominal" or 200 as well as a current
> rating of 600 mA and 500 mA for both.  For the 2N7000, I have a current
> rating of 500 mA and 300 mA.  Does anybody have any comments on this.

These are loosely-spec'd parts to begin with.  The only things that are
actually in disagreement in the above list are the current ratings, and
those could be due to the rating being at different conditions.  One
might be an absolute maximum and the other a reccomended design maximum, etc.

'Driving Motors - Help!'
1996\07\15@141641 by Reginald Neale

flavicon
face
>At 11:31 AM 12/07/96 EDT, you wrote:
>>Does anybody have any hints on driving motors with the PIC?  I'm still
>>trying to get my I/R Robot working and my biggest (and hopefully last)
>>problem is with the motors.

You might want to look at the Motorola MC33030 chip. Microcontroller
interfacing isn't exactly what it was intended for, but it is designed to
drive small motors and has a lot of support stuff built in. I believe it's
less than US$5.

.....................Reg Neale.....................
"Ignorance is a renewable resource"   P.J. O'Rourke

'More on Driving Motors'
1996\07\15@173104 by myke predko

flavicon
face
Mark,

Thanx for your very detailed reply, it really helped me understand what was
going on.  I'm going to try complementary pair FETs and see how that works
(mostly for my own curiosity).

>
>200mV on the power supply is not too bad but 500 or 700 (between rails) is
>marginal.  The type of capacitor you use on the output of the step-up is
>important.  It should have low ESR or low inductance.  Also, paralleling
smaller
>value capacitors is better than one large one.  You may just need fatter and/or
>shorter power conductors.

I don't think I explained what was happening here properly.  The Step-Up
Power Supply is providing a solid 5 volts, the spike is going from 5 to 5.5
Volts and looks like:
          |
    ______|\_________

on the scope (hopefully the ASCII art isn't too bad).  At the same time as
the spike, there is a 200 mV spike on the "Ground".  I don't know how much
this affects things; as I've said, the PIC currently runs very solidly with
the two I/R Receivers and the motor running (to put noise in the system).

Thanx again for your answers,

Myke

Do you ever feel like an XT Clone caught in the Pentium Pro Zone?

1996\07\15@175451 by Paul Smith

flavicon
face
At 05:16 PM 15/07/96 EDT, myke predko wrote:

>Power Supply is providing a solid 5 volts, the spike is going from 5 to 5.5
>Volts and looks like:
>           |
>     ______|\_________
>
>on the scope (hopefully the ASCII art isn't too bad).  At the same time as
>the spike, there is a 200 mV spike on the "Ground".  I don't know how much
>this affects things; as I've said, the PIC currently runs very solidly with
>the two I/R Receivers and the motor running (to put noise in the system).
>
---- and also----
>The PIC does seem to run fine with the motors running with
>the negative voltage common to the PIC and the motors.

Can you explain how the power supplies to the motors and PIC are organised
and connected?  Are both supplies referenced and tied to the same common (-)
rail?  It would also be helpfull if you can indicate where in this setup
your scope was placed, specially the ground reference point for the scope.

It appears you may be seeing some induced emf in the ground plane, or I^2xR
losses, caused by the high current drain of the motors.

Paul.

1996\07\15@202258 by Steve Hardy

flavicon
face
I haven't tried this, but if you are getting insufficent gate drive on
a FET, this could be increased by use of a small cell (say silver
oxide) to boost the applied voltage in the right direction.  The cell
should last for its entire shelf life.  The small charge/discharge
spikes as the FET gate is discharged/charged should not be a problem.

Another untested option is to use a charge pump to charge a capacitance
connected between the driver and the gate.  This requires an initial
'priming' of the charge at power up, and the occasional transition to
maintain the charge:

             C1                      --- Isink
        -----||----------------      |
        |                     |   ||--
Drvr ----+->|--+->|--->|--->|--+---||
              |  N-1 diodes       ||--
             ---                     |
             --- C2                  |
              |                     GND
             GND

( >| represents a diode with drop of 0.5V)

In general, V(C1) will be Drvr(hi) - Drvr(lo) - N*0.5  where N is the
total diode string length.  The FET must be chosen so that the
available gate swing is enough to bias the fet fully off and on.
The capacitance should be chosen so C(FET) << C1 << C2.

A similar network is used for the high side (P-channel) device.

On the subject of charge pumps, if you have a spare PIC pin, you could
use it to drive a charge pump (3 stage, to get 12-14V) or even a tiny
SMPS - much like what your LT1111 is doing.  This supply is then used
to drive the gates via a suitable level shifting transistor.  Yes, this
_is_ totally off the planet, but no-one ever said motor control was
easy - look at the prices of motor control chips!

Regards,
SJH
Canberra, Australia

1996\07\15@222207 by ay McGregor

flavicon
face
Steve Hardy wrote:

{Quote hidden}

I particularly like the ingenuity of this approach - but, with due
deference to Steve, I suspect the above circuit will be slow in turning the
motor OFF and that discharge resistors (R1,R2, below) will be needed, plus
more regular pulsing to maintain the ON voltage. A capacitor from gate to
source *might* also be necessary.

             C1                      --- Isink
        -----||----------            |D
        |               |         ||--
Drvr ----+->|--+----+->|-+->|--+---||
              |    |          \  G||--
             ---   \          /      |S
         C2  --- R1/        R2\      |
              |    \          |      |
              |    |          |      |
              +----+----------+------+-GND

Lots of scope for experimentation here!

Cheers,   Murray




From:                      !!!!!!!!
                          |      |
Murray McGregor           | (o)(o)
Education Department      C     _)   ZZ
University of Otago       | ,___|     ZZ  |\      _,,,---,
Dunedin, New Zealand.     /   /        zz /,`.-'`'    -.  ;_.
Ph (64)(3)479-8801       /____\          |,4-  ) )-,_. ,\ (-.:,_
======================oOOo=======oOOo===='---''(_/--'==`-'\_)=`'-'==

'Driving Motors - protection diodes'
1996\07\15@224050 by Bryan Hord

flavicon
face
You may need some protection diodes.  Motors create a lot of back EMF when
turned off.
This would be especially true if the bases were driven from separate port
pins where there is  a delay between the drive of the two transistors.

{Quote hidden}

@spam@bryanspam_OUTspam.....wllink.com

'More on Driving Motors'
1996\07\15@231438 by Steve Hardy

flavicon
face
> From: Murray McGregor <spamBeGonemurray.mcgregorEraseMEspamstonebow.otago.ac.nz>> > Steve Hardy wrote:
>
> >Another untested option is to use a charge pump to charge a capacitance
> >connected between the driver and the gate.  This requires an initial
> >'priming' of the charge at power up, and the occasional transition to
> >maintain the charge:
> >[cut]
>
>  I particularly like the ingenuity of this approach - but, with due
> deference to Steve, I suspect the above circuit will be slow in turning the
> motor OFF and that discharge resistors (R1,R2, below) will be needed, plus
> more regular pulsing to maintain the ON voltage. A capacitor from gate to
> source *might* also be necessary.
> [cut]

At the risk of getting a bit off-topic, I should have made it clearer
that the OFF state of the FET is achieved at Drvr(low)+boost voltage
(2V in the example).  The FET will switch just as fast as the driver
can drive its gate capacitance, so long as C1 >> C(fet).  It does not
depend on leakage through a resistor to switch off, especially since
any FET worth its silicon will retain its gate charge for at least a
few minutes if open circuit.  Most VMOS N-ch fets will be off if their
gate voltage is <= 2-3V with respect to source.

A cap from G-S would worsen a bad situation, since the C looking into
the gate is already multiplied by the Miller effect in common source
configuration.

By the way, a string of 3 silicon diodes could be replaced with one
LED for the purpose of voltage drop.

Regards,
SJH
Canberra, Australia

1996\07\15@235245 by Lee Jones

flavicon
face
> I spent [time] trying to understand how Motors work
>
> I then looked at the motors and found that they run with no load at
> 160 mA with a stalled current of 450 mA.  When the motors are in the
> Tamiya "Tank" application, they require between 250 mA and 400 mA
> when running (according to my DMM).

Good start.  When you say "Tamiya Tank", you must mean the little
toy tracked vehicle with a single gear box -- right?o

Tamiya also has 3 different 1/16 tank models (as I recall) for radio
control with (I think) dual motors, seperate gear boxes, and tracks
with individual links.  They're about $300 for each model.  But these
motors draw 5-20 amps at 7VDC -- in other words, small fractional
hoursepower in a 1" cylinder that's 2" long.  Electronic speed controls
(ESC) for them use multiple power FETs.  Check the R/C car magazines
for lots of ideas.  R/C hobby shops are a convenient source of parts.


> I tried to characterize the noise produced by the motors, but didn't
> have a lot of luck

I've worked with and read about electronic speed controls for R/C cars.
All require capacitors on the motor.  Usually the caps are supplied by
the ESC vendor, so I don't know the size.  In the one ESC instruction
sheet I have handy, it just states "monolithic capacitors" between each
motor terminal and the metal motor can.  From the physical size, 0.1uF
ceramic looks about right.


> 2N4403/2N4401 transistors [...] On both devices, when tested on my
> DMM, I got a Hfe of approximately 150.

At what current?  If measured on a handheld DMM, I'd bet it's at very
low amperage.  Measure base current and collector current when it's
driving the motor (under load, make it generate some torque), do the
division, and get a real beta.  Repeat for several sets for range.
Then derate somewhat to guarantee saturation.

There's been another post on this (transistor gain under load).


> I'm also surprised at the number of different parameters different
> catalogs give for different devices.

Go get the manufacturers data sheets.  Then use the worst case data
(not the nominal values).
                                               Lee Jones

-------------------------------------------------------------------
Jones Computer Communications             leespamBeGonespamfrumble.claremont.edu
509 Black Hills Dr, Claremont, CA 91711         voice: 909-621-9008
-------------------------------------------------------------------

'More on Driving Motors - Responses'
1996\07\16@095659 by myke predko

flavicon
face
Thanx to everybody that has responded.  I guess I've got a few questions to
answer.

The first is how the wiring is done, hopefully, you'll get an idea from this
block diagram:

      o--------------------o------------------o o--------------o-- + 5 Volts
      |                    |                  | |              |
      _   +               ---                 ---             ---
     | |                 |   | 2x Motor &    |   | LT1111    |   | PIC &
      -   2x AA Cells    o-O-o "H" Bridge    |   | Step-Up   |   | I/R Rx'rs
     | |                 |   | Switches       ---             ---
      -   -               ---                  |               |
      |                    |                   |               |
      o--------------------o-------------------o---------------o-- - Common

I'm not sure about Induced EMF on the - Common Line, I've made it as simple
and common as I could (the same for the Positive Voltage Rails).  As well,
there is a 10 uF cap between +3V Gnd and a 47 uF cap between +5V and Gnd (as
specified in the Linear Tech Datasheet).  I'm using a vero-board for the
soldered prototypes (where I've taken all the measurements from), so the
Power Rails are literally just that.

The Tamiya Tracked Vehicle is not one of their R/C kits.  It's actually a
kit that Tamiya puts out for people to develop their own models.  It
consists of a rubber track segments (not individual links) that can be put
together to get different track lengths, a variety of different sproketed
and smooth wheels, an electric motor and a gearbox.  The purpose is to allow
somebody to create a simple tracked vehicle with one motor driving two
treads.  The kit itself contains a piece of hardwood (oak, I think) for
mounting the motor, wheel axels on as well as a battery block and control.
For this project, I have taken the motor and gearbox out of one kit and put
it on the other to provide individual control and power on both tracks.  Two
AA Alkaline cells can easily drive the two tracks (although I'm not too sure
of the life expectancy) - I was planning on using NiCads because of their
higher current capabilities and the fact that they can be recharged.  Other
than the drag the gearbox and the tracks put on the motor (resulting in the
higher operating current), it is working very well.  The cost of each kit
was $8 (Canadian), so they're pretty inexpensive to play with.

Yesterday at a surplus store, I bought some 2N3820s and 2N3819s and was told
that they were "P-Channel" and "N-Channel" FETs, respectively.  Does anybody
have any information on these?  My handy ECG catalog indicates that the
2N3819 is a N-Channel FET, but it works more like a PNP Transistor
(including a measured HFE of 650) it gets very hot unless I attach a
resistor (I'm using a 220 Ohm) to the "gate".  As for the 2N3820, I'm not
getting any response other than the LED (which I am using to check for
On/Off) is on all the time.  I'm really confused by this because I can go
back and check these devices operation wiht that of the 2N7000, and the
latter device works exactly as I expect.

My next move is to order some known good parts from Digi-Key and work from
there.

More news as it happens,

Myke

Do you ever feel like an XT Clone caught in the Pentium Pro Zone?

1996\07\16@103229 by Mark K Sullivan

flavicon
face
The 2N3819 is a JFET (J for Junction).  Instead of an oxide insulator providing
the gate isolation, as in a MOSFET (i.e. 2N7000), it uses a reverse-biased
junction.  If you put the wrong polarity on the gate, this junction conducts.  I
don't know what a 2N3820 is.

- Mark Sullivan -

'More on Driving Motors - Responses -Reply'
1996\07\16@111221 by Mark Jurras

flavicon
face
Myke et al,

I just had a thought about driving your motor switch BJT/FET's. Can you get
around your PIC drive problems by using some Opto-Isolators (Look under
Opto-isolators in Digi-key)? The PIC can drive the led's and the transistors
can switch the power transistors?

- -Mark

1996\07\16@145320 by myke predko

flavicon
face
Big Argghhh...  I *knew* I should have looked into this deeper - strangely
enough, the ECG catalog I have doesn't note that it's a JFET, just notes
that it is a n-channel FET.

Yes, all I wanted to use was a MOSFET.  I've got some p-channel MOSFETs as
well as high current (ZVN4306) n-channel MOSTFETS on order from Digi-Key, I
should have them tomorrow, and I'll post what I find on Thursday.

Mark, Thanx for pointing that out.  Boy, do I feel dumb :^(

Myke
>The 2N3819 is a JFET (J for Junction).  Instead of an oxide insulator providing
>the gate isolation, as in a MOSFET (i.e. 2N7000), it uses a reverse-biased
>junction.  If you put the wrong polarity on the gate, this junction
conducts.  I
>don't know what a 2N3820 is.
>
>- Mark Sullivan -
>
>

Do you ever feel like an XT Clone caught in the Pentium Pro Zone?


'Driving a speaker directly with a PIC'
1997\04\07@041614 by wterreb
flavicon
face
I've got a simple question, but would really welcome some comments by
other people who had similiar experience.

I'm using a PIC in a battery operated device, and amongst other the
PIC must output some sound on a speaker.  My question is... how do I
increase the sound volume without draining too much extra power.   My
current method is to use two I/O pins that would always reverse polarity
and thus give you evectively 10Vpp swing across the leads of the
speaker. And yes, I do have a capacitor in series to protect the I/O
pins!  :)

However I find that the sound is still not loud enough.  Would it
help to rather use a transistor to drive the speaker?  Would internal
impedance mismatch with speaker have a great influence on the volume?
Is there any type of small amplifier that runs of the 5V supply that
someone can recommend?

I will appreciate  some advice.

Rgds
Werner
--
Werner Terreblanche     http://www.aztec.co.za/users/werner
RemoveMEwterreb@spam@spamspamBeGoneplessey.co.za (work)  OR  .....werner@spam@spamEraseMEaztec.co.za  (home)
Plessey SA, PO Box 30451,Tokai 7966, Cape Town, South Africa
or at home : Suite 251, PostNet X5061, Stellenbosch, 7599
Tel +27 21 7102251  Fax +27 21 7102886  Home +27 21 8872196
------------------------------------------------------------

1997\04\07@064734 by OU=COMPUGROUP_CN=RECIPIENTS_CN=EHE

flavicon
face
Use a high-impedance speaker together with a small transformer.
Or, if your sound frequency doesn't vary very mutch, use a piezo
transducer in parallel
with an impedance of some mH.
I 've used this for an alarm device. Produces VERY loud sounds.

{Quote hidden}

1997\04\07@205854 by Steve Hardy

flavicon
face
> From: Werner Terreblanche <spamBeGonewterrebKILLspamspam@spam@plessey.co.za>
> I'm using a PIC in a battery operated device, and amongst other the
> PIC must output some sound on a speaker.  My question is... how do I
> increase the sound volume without draining too much extra power.   My
> current method is to use two I/O pins that would always reverse polarity
> and thus give you evectively 10Vpp swing across the leads of the
> speaker. And yes, I do have a capacitor in series to protect the I/O
> pins!  :)
>
> However I find that the sound is still not loud enough.  Would it
> help to rather use a transistor to drive the speaker?  Would internal
> impedance mismatch with speaker have a great influence on the volume?
> Is there any type of small amplifier that runs of the 5V supply that
> someone can recommend?

I had a similar problem for outputting DTMF tones from a small 8 ohm
speaker.  My solution was to use a small transistor radio transformer
(1K : 8 ohm).  I used one PIC (PWM out) pin coupled via a 1uF cap,
however using two pins in opposition would provide a better impedance
match, and twice the power.  Most of the loudness is obtained by
correct baffling of the speaker.  I cut a hole in the PCB the same
diameter as the speaker (about 40mm) and epoxied the speaker in place.

If this still isn't loud enough then NSC makes some 8-pin DIP amplifiers
that should do 200mW easily.  Check out their web page (which is one of
the better semiconductor sites).  Then again, if you are only interested
in square wave drive then a PNP/NPN combo with common base and common
emitter should give about 100mW into 8 ohms.

Regards,
SJH
Canberra, Australia

1997\04\08@011313 by tjaart

flavicon
face
Steve Hardy wrote:
{Quote hidden}

If battery life is very important, you have to use a bridge - type
driver. (Like you are using now)

--
Friendly Regards

Tjaart van der Walt
spamBeGonetjaart@spam@spamwasp.co.za
_____________________________________________________________
| Another sun-deprived R&D Engineer slaving away in a dungeon |
|             WASP International  http://wasp.co.za           |
|             GSM and GPS value-added applications            |
|  Voice : +27-(0)11-622-8686   |   Fax : +27-(0)11-622-8686  |
|_____________________________________________________________|

1997\04\09@095158 by Scott Horton

flavicon
face
=->Use a high-impedance speaker together with a small transformer.
=->Or, if your sound frequency doesn't vary very mutch, use a piezo
=->transducer in parallel
=->with an impedance of some mH.
=->I 've used this for an alarm device. Produces VERY loud sounds.

I, also need a "beeper" driven by my PIC.  I also need something loud as
possible.

I'm and ME and no Electronics guru by any stretch.  Is there any chance
that with some blatant begging (please, please <g>) I could get you to give
me some details on what you described?  Size/value of inductor and piezo
would be a big help.  I use digikey, mouser (and others) here in the U.S.
for suppliers.  If you could recommend any specific part #'s that, too
would be greatly appreciated.

     |--|--|
     |  |  |
PIC|--|  I  P
  |     I  P    P=piezo
  |     |  |    I= inductor
        G  G    G= ground

Is the above right or should I go between PIC pins like Werner was doing
for a bigger swing with his speaker?  PIC's internal diodes enough for
protection from the inductor?

Pulse the pic pin on/of at some frequency.  What duration/width?

Thanks very much for any help you can give.

Scott

1997\04\09@152904 by peter

flavicon
face
I have not tried this but if your going to use a
peizo it may be worth trying a trigger transformer,
the type used in strobe lights
They are very small and have a ratio of around 25:1
and cost less then a dollar.

ie: 5V = 125V
should be worth a try

Peter Cousens
RemoveMEpeterEraseMEspamKILLspamcousens.her.forthnet.gr

1997\04\10@223439 by wterreb

flavicon
face
Thanks to Dmitry Kiryashov <spamBeGonezewsspam_OUTspamRemoveMEaha.ru>, Peter Cousens
<.....peterspamRemoveMECOUSENS.HER.FORTHN
Kalle Pihlajasaari <kallespam@spam@device.data.co.za> and everyone else that
contributed with advice on getting more volume from a speaker.  I got some
good ideas to try out now.

Rgds
Werner
--
Werner Terreblanche     http://www.aztec.co.za/users/werner
EraseMEwterrebRemoveMEspamSTOPspamplessey.co.za (work)  OR  RemoveMEwernerKILLspamspamTakeThisOuTaztec.co.za  (home)
Plessey SA, PO Box 30451,Tokai 7966, Cape Town, South Africa
or at home : Suite 251, PostNet X5061, Stellenbosch, 7599
Tel +27 21 7102251  Fax +27 21 7102886  Home +27 21 8872196
------------------------------------------------------------

'Driving Multiplexed LCD'
1997\04\30@104604 by Bill Collins

flavicon
face
I have implemented the multiplexed LCD drive described in the microchip
app note (BTW, if you need low power, it works fine with 1Meg
resistors), but I would like some feedback on a slightly different
method that requires fewer pins.

Microchip suggests connecting resistors to two output pins:

Pin #1 ---
         |
         R
         |
         ---------  LCD Common
         |
         R
         |
Pin #2 ---

Three voltages can be generated:
Pin #1 Pin #2  Voltage
HI      HI      Vcc
LO      LO       0
HI      LO      Vcc/2

I would like to do the following:



       Vcc
        |
        R
        |
Pin -----O-------- LCD Common
        |
        R
        |
       GND

The same voltages would be generated as follows:

Pin       Voltage
HI          Vcc
LO           0
TriState    Vcc/2

Other than the resistors needing to be small in relation to the output
pin leakage when it is tri-stated, does anyone see any problems with
this?

Bill

1997\04\30@222714 by John Payson

picon face
>>
I have implemented the multiplexed LCD drive described in the microchip
app note (BTW, if you need low power, it works fine with 1Meg
resistors), but I would like some feedback on a slightly different
method that requires fewer pins.
<<
Hmm... which app note is that?  I have a different technique altogether,
though mine is limitted to 3:1 multiplexing but requires minimal extra junk.
In addition, there are two resistor-based approaches which work pretty well
(one of which you described).

The 1/2 bias method of LCD drive, in which inactive row wires are driven to
half-rail while all rows are driven to the rails works decently for 2:1 drive,
mediocrely for 3:1 drive (my technique works as well with no added resistors
or extra port pins), and poorly for 4:1 or beyond.  A better approach for
larger matrices is to use two extra port pins and 2*(#rows+#columns) resistors.
If your two extra outputs are X and Y, then the resistors should be chosen such
that if X is low and Y is high, the bias on the unused columns will be twice
that of the unused rows (note that in the 2:1 case above, the bias on the un-
used rows is half-rail and the bias on the unused columns is full-rail).  As
for what that voltage should be, the *best* answers are:

For 2:1 multiplex, inactive columns should be at 0.414 VDD.
For 3:1 multiplex, inactive columns should be at 0.366 VDD (nb: most display
 controller chips, including the 16C924, use 0.333 Vdd, but 0.366 is better).
For 4:1 multiplex, inactive columns should be at 0.333 VDD.
For 5:1 multiplex, inactive columns should be at 0.309 VDD.

Note that the 1/3 bias which is commonly used in display controllers is ade-
quate for most small multiplex ratios (8:1 or below) even though it's not
quite optimum; for larger displays, the 1/3 bias is much inferior.  On a 16:1
display, for example, the contrast-squared ratio is 1.5 with a 1/3 bias and
1.667 with a 1/5 bias.  On a 64:1 multiplex, the contrast-squared ratio is
1.125 with a 1/3 bias and 1.285 with a 1/9 bias.

Attachment converted: wonderland:WINMAIL.DAT 2 (????/----) (0000EED9)


'Driving ADC1203x from PIC'
1997\09\01@110555 by Alex Barrett
picon face
Has anyone got experience of driving the NatSemi ADC1203x family of
converters using a PIC? I'm using a 16C65A to drive an ADC12034 via the SPI
bus. Any advice, code fragments, pitfalls would be appreciated.

* spamBeGoneAlex_Barrettspam@spam@iee.org
Robert Cooke Electronics, Norwich, UK


'Driving steper motors'
1997\11\30@134252 by Steve Smith
picon face
Does anybody have a simple routiene for driving steper motors (never done it
before) for PIC16CXX

I have found some incredably tiny ones in a viedo camera focousing unit they
are abut 8mm diameter x 10mm long with a coil resistance of 43R per winding I
think that they could be driven directly form a pic or certainly with a 74
line driver from 5V or maybe 3V
An idea from a friend about a Magic trick provoked the design of a realy tiny
XY device that moves a tiny magnet and fits into a small book Driving the
stepers is the remaining hurdle between an Idea and a working illusion.

1997\11\30@140913 by Herbert Graf

picon face
-----Original Message-----
From: Steve Smith <RemoveMEXYGAXspam_OUTspamAOL.COM>
To: PICLISTspamspamMITVMA.MIT.EDU <spam_OUTPICLISTspam_OUTspamspam_OUTMITVMA.MIT.EDU>
Date: Sunday, November 30, 1997 13:46
Subject: Driving steper motors


>Does anybody have a simple routiene for driving steper motors (never done
it
>before) for PIC16CXX


   Don't have routines for the PIC (I only have some weird ones for the PC)
but it is pretty basic, depending on the stepper. The easiest one to drive
has four windings, to step, just put power into every winding one at a time
in the right sequence, usually you can find the right sequence with a
battery. Then for the PIC, just toggle the correct pins on and off in
sequence, inserting a delay between each step to account for the physical
speed of the motor, for a pic the delay would probably be kinda large. Of
course if you have one of the other motors, there is more electronics
outside of the PIC involved. TTYL

>I have found some incredably tiny ones in a viedo camera focousing unit
they
>are abut 8mm diameter x 10mm long with a coil resistance of 43R per winding
I
>think that they could be driven directly form a pic or certainly with a 74
>line driver from 5V or maybe 3V
>An idea from a friend about a Magic trick provoked the design of a realy
tiny
>XY device that moves a tiny magnet and fits into a small book Driving the
>stepers is the remaining hurdle between an Idea and a working illusion.

'Driving stepper motors'
1997\11\30@141327 by Stephen H Alsop

flavicon
face
Magenta Electronics in the UK advertise a small pic project with code,
parts and pcb for stepper motors, using pic84 + 3 mosfets

They advertise in the UK EPE magazine, which is at
http://www.epemag.wimborne.co.uk

(the mag is an excellent hobby mag and worth looking at)

I would like to try the small stepping motors - where did
you buy them from?

Stephen H Alsop    stevespam_OUTspams.ssystems.easynet.co.uk
S&S Systems Ltd   http://easyweb.easynet.co.uk/~s.ssystems

----------
> From: Steve Smith <RemoveMEXYGAXKILLspamspam@spam@AOL.COM>
> To: PICLISTspamBeGonespam.....MITVMA.MIT.EDU
> Subject: Driving steper motors
> Date: 30 November 1997 18:42
>
> Does anybody have a simple routiene for driving steper motors (never done
it
> before) for PIC16CXX


'[OT] Small stepper motors (Was: Re: Driving steper'
1997\12\01@035230 by ht
flavicon
face
At 13:56 30.11.97 -0500, you wrote:
>>I have found some incredably tiny ones in a viedo camera focousing unit
>they
>>are abut 8mm diameter x 10mm long with a coil resistance of 43R per winding

I have been looking for small stepper motors.  The smallest motor I have
found, has a diameter of 8mm and a length of 16mm.  Does anyone know where
to by stepper motors that are smaller than this one? I have seen them in
some lenses, so they have to be ot there...

Regards,
Havard
------------------------------------------------
HŒvard T¿rring
KILLspamhtspam.....neo.no    spam_OUTxplisitspamKILLspamneo.no    RemoveMEsimplisitRemoveMEspamEraseMEneo.no
Norsk Elektro Optikk A/S       Tel: +47 67974700
PoBox 384                      Fax: +47 67974900
1471 SkŒrer.
Norway

1997\12\01@082337 by Ivan Cenov

flavicon
face
Hi,

Small stepper (and DC) motors has Portescap
The address is
       157, rue Jardiniere
       CH-2301 La Chaux-de-Fonds 1
       tel. +41/(039) 256 590
       Fax: Marketing +41/(039) 256 596
       Export division: +41/(039) 256 594

or
       Portescap Scandinavia AB
       Grev Turegatan 20
       S-114 46 Stockholm
       tel: +46/(08) 661 05 05
       fax: +46/(08) 661 40 12

OR
MINIMOTOR SA
       Staubo Elektro-Maskin a.s.
       Postboks 38
       Bryn
       N-0611 Oslo 6
       Tel: 22 64 83 20
       fax  22 64 39 82

Minimotor has motors with shaft diameter 1.5 mm.

Ivan Cenov OKTO-7
KILLspamokto7spamspamBeGonebotev.ttm.bg

----------
{Quote hidden}

1997\12\01@094403 by John Shreffler

flavicon
face
part 0 964 bytes
-----Original Message-----
From:   HŒvard  T¿rring [SMTP:spamBeGonehtspamNEO.NO]
Sent:   Monday, December 01, 1997 3:16 AM
To:     spam_OUTPICLISTSTOPspamspamMITVMA.MIT.EDU
Subject:        [OT] Small stepper motors (Was: Re: Driving steper motors)

At 13:56 30.11.97 -0500, you wrote:
>>I have found some incredably tiny ones in a viedo camera focousing unit
>they
>>are abut 8mm diameter x 10mm long with a coil resistance of 43R per winding

I have been looking for small stepper motors.  The smallest motor I have
found, has a diameter of 8mm and a length of 16mm.  Does anyone know where
to by stepper motors that are smaller than this one? I have seen them in
some lenses, so they have to be ot there...

Regards,
Havard
------------------------------------------------
HŒvard T¿rring
RemoveMEhtspamspamneo.no    TakeThisOuTxplisitspamspamRemoveMEneo.no    KILLspamsimplisitspamspamspam_OUTneo.no
Norsk Elektro Optikk A/S       Tel: +47 67974700
PoBox 384                      Fax: +47 67974900
1471 SkŒrer.
Norway

1997\12\02@233109 by Bruce Cannon

flavicon
face
Take apart your watch, and/or look at the sites for robots made from these
motors.  Great!

At 09:16 AM 12/1/97 +0100, you wrote:
{Quote hidden}

Bruce Cannon
Style Management Systems
Remember: Electronics is changing your world...for good!

'Driving parallel printer of a 16C74A ?'
1997\12\12@094610 by R.C.Vandenbergh

flavicon
face
Hi,

does anyone know where I might be able to get some example code or details
on how to interface a 16C74A to a parallel printer ?

Thanks,

Cedric
----
Als je aan een meisje in een disco het uur vraagt,
weet ze meestal wel hoe laat het is.

1997\12\12@115603 by Keith Howell

flavicon
face
R.C.Vandenbergh wrote:

> does anyone know where I might be able to get some example code or details
> on how to interface a 16C74A to a parallel printer ?

Does this mean the PIC sending chars to a printer, or
the PIC talking to a PC's LPT port as a smart peripheral?

Not that I have answers to either.

1997\12\14@062038 by Octavio Nogueira

flavicon
face
If you are trying to print something from 16C74 it's really simple:

#define IMP  PORTD
#define IMP_CLK  PORTE,1 ;RE1
#define IMP_PO  PORTE,0 ;RE0
#define IMP_RDY  PORTE,2 ;RE2

LPrint:                ; receive the byte to be printed in W
btfsc IMP_RDY  ;waits the printer to be ready
goto $-1
movwf IMP
bcf IMP_CLK        ; pulse printer clock
nop
bsf IMP_CLK
return

That's it.

Octavio
======================================================
Octavio Nogueira  - e-mail:   TakeThisOuTnogueiraRemoveMEspam@spam@mandic.com.br
http://www.geocities.com/~oct_nogueira
"ProPic" Production PIC Programmer Windows under US$20
======================================================
-----Mensagem original-----
De: R.C.Vandenbergh <EraseMErcvRemoveMEspamUKC.AC.UK>
Para: spamPICLIST.....spamspamMITVMA.MIT.EDU <PICLISTspam_OUTspam@spam@MITVMA.MIT.EDU>
Data: Sexta-feira, Dezembro 12, 1997 12:46
Assunto: Driving parallel printer of a 16C74A ?


{Quote hidden}


'Driving LCDs'
1998\01\18@134246 by Rock Thompson
picon face
I'd appreciate any suggestions on inexpensive LCD drivers to use with
a PIC.  I'm building an exercise computer with three 4 digit LCDs (7
segment). I think that's too many to drive directly with the PIC, and
the PIC with a built-in LCD driver is expensive (and I guess I'd need
one for each LCD).

I'm thinking of a 16F84 controlling three LCD drivers or maybe one
driver multiplexed amoung the three LCDs.
This is my first project using LCDs (for low power) and the blasted
things seem more complicated than LEDs.  Which drivers and method make
sense to use?

I am so consumed with designing this that I've given up exercising
until it is done.  I'm turning to fat even as you read this.  Please
help.
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

'(Late) comment on driving an LED'
1998\01\22@175532 by John Halleck

flavicon
face
If my memory is correct, someone on this list was looking
to drive an LED with less than the LED's forward voltage.
(If that's wrong, my appologies for boring the list with this.)

If I remember aright, several folk recomended the LM3909,
but it wasn't bright enough?

http://209.1.238.250/arpdf/AppNotes/A1913.pdf
shows how to use a MAX778 to drive High Brightness LED's
from a 1.5 volt source.
(This should be bright enough for almost anyone.)

'Driving LCDs'
1998\01\25@213105 by sam Haile

picon face
Hi
I have the same problem with my project
"talking clock"

my advice is use LED instead of LCD
if you want to use LCD you must know that
it require a backplane strobe pulse
to keep the display refreshed, otherwise it'll go blank.  This is
more difficult to impliment with the PIC because you really need to
use interupts to keep regular pulses so that the displays don't flicker.


by the way I would be interessted if you solve the problem

do email me back you have some tip for my project

sam

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

1998\01\25@223851 by Bob Blick

face
flavicon
face
At 10:30 AM 1/18/98 -0800, you wrote:
>I'd appreciate any suggestions on inexpensive LCD drivers to use with
>a PIC.  I'm building an exercise computer with three 4 digit LCDs

How about the AY0438? It is like the LCD driver PIC without the PIC. $4 at
DigiKey, or thereabouts. Made by Microchip, even.

-bob

http://www.bobblick.com/

1998\01\26@002248 by rlunn

flavicon
face
> My advice is use LED instead of LCD.
> If you want to use LCD you must know that
> it requires a backplane strobe pulse to
> keep the display refreshed, otherwise
> it'll go blank.

       Yeah, but almost nobody actually bothers
       to drive an LCD _directly_.

       For a four-digit seven-segment LCD with
       one backplane I would use an MM5452 or
       MM5453, which drive 32 and 33 LCD segments
       respectively.

       These chips require only a resistor and
       capacitor (to produce the backplane strobe),
       and have a two-line interface to the micro-
       controller (clock and data).

       The comms protocol is trivial.

       For a four-digit seven-segment LCD with
       two backplanes I would use a PCF8577, which
       can drive up to 64 LCD segments.

       Again, only an RC pair is required, and the
       two-line interface is now IIC!  This allows
       the chip to share the comms bus with other
       devices (including other '8577s).

       The comms protocol is no longer trivial,
       but IIC software is readily available.

       As I recall, the original mailer needed to
       drive three LCD's...

       With '5453s this would require three chips,
       and they can't be connected to the same
       two clock and data lines.  They could share
       a data line, but would all need seperate
       clock lines.  This gives a total of four
       I/O lines required.

       With '8577s (and assuming static drive LCDs,
       that is, one backplane) three chips would
       again be needed.  But in this case all three
       chips could be connected to the same two-wire
       IIC bus and separately addressed.  So only
       two I/O lines required.

       Go to

               http://www.semiconductors.philips.com/search/

       to search for the PCF8577 data sheet (.pdf).

___Bob

1998\01\26@041026 by Mike Ghormley

flavicon
face
Rock wrote:

>I'm building an exercise computer with three 4 digit LCDs (7 segment). I think
>that's too many to drive directly with the PIC, and the PIC with a built-in LCD
>driver is expensive (and I guess I'd need one for each LCD).

I have used the Telcom TC7211 chip a long time ago.  It is a four-digit
7-segment
LCD controller.  I believe that MAXIM is now making (or at least second-sourcing
the chip) as ICM7211.  I've no idea on the price, but I have used these and the
ICM7218 (8-digit 7-segment LED Mux/Decoder/Driver) with success.

It (the `7211) uses a four-bit data bus and four seperate digit select pins.
Of course you could reduce the pin count by two using some logic circuitry
between
two pic pins and the four select lines.

The data sheet in PDF format can be found at:
       http://209.1.238.250/arpdf/1675.pdf

Best of luck on your reducing program!  ;^)

Michael

/*******************************************************************************
\**  When the way of the Tao is forgotten, kindness and ethics must be taught.
**
**  Men must learn to pretend to be wise and good.  --  Lao Tzu
**
\*******************************************************************************
/

1998\01\26@075015 by WF AUTOMACAO

flavicon
face
Rock Thompson wrote:
>
> I'd appreciate any suggestions on inexpensive LCD drivers to use with
> a PIC.  I'm building an exercise computer with three 4 digit LCDs (7
> segment). I think that's too many to drive directly with the PIC, and
> the PIC with a built-in LCD driver is expensive (and I guess I'd need
> one for each LCD).
>
> I'm thinking of a 16F84 controlling three LCD drivers or maybe one
> driver multiplexed amoung the three LCDs.
> This is my first project using LCDs (for low power) and the blasted
> things seem more complicated than LEDs.  Which drivers and method make
> sense to use?
>
> I am so consumed with designing this that I've given up exercising
> until it is done.  I'm turning to fat even as you read this.  Please
> help.
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com

I have done for PIC16F84 (I used the Tango for D.O.S for the Schematic)

(PIC16F84 WITH FOUR 7 SEGMENT DISPLAYS)

Do you want? :)))

MIGUEL.

1998\01\26@075210 by WF AUTOMACAO

flavicon
face
sam Haile wrote:
{Quote hidden}

I resolved the Flick with computed delay!

Miguel.

1998\01\26@103602 by Rajnish

flavicon
face
Hi Mike,
Would appreciate if you can send me your asm code for the ICM7218.
Rajnish.

At 01:08 AM 26/1/98 -0800, you wrote:
>Rock wrote:
>
> snip...... but I have used these and the
>ICM7218 (8-digit 7-segment LED Mux/Decoder/Driver) with success.
>
>Best of luck on your reducing program!  ;^)
>
>Michael

'is there any pic with LED driving capablity?'
1998\01\26@132212 by sam Haile

picon face
please email me back if you know any pic which can drive lED directly I
am not aware if such pic does exist.

sam

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

1998\01\26@155936 by Morgan Olsson

picon face
Almost anything can drive a low-corrent type LED (about 1-2 mA required)
A lot of PICs have some especially strong outputs, like the PIC14000 I«m
using.
Select one you think you can use and RTFM.
/Morgan


At 10:16 1998-01-26 PST, you wrote:
>please email me back if you know any pic which can drive lED directly I
>am not aware if such pic does exist.
>
>sam
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>
>

Morgan Olsson, MORGANS REGLERTEKNIK, Sweden, ph: +46 (0)414 70741; fax 70331
============================================================================

'Driving LCDs'
1998\01\27@130944 by Montaigne, Mike

flavicon
face
I would appreciate a copy of TANGO schematic and PIC code.
Also are you still using TANGO DOS or have you switched to something
else.
I am trying to decide what to switch to.
Mike Montaigne

{Quote hidden}

'is there any pic with LED driving capablity?'
1998\01\28@072539 by Morgan Olsson

picon face
>>>> Almost anything can drive a low-corrent type LED (about 1-2 mA required)
>>>> A lot of PICs have some especially strong outputs, like the PIC14000 I'm
>>>> using.
>>>> Select one you think you can use and RTFM.
>>>I am trying to understand the Port C capability of "Direct LED drive"
>>>in the PIC 14K manual. It seems to be rated the same source/sink as
>>>the other ports. What exactly do they mean?
>>>
>>Good question. In the detaild port description (DS40122B-page 30) it
>>says Port C 5:0 can drive LEDs. No other Port description tells that.
>>But in the electrical characteristics section they only specify different
>>(lower) current for RC6, RC7, RD0, RD1, OSC2.
>>All other output pins specified to 0,6 V drop when output high @8,5mA
4,5V Vdd.
>>So the same document tells two different things!
>>(I also found other things in >>this manual strange,
>>undefined or double defined, but it is still preliminary, so...)
>>Other manufacturers specifies LED capability when they can drive 20mA.
>>So, are the LED outputs that strong (20mA), and just forgotten in the
electrical
>>characteristics section?
>>And are they assymetric like all other, (sink much stronger than drive)?
>>/Morgan

>I was hopeful that they had some type or current limit that would let
>you drive LEDs with no resistor.
>
They don«t.
A while ago, however, I used CMOS hex inverter 4069U to directly drive
LEDs. Theu are weak (deliver 3-5mA I think) but suitable for small LED
indicator. I beleive it was even within the manufacturers spec to to so,
but I don«t remember which.

Maybe the PIC don«t risk get damaged either? (This of course depends
strongly on supply voltage) PIC:s are much weaker in pullup than sink, so
maybe using them to pullup?

Under maximum ratings they specify (looking at C84) max sink on a pin to
25mA, and source 20mA. (OBS there are also max limitations for a ports
total current)

At 4,5V supply volt the C84 have a max loss of 0,7V@3mA=233ohms.
If the LED need 2V, the loss of the pin = 2,5V
2,5V/233ohms=11mA.  Nice.
BUT BEWARE:
1)      0,7V@3mA is minimum drive of the pin. They don«t specify how good a PI
C
can be at best. In this case a strong low-loss output will maybe make to
much current, so it will get damaged!
2)      The resistance is lower at higher voltages so the current rises quickly.

For LED drive I recommend using PIC to sink, and series resistor.

However, when using the A/D cirquitry in PIC14000 Vss current causes
measurement ofset, so then use PIC to source instead!
/Morgan
Morgan Olsson, MORGANS REGLERTEKNIK, Sweden, ph: +46 (0)414 70741; fax 70331
-

1998\01\28@203626 by TONY NIXON 54964

flavicon
picon face
There are LED's around that have an internal resistor built in. They
run directly from 5V. Check out the Farnell catalog.

Tony

For the beginner....
PicNPoke Multimedia 16F84 Simulator Assembler, and Tutorial.
Now with PicNPlay circuit simulator.
Plus animated Address Mode Tutor.

http://www.dontronics.com/picnpoke.html

'Driving LED's -- was Driving LCDs'
1998\01\29@170914 by Mike Ghormley

flavicon
face
Rajnish wrote:
>Would appreciate if you can send me your asm code for the ICM7218.

Rajnish,

I'm afraid that I can't be of much help.  I wrote the code a while ago for a
client
and didn't keep a copy per his request.  I wrote it in FORTH for the 8051
family, at
any rate.

The `7218 is pretty straight-forward, though.  It has four data lines for the
digit
values (0-9 plus A-F in one mode and 0-9 plus "-HELP" in another), plus one for
the
decimal point if you need it.  It has three address lines to select digits 0
thru 7,
and a low-active write line.

Just output your data and address logic and then toggle the _WRITE_ pin low.  As
I
recall, there was a small problem with timing.  Mostly because I didn't
understand
their verbiage in the specs.  As long as you adhered to a low _WRITE_ pulse of
400nS
or more -- and keep the data/address info stable for 125nS *after* the _WRITE_
strobe
goes *HIGH*, you'll have no problems.  Of course if you have a slower clock
speed
then this won't even be a concern.

The `7218 is such and expensive chip and is limited to only 8 LED's, I want to
design
a PIC-based controller to do more LED's at a cheaper price.  I am a consultant
working away from home right now (thus the delay in responding), but when I get
back
home (~late Feb.) I want to make a `54-based 7-segment LED controller which does
at
least 12 digits for a clock project that I have.  I could keep you posted on my
progress if you like.

Sorry I can't be of more help.  Good luck on your project.

Michael

When the way of the Tao is forgotten, kindness and ethics must be taught.
Men must learn to pretend to be wise and good.  --  Lao Tzu

1998\01\29@175208 by Andrew Mayo

flavicon
face
Driving LED displays from a PIC is quite straightforward, but devising a
minimum pincount approach needs a little more thought. I have
standardised on the following design, which I'll describe in text rather
than attempt a circuit diagram.

This design will drive 8 digits and can be easily extended to larger
digit counts. For 8 digits, the duty cycle is 1:8 which is about as far
as I like to go, brightness will suffer beyond this point.

1. Take one PIC of any sort, even the 12C509, and connect 3 I/O lines
from this to two cascaded 4094 CMOS shift registers (the lines are
clock,strobe and output enable). These devices are (a) widely available
and (b) very cheap. You now have a 16 bit serial latch connected to a
PIC. The top 8 bits (or the bottom, your choice) are digit select, and
you should set only one of these low at a time. The bottom 8 bits are
then the direct drive to the seven segment displays, which are common
anode types.

2. Although you could in theory drive a very low current display
directly from the 4094 lines, I would use a UDN2803 octal darlington,
again, a widely-available part. Connect the cathodes of the displays to
this device via 68 ohm resistors and wire all the cathodes across in
parallel to all 8 displays.

3. The anode of each display is connected to the collector of a small
PNP transistor which can switch around 200mA, such as a BC640 (or is it
a BC639, damn old age creeping up on me here) and all the emitters of
the 8 transistors go to +5V. The bases go via 2.2K resistors to the top
4094 shift register. Pulling a line low turns the transistor on.

4. You might want to connect a 10K resistor from output enable of the
shift registers to ground. This prevents the line floating around when
the whole thing is powered up.

5. To drive the display, shift in the digit select pattern followed by
the 7 segment pattern then pulse the strobe line high briefly. You must
take OE high to enable the outputs, normally this is done once you've
got your first data set up and clocked, so as to avoid flashes at power
up. After that, you can leave OE high permanently unless you want to
flash the display, for instance. Note that pulling OE low turns off all
the anode drivers, so you can only flash the entire display with this
approach.

6. This is not a minimum parts count approach but it is pretty cheap.
Normally the displays are the dominant cost - for an 8 display setup the
cost of the other parts is pretty negligible unless you can buy displays
real cheap. In addition, only 3 lines are used from the PIC. You can
share the clock and data lines for other purposes if needed since unless
you activate the strobe line, no data is latched to the display. I have
used that trick to share these lines out to an I2C EEPROM, for instance
(e.g if you share the data line only, you can wiggle it around with gay
abandon since neither the display or the EEPROM will do anything with it
unless you toggle the associated lines).

7. The 74HC/LS165 is a useful chip to do the reverse; if I want to read
n switches with only a couple of I/O lines, then this device will latch
them in parallel and serially clock them into the PIC. The PIC is
marvellous for serial I/O because it can do it so fast.

{Quote hidden}

1998\01\29@181232 by John Payson

picon face
> This design will drive 8 digits and can be easily extended to larger
> digit counts. For 8 digits, the duty cycle is 1:8 which is about as far
> as I like to go, brightness will suffer beyond this point.

An alternative design will drive 8 digits (no DP's) with eight port pins,
eight transistors, eight resistors, and no external chips.  The transistors
are wired as emitter-followers on the PIC's eight port pins and feed the
commons on the eight digits.  Each digit's segment wires connect to the seven
port pins that don't drive that digit's common.  The eight resistors, between
the port pins and the segments, limit the display current.

Assuming the displays are common-anode, you'd use NPN transistors.  To drive
a digit, you set its common wire HIGH, set the appropriate segment wires LOW,
and let the other lines FLOAT.  If you want decimal points, then you can get
9 digits with 9 I/O pins.

By the way, if you're driving fewer than eight digits, you'll only need one
transistor per display.  If you're driving only a few digits and you're using
low-current displays, you may be able to elide the transistors entirely.  In
this case, a common-cathode display drive may be preferred since the PICs are
a little better at sinking than sourcing.

1998\01\29@193741 by Morgan Olsson

picon face
At 17:02 1998-01-29 -0600, you wrote:
>Assuming the displays are common-anode, you'd use NPN transistors.  To drive
>a digit, you set its common wire HIGH, set the appropriate segment wires LOW,
>and let the other lines FLOAT.  If you want decimal points, then you can get
>9 digits with 9 I/O pins.
>
Nice and Smart!
We got to have different segment maps for each digit, but thats just
porgramming
/Morgan

Morgan Olsson, MORGANS REGLERTEKNIK, Sweden, ph: +46 (0)414 70741; fax 70331
-

1998\01\29@201152 by William Chops Westfield

face picon face
   >Assuming the displays are common-anode, you'd use NPN transistors.
   >To drive a digit, you set its common wire HIGH, set the appropriate
   >segment wires LOW, and let the other lines FLOAT.  If you want
   >decimal points, then you can get 9 digits with 9 I/O pins.

I like this a lot.  Very clever.  The kind of not-PIC-specific thing I find
very useful.  Are the weak pullups on a PIC too weak to interfere?  I
suppose you can still use the same 8 lines for switch inputs as well, for
certain cases, and certainly if you have fewer than 8 digits (4 digits and
a 4x4 switch array in 8 pins should be easy?)


   We got to have different segment maps for each digit..

I think careful use of rotate would be sufficient...

BillW

1998\01\29@201524 by John Payson

picon face
>
> At 17:02 1998-01-29 -0600, you wrote:
> >Assuming the displays are common-anode, you'd use NPN transistors.  To drive
> >a digit, you set its common wire HIGH, set the appropriate segment wires LOW,
> >and let the other lines FLOAT.  If you want decimal points, then you can get
> >9 digits with 9 I/O pins.
> >
> Nice and Smart!
> We got to have different segment maps for each digit, but thats just
> porgramming

It's not even that bad.  Assuming you have the data for each digit stored
in the same format in bits 0..6 of Digit0..Digit7, and assuming the digits
are wired correctly, then you can show them with:

ShowD0:
       rlf     Dig0,w
       andlw   0xFE
       tris    PORTB
       retlw   0

ShowD1:
       rlf     Dig1,w
       xorwf   Dig1,w
       andlw   0xFC
       xorwf   Dig1,w
       andlw   0xFD
       tris    PORTB
       retlw   0

ShowD2:
       rlf     Dig2,w
       xorwf   Dig2,w
       andlw   0xF8
       xorwf   Dig2,w
       andlw   0xFB
       tris    PORTB
       retlw   0

etc.  One routine for each digit, but all digits can use the same character
bitmaps.

1998\01\30@001443 by Andrew Mayo

flavicon
face
Very clever. I like that. Of course, you need the I/O lines, which for
some reason in my designs I'm always short of (sigh!). Also at 20mA per
segment you're close to the absolute maximum port current for the PIC,
since you'll be trying to source 140mA. I guess it will work fine for
smaller displays. Duty cycle is still 1:8, though.

The kind of apps I've been building tend to revolve around outdoor use
and quite large display panels where we're trying to eke out the last
drop of brightness from the displays.

{Quote hidden}

1998\01\30@012031 by Mike Keitz

picon face
On Thu, 29 Jan 1998 19:04:27 -0600 John Payson <TakeThisOuTsupercatspamMCS.NET> writes:
>>
>> At 17:02 1998-01-29 -0600, you wrote:
>> >Assuming the displays are common-anode, you'd use NPN transistors.
>To drive
>> >a digit, you set its common wire HIGH, set the appropriate segment
>wires LOW,
>> >and let the other lines FLOAT.  If you want decimal points, then
>you can get
>> >9 digits with 9 I/O pins.
>> >
>> Nice and Smart!
>> We got to have different segment maps for each digit, but thats just
>> porgramming


This is a very good idea.  The major problem is that most multi-digit LED
arrays are internally wired with all the segments connected together for
standard multiplexing.  They could not be used with this method.  If you
use seperate LED digit units, then they could be wired as needed.

This would also work well for a moderate number of discrete LEDs
connected to a small number of port pins.
>
>It's not even that bad.  Assuming you have the data for each digit
>stored

I think a general purpose routine could be used to adjust the data from
one table to display properly on all digits.  The 8 digits are:
0gfedcba - digit 7
g0fedcba - digit 6
...
gfedcba0 - digit 0

This data should be applied to the TRIS register (a 0 turns the segment
on, 1 turns it off by setting the pin to input mode).  The port register
would have data of the form 10000000, 01000000, etc.  The 1 bit turns on
the digit.  The 0 bits turn on segments as directed by the TRIS register.

I'll assume the single-one selection byte is already available.  The
problem is then to generate the TRIS register byte from a byte of the
form 0gfedcba.

This is actually easy to do.  Decrement the single-1 byte to form a mask:
01111111 - digit 7
....
00000000 - digit 0
Make a copy of the data shifted one to the left.  For mask bits which are
0, use the shifted data, for ones that are 1 use the original data.
Finally, force the digit drive bit (the 1 in the selector byte) to 0.

For example, consider digit 6.
Selector: 01000000
Mask:     00111111
Data:     0gfedcba
Data sh.  gfedcba0
Result    g0fedcba

I'll leave the writing of PIC code to do this for someone else.




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

'Driving LEDs'
1998\01\31@075248 by Mike DeMetz

flavicon
face
For driving 1 to 51/2  7 segment(and DP) common cathode displays
take a look at the Motorola MC14489. This CMOS chip directly controls
the displays with only one resistor to set current limit. It has a 3
wire SPI serial interface. Has circuitry to minimize EMI and software
dimming. Using something called BitGrabber it determines by the
number of bits written wether the code sent is control or data.
They can be cascaded. Also can be used to drive up to 25 discrete
LEDs.


'LCD driving and other things.'
1998\02\09@025128 by Louis Pretorius
flavicon
face
I need some help on my first PIC project.  It might be slightly
ambitious but what the heck!

My application calls for 2 A/D's, a keypad interface a 5 digit
(7-segment) LCD display and a pizzo for sound.  It is battery driven and
battery life is an important issue.

I need some guidelines as to which PIC to choose as well as info on a
driver for the LCD.

Any help will be appreciated.

Louis

1998\02\09@034414 by Morgan Olsson

picon face
PIC14000 has parts on chip to make a 16-bit resolution single slope A/D
I just started playing with it.
Parts are:
       Referene voltage
       Temperature sensor
       MUX (8 ext in + internal above)
       Current regulator and discharge for ext slope cap
       16-bit timer with capture register, controlled by
       analog comparator
The A/D slope current regulator is temperature sensitive, so you really
have to measure against the reference voltage often and recalibrate.
There also are two 8-bit D/A and comparators. 0.15 - 0.85 V
And a stupid zener occupies one i/o pin.

The A/D noise in 16-bit measure in my application is about 8 LSB peak-peak,
and then I have done a lot to stabilaze both supply and measured voltage,
so some sort of filtering is needed if using full resolution.

Probably you will nees some external IC to extend number of I/O.
/Morgan

At 09:41 1998-02-09 +0200, you wrote:
{Quote hidden}

/  Morgan Olsson, MORGANS REGLERTEKNIK, SE-277 35 KIVIK, Sweden \
\  spamBeGonemrtKILLspamspamTakeThisOuTiname.com, ph: +46 (0)414 70741; fax +46 (0)414 70331    /

'Driving LED's -- was Driving LCDs'
1998\02\12@104712 by peter

flavicon
face
John Payson wrote:
>
> An alternative design will drive 8 digits (no DP's) with eight port pins,
> eight transistors, eight resistors, and no external chips.  The transistors
> are wired as emitter-followers on the PIC's eight port pins and feed the
> commons on the eight digits.  Each digit's segment wires connect to the seven
> port pins that don't drive that digit's common.  The eight resistors, between
> the port pins and the segments, limit the display current.

I've just finished a serial input six digit (I only needed six)
led display using John's great post.

I am using two digits for speed (kmh) and four for rev's (rpm)
I wrote it in basic, compiled with PBC and it's running on a 16c84
I am using a second 16c84 to compute the speed, rev's, oil
and later anything else that comes to mind

In case anyone is wondering it's for my daughters toy (50cc)
car and as she's only six, two digits for the speed will be
sufficent for a few years to come

Anyone interested in the source code
it's your's

Thanks John

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


'Driving step-motor from PIC'
1998\03\06@174319 by fcembrola
flavicon
face
Hi all,

I want to do some experiment with step motors but
I want to use as little hardware as
possible.

Does anybody know where I can get some small step
motors that can be driven from directly a PIC?

Thank you.

Francesco

1998\03\06@194535 by Mark S.

flavicon
face
I would suggest using some buffering, but it could be one chip, such as a
ULN2003 (darlington array) or better yet, a LM293. I don't think a PIC can
handle the current, and the back EMF would probably fry the PIC anyway.

For great deals on steepers, look up alltonics. They have a web page
(http://www.alltronics.com). $3 each!

At 11:22 AM 3/3/98 +0000, you wrote:
{Quote hidden}

1998\03\06@203104 by kotay

flavicon
face
>
> Hi all,
>
> I want to do some experiment with step motors but
> I want to use as little hardware as
> possible.
>
> Does anybody know where I can get some small step
> motors that can be driven from directly a PIC?
>
> Thank you.
>
> Francesco
>
I would suggest using some type of driver chip.  The PIC
will not be able to supply enough current to drive a
stepper directly.  If you are using a bipolar stepper,
then the Motorola MC3479 is a nice chip.  It has 350mA
per coil drive capability.  It is simple to use--one
direction bit and one step bit is all it takes (you
can also do half-stepping by using one more bit).  It
is available as a 16-pin DIP or a 20-pin PLCC.

Keith

Keith D. Kotay
Ph.D. Candidate
Dartmouth College
spamkotayspamcs.dartmouth.edu
http://www.cs.dartmouth.edu/~kotay

1998\03\07@044152 by Luberth

picon face
fcembrola wrote:
>
> Hi all,
>
> I want to do some experiment with step motors but
> I want to use as little hardware as
> possible.
>
> Does anybody know where I can get some small step
> motors that can be driven from directly a PIC?
>
> Thank you.
>
> Francesco

use a pic in combination with uln2803 or transistors
if you search the web you wil find schematic's
and programming examples (basic, pascal, c,fort)

there are programming examples for pic (asm) on the web

stepper motors can be found in old printers floppy drive's

--
------------------------------------------------------------
Luberth Dijkman Bangert 23 1619 GJ Andijk Nederland
http://luberth.mypage.org
www.worldaccess.nl/~luberth/propklok.htm
www.geocities.com/siliconvalley/lab/3685/analog.htm
http://www.fortunecity.com/skyscraper/gigahertz/132/analog.htm

luberthSTOPspamspamworldaccess.nl
luberthSTOPspamspamKILLspamgeocities.com
@spam@luberth.....spamspamusa.net
spamluberth.....spam.....hotmail.com
luberth.....spamyahoo.com
------------------------------------------------------------

1998\03\10@031452 by Josef Hanzal

flavicon
face
>I would suggest using some buffering, but it could be one chip, such as a
>ULN2003 (darlington array) or better yet, a LM293. I don't think a PIC can
>handle the current, and the back EMF would probably fry the PIC anyway.

There are unipolar and bipolar stepper motors. The unipolar is much easier
to drive, either ULN2003, ULN2803 (0.5 A), or ULN2064, ULN2068 (1.5 A) or
four discrete darlingtons/FETs will do. Unipolar stepper motor has 5 (or 6)
wires coming out.

Although bipolar stepper motors have some advantages, they are more
difficult to drive, since they need to reverse polarity on their coils. This
can be achieved with dual full bridge like the Thomsons L298. Bipolar
stepper motors have only four wires. If the motor has eight leads, then it
can be wired either as bipolar or unipolar.

I have learned a lot from Thomson application notes, I have a CD-rom, but
they should be on their web site as well (http://www.st.com). Namely the AN235 is a
good starting point, AN238, AN266, AN460, AN467-470 go into more details and
are targeted toward specific ICs, but will certainly answer more questions
than you wanted to ask. BTW, you don't need the L297 (mentioned in ANxxx),
the PIC can generate the driving sequences without any problem.

>For great deals on steepers, look up alltonics. They have a web page
>(http://www.alltronics.com). $3 each!

Or get a faulty/obsolete 5 1/4" or even 8" floppy drive and dissect its
guts, there is a stepper motor inside (in 3 1/2" drive as well, but it is a
smaller one, often build into the chassis and/or bipolar). It may be even free.

Josef

====================================================================
Snail Instruments                   Josef Hanzal
Vojanova 615                        phone/fax: +420-311-24433
266 01 Beroun                       e-mail: KILLspameuroclassspam_OUTspampha.pvtnet.cz
Czech Republic                      URL: http://www.vitrum.cz/snail/
====================================================================

1998\03\10@042222 by Morgan Olsson

picon face
At 09:14 1998-03-10 +0100, Josef Hanzal wrote:
>>I would suggest using some buffering, but it could be one chip, such as a
>>ULN2003 (darlington array) or better yet, a LM293. I don't think a PIC can
>>handle the current, and the back EMF would probably fry the PIC anyway.
>
>There are unipolar and bipolar stepper motors. The unipolar is much easier
>to drive, either ULN2003, ULN2803 (0.5 A), or ULN2064, ULN2068 (1.5 A) or
>four discrete darlingtons/FETs will do. Unipolar stepper motor has 5 (or 6)
>wires coming out.
>
>Although bipolar stepper motors have some advantages,

Better efficciency, lower consumption for same hold force, lesse dimension
and heat.
... Well it«s all the same.  All because the winding usage is more efficient.

>they are more
>difficult to drive, since they need to reverse polarity on their coils. This
>can be achieved with dual full bridge like the Thomsons L298.

Ericsson PBL3717 and sisters are very neat.

>Bipolar
>stepper motors have only four wires.

Six wire bipolar are also common. They can (i believe) also be connected as
unipolar.

If the motor has eight leads, then it
{Quote hidden}

free.
{Quote hidden}

/  Morgan Olsson, MORGANS REGLERTEKNIK, SE-277 35 KIVIK, Sweden \
\  .....mrt.....spamRemoveMEiname.com, ph: +46 (0)414 70741; fax +46 (0)414 70331    /

1998\03\10@163044 by Alessandro Zummo

flavicon
face
Il 10-Mar-98, Morgan Olsson scrisse:


> Better efficciency, lower consumption for same hold force, lesse dimension
> and heat.
> ... Well it«s all the same.  All because the winding usage is more
efficient.

any info/schematic about how to drive a bipolar stepper motor?

--

  - *Alex* -

 http://freepage.logicom.it/azummo/

1998\03\11@142621 by S.V.S. inc

flavicon
face
Hi Alex

+AD4APg-any info/schematic about how to drive a bipolar stepper motor?

Email me directly.
Place +ACI-1/2 bridge+ACI- in the subject.
And I will send some schematics.
Schematics are in GIF or Jpeg format
and are too large to post on the list

Brian Whittaker
SVS+AF8-KITS+AEA-MSN.COM
Selling Electronic Surplus, Laser-Galvo
and Motion control kits since 1983
----------------------------------------


{Original Message removed}

'Driving/reading +/- 10V serial lines'
1998\03\25@205021 by Rob Roy

picon face
Hi;

I was wondering if anyone has wrestled with trying to eliminate rs232
line drivers and their associated capacitors from a dongle like device
attached to a PC or similar serial port  I know that I can use a MAX232A
to convert my 16c5X software UART lines to serial levels and vice versa,
however I was wondering since resistors and diodes are cheaper and my
supply voltage is +10v & -10v whether I could condition my input serial
line with a resistor and a zener like so:

               10k
in>------/\/\/\/\/\---------------------------<PIC
                                 |   /
                              ------
                            /   A        3.3v
                                ---
                                 |
                              ///

and do something as simple with the output like

                                |/---------/\/\/\/\/\/-------<+10v
PIC>-----/\/\/\----------|
                                |\
                                |----------/\/\/\/\/\---------<-10v
                                |
                                |-----<TXD (to RXD input of PC Serial
Port)

I also am hoping for less power consumption with this arrangement but
have just begun to look at the realities here.

If you have some experience to share in this matter I would greatly
appreciate constructive insight.

Thanks........

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

1998\03\25@235956 by Mike Keitz

picon face
On Wed, 25 Mar 1998 17:38:58 PST Rob Roy <spam_OUTnqsageTakeThisOuTspamEraseMEHOTMAIL.COM> writes:
>Hi;
>
> I was wondering if anyone has wrestled with trying to eliminate rs232
>line drivers and their associated capacitors from a dongle like device
>attached to a PC or similar serial port  I know that I can use a
>MAX232A
>to convert my 16c5X software UART lines to serial levels and vice
>versa,
>however I was wondering since resistors and diodes are cheaper and my
>supply voltage is +10v & -10v

If you have +-10V supplies available, consider using a 1488 or 14C88 quad
line driver.  These require no external parts and supply 4 fully RS-232
compliant outputs.

Most PC's will accept a 0-5V level directly from a PIC output.  But some
won't, so a driver circuit of some sort is a very good idea.

Reception is easily done by just connecting the RS-232 line through a
large resistor (100K-1M) to a PIC pin.  The PIC's internal protection
diodes will clamp the voltage (Don't use the RA4 pin as it has no
protection diode to Vdd).  A pull-down resistor from the RS-232 input to
ground should be installed to ensure a "mark" (idle) reading with the
RS-232 input disconnected.


>and do something as simple with the output like
>
>                                 |/---------/\/\/\/\/\/-------<+10v
>PIC>-----/\/\/\----------|
>                                 |\
>                                 |----------/\/\/\/\/\---------<-10v
>                                 |
>                                 |-----<TXD (to RXD input of PC

This circuit won't quite work.  Two transistors are required.  Usually
the first is an NPN driven by the PIC in common-emitter or common-base
mode to provide a high-voltage open-collector output.  This output drives
a PNP transistor with the emitter connected to the +10V supply and the
collector outputting to the PC and pulled down to -10V.


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

1998\03\26@173341 by paulb

flavicon
face
Rob Roy wrote:

>  I was wondering if anyone has wrestled with trying to eliminate rs232
> line drivers and their associated capacitors from a dongle like device
> attached to a PC or similar serial port

 You wouldn't dare confess on this list to building dongles, would you?

> I was wondering since resistors and diodes are cheaper and my supply
> voltage is +10v & -10v

 If you have those voltages available, use whichever is cheaper; op-
amp or 14C88 (current-conserving CMOS version).

> whether I could condition my input serial line with a resistor and a
> zener like so:

 Sounds great; but the Zener should be 4.7V.  At 5.1V the PIC would
shunt first, 3.3V sounds just a tad close to the 2.5V threshold.  You
should load the RS-232 line though - a 4.7K resistor to ground at the
input will suppress ringing and provide a default state, while as Mike
Keitz mentions, a higher value of series resistor will then be fine.
I'd probably go for 33K with a Zener, 100K without (using the PIC
diodes. That latter doesn't feel right, but it does seem that the
designers very deliberately engineered the protection diodes not to
cause problems).

Mike Keitz <EraseMEmkeitzspamBeGonespamKILLspamJUNO.COM> wrote:

> Most PC's will accept a 0-5V level directly from a PIC output.  But
> some won't, so a driver circuit of some sort is a very good idea.

 I'd be VERY worried if I had a PC which didn't accept 5V CMOS levels
on a short cable (or none; Rob did say "dongle-like"), as knowing all
purpose-built RS-232 interface devices DO, it suggests that machine
contains *very* non-standard components!  My experience is strictly
limited, but every time I thought there was a problem with a PC serial
card, I was overlooking something else!

 Regarding RS-232 drive:

> This circuit won't quite work.  Two transistors are required.  Usually
> the first is an NPN driven by the PIC in common-emitter or common-base
> mode to provide a high-voltage open-collector output.  This output
> drives a PNP transistor with the emitter connected to the +10V supply
> and the collector outputting to the PC and pulled down to -10V.

 But to be RS-232 compliant and safe, it also requires a series
resistor in the output line, and may require slew-limiting capacitors.
We then have: R in first base circuit, R = first collector pull-up,
R = second base current limit, R = second collector pull-down to -10V
and R = output current limiting.  The tally is five resistors and two
transistors, one possible capacitor (in addition to the supply
decoupling caps you must have anyway), against a quarter IC alone using
the proper driver.

 Using an op-amp requires somewhere from one to three resistors, but
they are cheap.  How much do you value PCB space and hole count?

 Cheers,
       Paul B.

1998\03\26@175137 by Alex Torres

flavicon
face
> From: Rob Roy <RemoveMEnqsagespamBeGonespamspamHOTMAIL.COM>
>  I was wondering if anyone has wrestled with trying to eliminate rs232
> line drivers and their associated capacitors from a dongle like device
> attached to a PC or similar serial port  I know that I can use a MAX232A
> to convert my 16c5X software UART lines to serial levels and vice versa,
> however I was wondering since resistors and diodes are cheaper and my
> supply voltage is +10v & -10v whether I could condition my input serial
> line with a resistor and a zener like so:
>                 10k
> in>------/\/\/\/\/\---------------------------<PIC
>                                   |   /
>                                ------
>                              /   A        3.3v
>                                  ---
>                                   |
>                                ///

You are not need 10K resistor if you use any PIC's input orther then RA4
that have no
diodes.

> and do something as simple with the output like
>                                  |/---------/\/\/\/\/\/-------<+10v
> PIC>-----/\/\/\----------|
>                                  |\
>                                  |----------/\/\/\/\/\---------<-10v
>                                  |
>                                  |-----<TXD (to RXD input of PC Serial
Port)

2 years ago I've posted here the schematic with single +5 power :
                                 ______ +5v
                           b |/e
PIC--------/\/\/\/-------|       p-n-p tranzistor
output                     |\c
                                 \
                                  |---------------------------  TxD  (to
PC's RxD )
                                  |       4k7      10-100mF
                                   ---/\/\/\/\/--------||-----|
                                                   _\/_  diode
PIC                                                 |
input -----/\/\/\/\---------------------------------------- RxD (to PC's
TxD)


One thing - do not use this at the high speed (38400 and more), use ADM232
(MAX232).


Alex Torres, Kharkov, Ukraine (exUSSR)
@spam@altorspamspamchat.ru
2:461/28@FidoNet
www.geocities.com/SiliconValley/Lab/6311

1998\03\27@083700 by Leon Heller

flavicon
picon face
In message <TakeThisOuT199803262245.BAA13403KILLspamspam@spam@chat.ru>, Alex Torres <.....altorRemoveMEspamCHAT.RU>
writes
>2 years ago I've posted here the schematic with single +5 power :
>                                  ______ +5v
>                            b |/e
>PIC--------/\/\/\/-------|       p-n-p tranzistor
>output                     |\c
>                                  \
>                                   |---------------------------  TxD  (to
>PC's RxD )
>                                   |       4k7      10-100mF
>                                    ---/\/\/\/\/--------||-----|
>                                                    _\/_  diode
>PIC                                                 |
>input -----/\/\/\/\---------------------------------------- RxD (to PC's
>TxD)
>

There is an 8-pin DIL chip that does all this, the Dallas DS1275. It's a
*lot* more expensive, but could be useful if space is limited, and you
need very low power consumption.

Leon
--
Leon Heller: KILLspamleonspamTakeThisOuTlfheller.demon.co.uk http://www.lfheller.demon.co.uk
Amateur Radio Callsign G1HSM    Tel: +44 (0) 118 947 1424
See http://www.lfheller.demon.co.uk/dds.htm for details of my AD9850
DDS system. See " "/diy_dsp.htm for a simple DIY DSP ADSP-2104 system.


'Driving LED's'
1998\04\26@183630 by peter
flavicon
face
A quick update on an old thread

Ten digits from 6 pins

My main gain on this design is the very simple programing
and wiring

The first four pins of a PIC port go to a 74LS47
BCD to seven seg driver, the seven outputs are connected in parallel
to all the segments.
The next two pins go to the reset and count pins of a 4017(decade
counter
with 10 decoded outputs)
the ten decoded outputs connect direct to the bases of ten npn emitter
followers, all collectors +5V, emitters connect to the common anode
of each digit

Parts 1 x PIC + ceramic res, 1 x 7447, 1 x 4017,
10 x transistors (I used 2SC1740) npn,
no resistors !

Driving is simple
;first digit
logical high on the reset line     ; reset to 0
then output your number in binary to the port (top 4 bits=0 which will
pull
the reset back down)
wait 2msecs
;second and all following digits
logical high on count             ; advance one digit
then out put your number in binary to the port (top 4 bits=0 which will
pull
the count line down)
wait 2msecs
logical high on count             ; advance another digit
.................; till all ten done

I have it sitting in front of me, with a refresh rate of 50hz I can
see no flicker, it's drawing around 150ma and it is bright

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

1998\04\28@170629 by ape

flavicon
face
And don't forget that one can increase the number of digits by daisy
chaining the
4017's.  Of course one will have to make sure to maintain the 50+ Hz
refresh rate.

Peter Cousens wrote:

{Quote hidden}

'Help! Switching problem with PIC16F84 driving a tr'
1998\04\29@214429 by Rawle Watson

flavicon
face
Hello everyone,

       In a design using the PIC16F84 to turn on a switching transistor for
8 seconds and turn it off afterwards, I encounter the following problem.

a) the transistor switches on at the appropriate time as determined by the
program, but afterwards does not switch off even though the timing period
has ended.

The DC power supply for the circuit consists of a 16 volt ac adapter with
full-wave bridge rectifier, an LM317 adjustable regulator to give 14 volts
to recharge a battery, and a 5 volt regulator to power the pic.

I am using an RC oscillator and the clock frequency is approx. 2.8 MHz.

The RB4 pin is used to drive the base of a PN2222 transistor through a 2.2k
ohm resistor. The emitter is grounded and the collector is connected through
a 220 ohm resistor. Output is taken from the collector.

This transistor is used to turn off the LM317 regulator for 8 seconds so as
to load the battery to test its voltage across a voltage divider network.
This voltage is then input to the pic for sensing.


Both the PIC and the transistor switch operate as they should , when
connected independently.

However, the following is observed when a logic probe is connected in circuit.
The transistor remains on all the time once it is switched on by the pic
even though you can hear a pulse at the end of the timing period on RB4.

I have tried using a shunting capacitor on RB4 but to no avail.

Has anyone got any suggestions to help me solve this problem.

Thanks for your usual cooperation.



                                                       Rawle

1998\04\29@215059 by David VanHorn

flavicon
face
>The RB4 pin is used to drive the base of a PN2222 transistor through a 2.2k
>ohm resistor. The emitter is grounded and the collector is connected
through
>a 220 ohm resistor. Output is taken from the collector.


Check the output pin spec, you'll find that the maximum low voltage is high
enough to keep the base of an NPN active. Add an additional resistor from
the base to ground, probably 2.2k or 4.7k, and the problem will dissapear.

This has to be about the most common uC mistake. :)  Low isn't Zero!
That transistor only needs a couple microamps through the base to stay on.
Also, once they heat up from being on, their own leakage and gain goes up!

1998\04\29@233942 by ape

flavicon
face
David VanHorn wrote:

> >The RB4 pin is used to drive the base of a PN2222 transistor through a 2.2k
> >ohm resistor. The emitter is grounded and the collector is connected
> through
> >a 220 ohm resistor. Output is taken from the collector.
>
> Check the output pin spec, you'll find that the maximum low voltage is high
> enough to keep the base of an NPN active. Add an additional resistor from
> the base to ground, probably 2.2k or 4.7k, and the problem will dissapear.
>
> This has to be about the most common uC mistake. :)  Low isn't Zero!
> That transistor only needs a couple microamps through the base to stay on.
> Also, once they heat up from being on, their own leakage and gain goes up!

 Not just a problem for uC's.  This is a common problem ESPECIALLY
if one puts a cap from base to ground thinking that it will help reduce noise
from tripping the transistor (but you didn't say you were useing a cap).

Another thing you can do (depending on your application) is to put a diode
from the emitter to ground.  It raises the .7V trip point of the base up to
1.4V.  However, the collector will now only go down to .7V (the voltage
drop of the emitter to ground diode)

I also will use a 2N7000 (a common FET) that trips somewhere around
2 volts at times.

1998\04\29@233953 by Mike Keitz

picon face
On Wed, 29 Apr 1998 20:47:22 -0500 David VanHorn <.....dvanhornEraseMEspamCEDAR.NET>
writes:

>Check the output pin spec, you'll find that the maximum low voltage is
>high
>enough to keep the base of an NPN active. Add an additional resistor
>from
>the base to ground, probably 2.2k or 4.7k, and the problem will
>dissapear.

It is indeed a common practice to place a resistor of about 1-10K from a
transistor base to emitter to shunt away any leakage currents.  With the
PIC pin pulling the base low through a 2.2K resistor the additional
resistor shouldn't be necessary, but it won't hurt either.

>This has to be about the most common uC mistake. :)  Low isn't Zero!
>That transistor only needs a couple microamps through the base to stay
>on.

I'm not fully buying this.  Generally PIC pins, being connected to large
FETs inside, drive very close to Vss with no load.  But, the PIC's Vss
pin ("ground") is not necessarily the same voltage as the transistor's
emitter ("ground") if the ground system isn't proper.  Also if a heavy
current is flowing into other "low" output pins, it can pull the internal
Vss up so that "low" pins don't output zero.

The obvious test is to measure the pin voltage after a timing cycle has
ended and the transistor is supposed to be off.  It may be a good idea to
freeze the PIC clock during the measurement in case the PIC is actually
turning it on and off rapidly.  If it is close to but not quite zero, try
a resistor from the transistor's base to emitter.  But likely you will
find it a full 5V, indicating the PIC is actively trying to turn the
transistor on.  Are you sure that something doesn't cause the PIC to
immediately restart a timing cycle when the transistor turns off?  In
other words, the transistor turns off, but then something related to the
317 and the battery restarts the PIC timer.  This could be either a
glitch in the 5V power supply causing a reset, or a bug in the PIC
software.

In circuits that handle high currents, it's a good idea to establish
seperate "logic" and "power" ground networks.  Connect them together at
one point only.  The ground pin of the 5V regulator is a good place.


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

1998\04\29@234951 by Dennis Plunkett

flavicon
face
At 09:39 PM 29/04/98 -0400, you wrote:
{Quote hidden}

You give no indication as to if the line is actualy going low at the end of
the period (I assume that low is off). So is this happening? Note that the
PIC does have some internal pull ups that can be enabled on this port (For
inputs only).
If you dissconnect the transistor (Remove the 2k2) does the port pin go high
and low as expected?
Exactly how is the transistor used to switch off the regulator? (Just for
interest only!)

Dennis

1998\04\30@044606 by Michael Ghormley

flavicon
face
Rawle Watson wrote:

<SNIP>

> Both the PIC and the transistor switch operate as they should , when
> connected independently.

> However, the following is observed when a logic probe is connected in circuit.
> The transistor remains on all the time once it is switched on by the pic
> even though you can hear a pulse at the end of the timing period on RB4.

It sounds to me like it might be thermal runaway.  Try putting a small resistor
(even as low as an ohm) between the emitter and ground.

Michael

REMOVE THE .NS (NO SPAM) FROM MY ADDRESS TO REPLY
*****************************************
The strong do what they have to do and
the weak accept what they have to accept.
                            --Thucydides

1998\04\30@045712 by Gordon Couger

flavicon
face
From: Mark Devin Newland <spamBeGoneapespamRemoveMEeskimo.com>
>
>I also will use a 2N7000 (a common FET) that trips somewhere around
>2 volts at times.
A IRFD 123 FET works nice for switching up to 1 amp at 60 volts. It
goes in the low side and work like a charm no resistors. I generally
put a bypass cap on the gate to stop any chance of oscillation.

Gordon

Gordon Couger .....gcougerEraseMEspamrfdata.net
624 Cheyenne
Stillwater, OK 74075
405 624-2855   GMT -6:00

1998\04\30@111216 by David VanHorn

flavicon
face
>I'm not fully buying this.  Generally PIC pins, being connected to large
>FETs inside, drive very close to Vss with no load.  But, the PIC's Vss
>pin ("ground") is not necessarily the same voltage as the transistor's
>emitter ("ground") if the ground system isn't proper.  Also if a heavy
>current is flowing into other "low" output pins, it can pull the internal
>Vss up so that "low" pins don't output zero.


Read the spec, esp output voltage at logic zero max voltage.
Then have a close look at what it really takes to turn on a transistor.
Very close to zero isn't zero, and transistors often have quite a bit more
gain than their spec, especially at low currents.


{Quote hidden}

Adding the emitter resistor puts the transistor in class A operation. It was
in class C
Are you SURE this is a good idea?
Don't overcomplicate it. Transistors are not logic level devices. If adding
the needed resistor
bothers you too much, switch to low threshold FETs, which will begin turning
on at about 2V.


>In circuits that handle high currents, it's a good idea to establish
>seperate "logic" and "power" ground networks.  Connect them together at
>one point only.  The ground pin of the 5V regulator is a good place.


This I agree with 100%

1998\04\30@144519 by William Chops Westfield

face picon face
   Read the spec, esp output voltage at logic zero max voltage.
   Then have a close look at what it really takes to turn on a transistor.
   Very close to zero isn't zero, and transistors often have quite a bit
   more gain than their spec, especially at low currents.

Vol on a PIC is 0.6V max (I = ~8ma).  Vbe of a silicon transistor is about
.6V min, right?  With a base resistor, there ought to be negigable base
current, and the transistor should stay off, right?

BillW

1998\04\30@151217 by David VanHorn

flavicon
face
>Vol on a PIC is 0.6V max (I = ~8ma).  Vbe of a silicon transistor is about
>.6V min, right?  With a base resistor, there ought to be negigable base
>current, and the transistor should stay off, right?
>
>BillW

There dosen't have to be much current at all here, and the Vbe spec is
probably a max, rather than a min (At xxuA base current)
Trust me, been there, done that, you need some sort of divider mechanism to
insure that an NPN will turn off from a logic output.
Look at the schematics of gates with bipolar inputs.

In Horowitz and Hill, Pg 586, there is an example showing this, with an HC
gate driving an NPN. There is a second example showing an additional NPN
being used as an emitter follower to drive an NPN, but of course we've
doubled the vbe, plus some.

It's also shown in the "Bad idea" circuits on page 670

1998\04\30@181557 by Calvin

flavicon
face
You can also use a "digital transistor". These already have the neccesary
resistors integrated.

Calvin

{Original Message removed}

1998\04\30@200716 by vgr

flavicon
face
how about puting a diode in series with the base resistor. It'll make the vbe in
crease to
app.1,4 V. The resistor value mast be recalculated for the current necesary to s
with the transistor.

javier

1998\04\30@202810 by David VanHorn

flavicon
face
>how about puting a diode in series with the base resistor. It'll make the
vbe increase to
>app.1,4 V. The resistor value mast be recalculated for the current necesary
to swith the transistor.


That works, but just adding one resistor is the least expensive option. It's
what we use in production.

1998\04\30@225215 by ape

flavicon
face
David VanHorn wrote:

> >how about puting a diode in series with the base resistor. It'll make the
> vbe increase to
> >app.1,4 V. The resistor value mast be recalculated for the current necesary
> to swith the transistor.
>
> That works, but just adding one resistor is the least expensive option. It's
> what we use in production.

 Unless you have a noisy environment.  Sometimes the filtering is more than
the diode.


'Help! Switching problem with PIC16F84 driving a tr'
1998\05\01@011701 by Mike Keitz
picon face
On Thu, 30 Apr 1998 19:35:01 -0700 Mark Devin Newland <spamapespam_OUTspam@spam@eskimo.com>
writes:
>David VanHorn wrote:
>
>> >how about puting a diode in series with the base resistor. It'll
>make the
>> vbe increase to
>> >app.1,4 V. The resistor value mast be recalculated for the current
>necesary
>> to swith the transistor.
>>
>> That works, but just adding one resistor is the least expensive
>option. It's
>> what we use in production.
>
>  Unless you have a noisy environment.  Sometimes the filtering is
>more than
>the diode.

A series diode (alone) seems like a bad idea.  Any collector-base leakage
current would reverse bias the diode and have nowhere to go except
through the base-emitter junction, where it would be amplified and cause
more undesired collector current.  The diode could also rectify RF fields
that are present (to a greater extent than just the transistor would) and
cause false turn-on.  A resistor from base to emitter (ground) is
conventionally used and effective at keeping the base voltage low enough
that transistor action does not occur from leakage currents.  With this
resistor in place, the series diode could then also be used to increase
the voltage from the logic circuit that is required to turn the
transistor on.  The two resistors also form a voltage divider so more
voltage is required to reach the conduction threshold of the transistor.

I've had no problem leaving both out because low PIC outputs are
accurately modeled as small resistances to Vss.  Unless the internal Vss
bus is raised by large currents through other outputs, a single series
resistor from the PIC to the transistor will also serve to drain leakage
currents away from the transistor when it is supposed to be off.  If the
circuit has to operate at extreme high temperatures or it is important
that the transistor stay off while the PIC is in reset (all pins become
inputs then), the resistor to ground should be used.
As someone else noted, "digital transistors" which integrate this
resistor and the series limiting resistor are available.  The ULN2003
type transistor array devices also have integrated resistors.  Being
Darlington transistors, they also require 2 Vbe voltage to turn on, so
direct drive from "not quite zero" TTL outputs is effective.


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

1998\05\02@164807 by Marc Heuler

flavicon
face
Hi David (David VanHorn), in <009001bd73d9$ec1d90e0$spam85f135ce@spam@spamSTOPspamxenu.iquest.net> on
Apr 29 you wrote:

> Check the output pin spec, you'll find that the maximum low voltage is high
> enough to keep the base of an NPN active. Add an additional resistor from
> the base to ground, probably 2.2k or 4.7k, and the problem will dissapear.

Better yet is a diode (1N4148 or other) in series with the pin, that raises
the switching voltage by about 0.7V - enough for usual uC output pin specs.
It consumes no extra power, works with pullup outputs, and makes no
assumptions about the port pin (theoretically a low output could _source_
lots of current at 0.4V for example and still stay in-spec).

1998\05\02@211559 by Marc Heuler

flavicon
face
Hi David (David VanHorn), in <028301bd7469$f0824820$spamBeGonee8f135cespamBeGonespam@spam@xenu.iquest.net> on
Apr 30 you wrote:

> It's also shown in the "Bad idea" circuits on page 670

Now that you say it..  Unfortunately they don't tell why a circuit is a bad
circuit.  For me the learning effect of these pages is zero.  Therefore I
just ignore the bad circuit pages.

Does an addendum with explanations exist?

1998\05\03@002335 by David VanHorn

flavicon
face
>Hi David (David VanHorn), in
<028301bd7469$f0824820$RemoveMEe8f135ceRemoveMEspamRemoveMExenu.iquest.net> on Apr 30 you wrote:
>
>> It's also shown in the "Bad idea" circuits on page 670
>
>Now that you say it..  Unfortunately they don't tell why a circuit is a bad
>circuit.  For me the learning effect of these pages is zero.  Therefore I
>just ignore the bad circuit pages.
>
>Does an addendum with explanations exist?

Barnes and Noble has a "student's guide" or some such.  For me that was the
most fun part of the book.
Basically, at the end of each section, you should be able to look at the bad
idea circuits and tell why. Some
are easy, and some are suttle.  It's kind of like defusing a bomb :)

'driving servos'
1998\05\04@044759 by Justin Grimm

flavicon
face
Hi all
When using PWM to drive servos (hs-300), I know you need a pulse width
of 1mS to 2mS, but do the pulses "have" to be 20mS apart or can the be
less,
say 1mS?
Thanks in advance.

Justin Grimm    reaperKILLspamspamspamsouthwest.com.au

1998\05\04@080630 by Bill Cornutt

flavicon
face
----------
> Hi all
> When using PWM to drive servos (hs-300), I know you need a pulse width
> of 1mS to 2mS, but do the pulses "have" to be 20mS apart or can the be
> less,
> say 1mS?
> Thanks in advance.
>
> Justin Grimm    spam_OUTreaper@spam@spamsouthwest.com.au
>

Justin,

Back in my 'early years' I had an expierence that shaped
my future.  While driving through the country with the
high school driving instructor we came upon a horse
laying down in a field.  The question arose as to if
the horse was sleeping or dead.  As we students
in the car could not come to a conclusion, the instructor
told me that "It will be your job Bill to find out if
horses sleep laying down."

I took this as an 'official' assignment, and next week
when our group again went driving, I was ready with my
report.  I was so proud of myself!

You have an inquiring mind and question established values.
This is a good trait.  It will take you far.  You will learn
much and advance the knowledge of computers. And for this I
thank you in advance.

But you may need a little 'push' on this track.  And here it
comes.

Justin, I challenge you to discover what happens when the
pulse rate is increased from 50 cycles and also what happens
when the pulse rate is decreased from 50 cycles.  You may
be on to something here.  You can become one of the PicList's
servo person's.  You may even prepare a little paper, with
graphs and such, for the benifit of the rest of us.  And create
a web page for the advancement of the art.  When you do this
and later as you accept the many awards that you earn, I
hope you will acknowledge that "Bill got me started on this
path."

I know that I'm extreamly proud of my knowledge of how
horses and cows sleep.  (I expanded the origional
research to include cows and can now tell a tired cow
from a sleeping horse by the way they are laying.)
And I always thank Mr. Thorton for stsrting me in
the right direction.

As to the question as to "why 50 cycles?", I can offer
one possibile answer.

Servos are like Nuns, they always travel in groups.
And as the pulse rate increases, the time to control
additional servos decreases.

I will be awaitting your results Justin, "if you
should accept this assignment".

Bill C.    TakeThisOuTbillspam_OUTspamcornutt.com

1998\05\04@082952 by Alvaro Deibe Diaz

flavicon
face
In an attempt to get more power from a standard Futaba servo, I made a
pulse train of 10ms period. The servo worked OK, and with a little more
torque (not double). I don`t know if you can do this with any kind of
servos... but I think that standard servos works on the same basis: wait a
starting pulse edge, internally generate a 1.5ms pulse, and finally do a
substraction between them. The result goes to the motor trough some power
electronics involving possibly a pulse-stretcher. I think that there is a
limit in the frequency of the incoming pulses due to this stretcher stage,
an the limit is in the point where the stretched pulses to the motor join
together.

In fact, I was trying to do a device to mix two standard RC channels (20ms
period) and get the two mixed outputs "turbo-charged" to 10ms... finally I
put the project apart due to some reasons, one of them being not to be sure
how to do this with a _say_ 16C73, with all his PWM generators, Caputre
modules, and running at 20MHz. ?Any help here?

Hope this helps.
-----Mensaje original-----
De:     Justin Grimm [SMTP:KILLspamreaper.....spamTakeThisOuTSOUTHWEST.COM.AU]
Enviado el:     lunes 4 de mayo de 1998 11:00
Para:   TakeThisOuTPICLISTEraseMEspamRemoveMEMITVMA.MIT.EDU
Asunto: driving servos

Hi all
When using PWM to drive servos (hs-300), I know you need a pulse width
of 1mS to 2mS, but do the pulses "have" to be 20mS apart or can the be
less,
say 1mS?
Thanks in advance.

Justin Grimm    spam_OUTreaperRemoveMEspam.....southwest.com.au

1998\05\04@093107 by Andy Kunz

flavicon
face
>When using PWM to drive servos (hs-300), I know you need a pulse width
>of 1mS to 2mS, but do the pulses "have" to be 20mS apart or can the be
>less,
>say 1mS?

Justin,

They only need to be about 6mS apart ON AVERAGE.  It really varies
depending on brand, model, etc.  The only way to know for sure is to try
and see.

If you go too fast, the servos get jittery.  It's a function of both the
internal RC circuit and the motor and gearing, as well as the pot.

Bottom line - play around.  6mS should be all you need, though.

Andy


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

1998\05\04@095902 by Andy Kunz

flavicon
face
>how to do this with a _say_ 16C73, with all his PWM generators, Caputre
>modules, and running at 20MHz. ?Any help here?

I did this already.

I used a '73 with a GAL16V8 (I think, or 22V10) configured to allow me to
switch the PWM pins between input and output.  It worked nicely, gave 1uS
resolution using a 4MHz ceramic resonator.

Andy

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

1998\05\04@124943 by wwl

picon face
On Mon, 4 May 1998 16:59:49 +0800, you wrote:

>Hi all
>When using PWM to drive servos (hs-300), I know you need a pulse width
>of 1mS to 2mS, but do the pulses "have" to be 20mS apart or can the be
>less,
>say 1mS?
They need to be around 20ms, certainly 1ms is too short. I have a
simple circuit to allow RC servos to be driven from the 16C74 PWM
port. let me know if you're interested.
    ____                                                           ____
  _/ L_/  Mike Harrison / White Wing Logic / spamwwlKILLspamspamKILLspamnetcomuk.co.uk  _/ L_/
_/ W_/  Hardware & Software design / PCB Design / Consultancy  _/ W_/
/_W_/  Industrial / Computer Peripherals / Hazardous Area      /_W_/

1998\05\04@164848 by Jonathan

flavicon
face
I have code for driving two servos from a 16F84 (interrupt
driven).  It is on my web page under the BiMo robot,
http://www.ee.calpoly.edu/~jcline/labbook.htm
(I actually used hs-300 servos).



{Quote hidden}

'driving servos [OT]'
1998\05\05@083712 by paulb

flavicon
face
Bill Cornutt wrote:

> I know that I'm extreamly proud of my knowledge of how
> horses and cows sleep.  (I expanded the origional
> research to include cows and can now tell a tired cow
> from a sleeping horse by the way they are laying.)

 Can you elaborate a little on this for we non-farm types?

 Cheers,
       Paul B.

1998\05\05@084331 by Andres j Ogayar

flavicon
face
-----Mensaje original-----
De: Paul B. Webster VK2BZC <STOPspampaulbspam_OUTspamspamBeGoneMIDCOAST.COM.AU>
Para: spam_OUTPICLISTspamspamBeGoneMITVMA.MIT.EDU <EraseMEPICLISTspamKILLspamMITVMA.MIT.EDU>
Fecha: martes 5 de mayo de 1998 14:37
Asunto: Re: driving servos [OT]


{Quote hidden}

   Yes, please. Even those of us who live in the sunny southern europe
would like more knowdlege of this important matter.

   Regards,

   Andres j.

1998\05\05@101733 by Keith Howell

flavicon
face
Paul B. Webster VK2BZC wrote:

> Bill Cornutt wrote:
>
> > I now tell a tired cow from a sleeping horse
> > by the way they are laying.)

That's this -->.<-- interesting. :-)

>   Can you elaborate a little on this for we non-farm types?

Groan. Please have bovine/equine chats privately!

1998\05\05@110918 by g.daniel.invent.design

flavicon
face
i still wemember when i were a wittle tyke/tyrant and i sore thuh kows
a-sweeping on thayre footsies in the padok on a noo yeers eev.

bye-bye,
grum danil.

Andres j Ogayar wrote:
{Quote hidden}

1998\05\05@110927 by Justin Grimm

flavicon
face
Thanks for everyone's interest,
The reason I need to know if you can change a servo's pulsewidth is
because I dont want to run the code off interrupts. I am writing a program
that accepts a serial input (pic84 which will use the interrupts) then
drives
each servo (4) from that serial information.
I want to run the servo's at an approx 16mS pulsewidth
using a delay routine, but if the 84 receives a serial input while that's
happening the 16mS pulsewidth could be stretched a bit.
What I really need to know is-
is if the servo can handle a varying pulsewidth, say
from 16mS to 22mS, varying all the time but with the duty cycle always
remaining accurate.

BTW Bill, Servos can sleep lying down OR standing up. Clever hey!
Regards
Justin Grimm    reaperTakeThisOuTspamKILLspamsouthwest.com.au


----------
{Quote hidden}

stage,
> an the limit is in the point where the stretched pulses to the motor join
> together.
>
> In fact, I was trying to do a device to mix two standard RC channels
(20ms
> period) and get the two mixed outputs "turbo-charged" to 10ms... finally
I
> put the project apart due to some reasons, one of them being not to be
sure
{Quote hidden}

1998\05\05@113007 by Dan Larson

flavicon
face
Oh No!, not the "cow" thread again!!! <GRIN>

On Tue, 5 May 1998 15:08:42 +1000, Paul B. Webster VK2BZC wrote:

{Quote hidden}

1998\05\05@185927 by Andy Kunz

flavicon
face
>What I really need to know is-
>is if the servo can handle a varying pulsewidth, say
>from 16mS to 22mS, varying all the time but with the duty cycle always
>remaining accurate.

No problem.  The torque just will vary (and allow flutter in a dynamic
environment).

Andy

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

1998\05\05@190947 by Bill Cornutt

flavicon
face
{Quote hidden}

It looks like it is time to put the 'cow thread' to rest.

Once again, I have let my keyboard overload my knowledge.

The original question was "Is a horse that is lying down
dead?"  The research was enlarged to include cows, and
the question became "How do horses and cows lie down?"

Not wanting to go out in the field and trying to wake
lying horses and cows, I decided on the survey method
of research.  The survey consisted of three questions.
The first was "Do you know the difference between a horse
and a cow?"  If the answer was "No." then the survey ended
and questions two and three were not asked.

Question two and three were "How does a horse lie down?"
and "How does a cow lie down?"  This survey was conducted
over thirty five years ago and horses and cows may have
changed since then.

The survey concluded that horses lie down with their legs
sticking straight out or with their legs tucked under
them, and cows lie only with their legs tucked under.

Talking to my wife about this (she knows I am crazy,
but she humor's me) she had some interesting facts about
horses and cows.  A horse gets up head first.  While a
cow gets up back end first.  (If it was the reverse I
could have used a more colorful expression) So I guess
that if one is not sure if a animal lying in a field
is dead or alive, it is only necessary to pull its tail
a few times.  If the end with the tail raises first,
then it is a live cow.  If the other end raises first,
it is a live horse.  If neither end rises, then it is a
big dead animal.

A word of warning, horses can go up stairs but because
of the way their fetlocks are, they can't come back
down the stairs.  So there are two things you should
never do.  Ride a horse up stairs or microwave a bar
of Ivory Soap.


Bill C  spamBeGonebillspamspam_OUTcornutt.com

1998\05\05@194608 by Eric Naus

picon face
Check out my homepage at http://webhome.idirect.com/~bine/  .

I have already done that to control my walker robot. Source code

is included and a test program is also included.

Have Fun

Eric

1998\05\05@195826 by ndie Ohtsji [4555]

flavicon
face
Bill,

> down the stairs.  So there are two things you should
> never do.  Ride a horse up stairs or microwave a bar
> of Ivory Soap.
>
>
> Bill C  EraseMEbill.....spamcornutt.com

What happens to the soap?  Kaboom?

-Randie
spamrohtsjiKILLspamspam@spam@glenayre.com

1998\05\05@222050 by Dan Larson

flavicon
face
On Tue, 5 May 1998 13:38:01 PDT, Bill Cornutt wrote:

>
>
>> Oh No!, not the "cow" thread again!!! <GRIN>
>>
>
>
>
>It looks like it is time to put the 'cow thread' to rest.
>

Its not that there is anything wrong with cows, mind you, but
the topic of cows has come up in other mailing lists that I am
subscribed to.  Why do cows keep coming up as an off-topic
thread?  In the PIC List, the subject of "cow tipping" ran for
several days!

Dan


*******************************
* Dan Larson                  *
* Software Engineer           *
* Micro Control Company       *
* email: dlarsonspamspamTakeThisOuTcitilink.com *
*******************************

1998\05\06@004114 by Calvin

flavicon
face
<snipo>
>never do.  Ride a horse up stairs or microwave a bar
>of Ivory Soap.


Why??? I'm curious about the soap.

Calvin


>
>
>Bill C  RemoveMEbillRemoveMEspamcornutt.com
>

1998\05\08@103018 by Tom Handley

picon face
  Bill, I spent most of my adult life in the country and around cowboys and
ladies. During one rodeo season, a young bull rider with an excess of
Te`killya' in him, rode a Quarter horse up on the dance stage at the local
honky tonk and did a fairly good `4-step' dance with the band. I'm not sure
how it ended as we also had an excess of the same beverage and were on the
floor laughing, but I do know the cowboy and the horse successfully
negotiated the stairs on the way out ;-)

  - Tom

At 01:38 PM 5/5/98 PDT, Bill Cornutt wrote:
[snip]
>A word of warning, horses can go up stairs but because
>of the way their fetlocks are, they can't come back
>down the stairs.  So there are two things you should
>never do.  Ride a horse up stairs or microwave a bar
>of Ivory Soap.
>
>
>Bill C  TakeThisOuTbill@spam@spam@spam@cornutt.com


'Driving MOSFETs; was Re:'
1998\06\05@121043 by paulb
flavicon
face
Gregg Kricorissian wrote:

> Another thing you have to watch with high current loads is keeping the
> drive circuitry and load paths separate ... high frequency PWM can
> cause havoc if the two circuits share much  ground path ... best to
> use single point grounding.

 Which "single point" is actually the source terminal of the FET, that
is, the driver circuit ground and its supply bypass should "hang" from
the source terminal, which is already tied to the negative supply.  The
only problem then is the grounding of input devices.

> After the paper design stage, I prefer to develop a drive circuit by
> monitoring the FET switching waveforms with a scope .... both voltage
> and current, and adjust values to optimize saturation and switching
> times.

 Indeed.  Otherwise you never know!  It may be worthwhile to provide a
special diagnostic "advance synch" output from the PIC for the CRO if it
is generating the PWM.

 Cheers,
       Paul B.


'LED Display driving'
1998\07\16@113528 by ali
flavicon
face
Hi,

In a PIC based project I need to drive 3 groups of 8 digits 7+1
segment (including decimal point) LED displays.

Any suggession will be appreciated..

Thanks...

1998\07\16@120653 by Ricardo Seixas

picon face
Ali,

I can see two paths:
1) You can multiplex the 3 displays (11 pins used). See AN557 for an example.
2) Use 3 shift-register in cascade (i.e. 74595), in this case you use only
3 pins to control
all 24 outputs.

Ricardo Seixas


{Quote hidden}

1998\07\16@132554 by andre

flavicon
face
> A few days ago I posted swtester.asm file that

uses two led display. you can modify mycode very easy. just add 3 Th. register
and
shift subroutine. for first digit REGA for
second digit REGB. wiring  I did very simple

RB0 - DT
RB1 - A
RB2 - B
RB3 - C
RB4 - D
RB5 - E
RB6 - F
RB7 - G

RA0 - to select first digit
RA1 - to select second digit

I used TMR0 for brightness.

Andre Abelian

{Quote hidden}

1998\07\16@132957 by Steve Lawther

flavicon
face
    Ali,

    So its 24 off 7 seg + d.p displays?

    Seems a job for 3 off MAX7129 (I think that's the number) three
wire
    bus to 8 x 7 seg + d.p displays driver controller or for 2 off
Texas
    Inst. TLC5920 16x8bit LED driver controller.

    As for availability - both devices are in production, but I
remember a
    while back people has problems getting the maxim device quickly,
and
    I've only learnt about the TI device this week. The TI data says it

    has been in production from nov '97 at least.

    Hope it helps,

               Steve Lawther



______________________________ Reply Separator
_________________________________
Subject: LED Display driving
Author:  Ali Haydar GOKTOGAN [SMTP:TakeThisOuTalispamspamDYNAMITE.COM.AU]  at UKExchange
Date:    16/07/98 15:46


Hi,

In a PIC based project I need to drive 3 groups of 8 digits 7+1
segment (including decimal point) LED displays.

Any suggession will be appreciated..

Thanks...

1998\07\16@155937 by PIC development

flavicon
picon face
Have you used the '7219. I read the datasheet and thought Yes! this is
just what I want to drive one of those little 8 digit "bubble" display
that the older members of this list may remember in LED calculators.
(pass my walking stick, it's over by my pensioners bus pass).

I got it to work, eventually but it was difficult. In the end I had
to run it at 4V - any higher and the internal oscillator would stop
and freeze the display. In a moment of doubt, I actually thought there
was a bug in my code :-)

Got it to work, and it now has pride of place in a microsecond resolution
stopwatch using a 16c84. Code available on request - but I'm not very
proud of it

Pete

..............................................................................
. Never trust a man who, when left alone in ....... Pete Lynch               .
. a room with a tea cosy, doesn't try it on ....... Marlow, England          .
..........Billy Connolly. ......................... KILLspampicKILLspamspamspamBeGonebeowulf.demon.co.uk ..


On Thu, 16 Jul 1998, Steve Lawther wrote:

{Quote hidden}

1998\07\16@172234 by Michael S. Hagberg

flavicon
face
MAX7219. the only trouble i had was getting it to initialize on startup. i
resolved the problem by initializing the display inside my first display
loop. (when the device was powered on i display 'AAA' for two seconds)

michael


-----Original Message-----
From: Ali Haydar GOKTOGAN <ali@spam@spamKILLspamdynamite.com.au>
To: EraseMEPICLISTRemoveMEspam@spam@MITVMA.MIT.EDU <RemoveMEPICLISTspamspamEraseMEMITVMA.MIT.EDU>
Date: Thursday, July 16, 1998 10:45 AM
Subject: LED Display driving


Hi,

In a PIC based project I need to drive 3 groups of 8 digits 7+1
segment (including decimal point) LED displays.

Any suggession will be appreciated..

Thanks...

1998\07\17@024245 by Dr. Imre Bartfai

flavicon
face
Hi,
I use daisy-chained 74164's, each for very digit. I need only 2 wire for
one display. The Pic Basic Pro does it fine with SHIFTOUT command, but it
is easy to write it in assembly, too. I think for your three groups you
can connect all the DATA lines, only the CLOCK lines should be separate.
If you want nice result, you should turn the display OFF whilst updating
their content. And don't forget the correct CLEAR circuit.

I hope it helps you.

Imre


On Fri, 17 Jul 1998, Ali Haydar GOKTOGAN wrote:

{Quote hidden}

1998\07\17@142014 by Calvin

flavicon
face
If you want to use the '164, you will only need one line for CLK and another
one for DATA, tie all the clock inputs for every '164 together, and the last
output of every '164 to the data input of the next. If you do it fast
enough, you don't even need to shut off the displays while updating.

The way I do it is, with two '164s and four 7447s, and I only use two
microcontroller pins.

Calvin

{Original Message removed}

1998\07\17@163700 by rank A. Vorstenbosch

flavicon
picon face
Steve Lawther wrote:
>
> So its 24 off 7 seg + d.p displays?
>
> Seems a job for 3 off MAX7129 (I think that's the number) three wire
> bus to 8 x 7 seg + d.p displays driver controller or for 2 off Texas
> Inst. TLC5920 16x8bit LED driver controller.

Hmmm, looking it up in QuestLink and on the TI website didn't give any
results.  Do you have a pointer to a datasheet for this device?  Somewhere
on TI's website???

Thanks,
Frank
------------------------------------------------------------------------
Frank A. Vorstenbosch    <UCE_ACCEPT="NONE">    Mobile:  +44-976-430 569
Wimbledon, London SW19                          Home:   +44-181-544 1865
STOPspamfrank.....spamfalstaff.demon.co.uk                      Office: +44-181-636 3391

1998\07\17@191912 by Michael S. Hagberg

flavicon
face
Maxim wouldn't like your reference to TI try this link

http://209.1.238.250/arpdf/1339.pdf

michael


{Original Message removed}

1998\07\20@044017 by Steve Lawther

flavicon
face
    Sorry Frank / All,

    You're right about it not being on the ti web site.

    Having looked at the paper copy again, although the front page says

    'production data' - not 'preliminary' and is dated nov 97, looking
on
    the back cover says:-

    Document code SODSE01 - copyright TI 5/98

    So I guess it's just released - But TI wants you to believe it's
    mature(?)

            Steve Lawther


______________________________ Reply Separator
_________________________________
Subject: Re: LED Display driving
Author:  Frank A. Vorstenbosch [SMTP:spamBeGonefrankRemoveMEspamRemoveMEFALSTAFF.DEMON.CO.UK]  at
UKExchange
Date:    17/07/98 21:26


Steve Lawther wrote:
>
> So its 24 off 7 seg + d.p displays? >
> Seems a job for 3 off MAX7129 (I think that's the number) three wire
> bus to 8 x 7 seg + d.p displays driver controller or for 2 off Texas
> Inst. TLC5920 16x8bit LED driver controller.

Hmmm, looking it up in QuestLink and on the TI website didn't give any
results.  Do you have a pointer to a datasheet for this device?
Somewhere
on TI's website???

Thanks,
Frank
------------------------------------------------------------------------

Frank A. Vorstenbosch    <UCE_ACCEPT="NONE">    Mobile:  +44-976-430 569

Wimbledon, London SW19                          Home:   +44-181-544 1865

@spam@frankspamBeGonespamfalstaff.demon.co.uk                      Office: +44-181-636 3391

1998\07\21@043642 by Jose Antonio Gracia

flavicon
face
part 0 542 bytes content-type:text/x-vcard; charset=us-ascii; name="vcard.vcf"--
Un saludo a todos
               Jose Antonio Gracia

spam_OUTjgranespamspamcolon.net
http://www.geocities.com/SiliconValley/Pines/7097


Attachment converted: wonderland:mc14499.exe (bina/mdos) (00010E52)
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Description: Tarjeta de Jose Antonio  Gracia Negre
Content-Disposition: attachment; filename="vcard.vcf"
X-MIME-Autoconverted: from 8bit to quoted-printable by colon.colon.net id KAA172
18

Attachment converted: wonderland:vcard.vcf (TEXT/CSOm) (00010E53)

1998\07\21@052253 by Frank A. Vorstenbosch

flavicon
face
Jose Antonio Gracia wrote:
>
>                 You know C.I. MC14499?
> Attached scheme in format BMP compressed with ARJ and auto-executable
> It is possible to connect several in series.

What?!?!

Using BMP (a Windoze specific format) compressed with a self-extracting
ARJ (a DOS executable) on the piclist?

First of all, you should not be posting binaries to this list -- many
people object to receiving very large emails like that.  Secondly,
surely GIF would be a more appropriate format -- one that can be decoded
on any machine that can run a web-browser, not just Windoze based ones.
Think of the millions of people not running a PC, or running a PC under
Linux.

Frank
------------------------------------------------------------------------
Frank A. Vorstenbosch     <SPAM_ACCEPT="NONE">    Phone: 0181 - 636 3000
Electronics and Software Engineer                 Mobile: 0976 - 430 569
Eidos Technologies Ltd., Wimbledon, London        Email: spamfavspamspamspameidos.co.uk

1998\07\21@065045 by Jose Antonio Gracia

flavicon
face
part 0 1791 bytes content-type:text/plain

Frank A. Vorstenbosch escribi—:

{Quote hidden}

Pardon Frank. I am new in the list.New attached in format GIF.
Thanks for your explanations.

--
Un saludo a todos
               Jose Antonio Gracia

TakeThisOuTjgranespamspamcolon.net
http://www.geocities.com/SiliconValley/Pines/7097


Attachment converted: wonderland:mc14499.gif (GIFf/JVWR) (00010E54)
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Description: Tarjeta de Jose Antonio  Gracia Negre
Content-Disposition: attachment; filename="vcard.vcf"
X-MIME-Autoconverted: from 8bit to quoted-printable by colon.colon.net id MAA293
83

Attachment converted: wonderland:vcard.vcf 1 (TEXT/CSOm) (00010E55)

1998\07\22@105458 by paulb

flavicon
face
Frank A. Vorstenbosch wrote:

> Using BMP (a Windoze specific format) compressed with a self-
> extracting ARJ (a DOS executable) on the piclist?

 Could be *much* worse.  At least he didn't post the .BMP ;-)  It's
been done more than once!

> First of all, you should not be posting binaries to this list -- many
> people object to receiving very large emails like that.

 Many people object to most things!  Others have a descriptive term
for them.

> Secondly, surely GIF would be a more appropriate format -- one that
> can be decoded on any machine that can run a web-browser, not just
> Windoze based ones.

 This is true, but conflicts with the previous dictum.  Had he used a
better compression algorithm for the task, such as LHArc, he would have
compressed the graphic to only 4943 bytes; a figure so comparable to the
average size of an e-mail that only a professional whinger would object.
As it is, his GIF was a mere 8131 bytes.  (The ARJ SFX was 22,582 by way
of reference and the BMP - 349206!)

> Think of the millions of people not running a PC,

 Is it not hundreds of millions not running a PC?  Or do you mean the
minority *on the internet* not running a PC?

> or running a PC under Linux.

 Can you not get LHA and even ARJ for Linux?  SFXs are unnecessary and
violate commonsense anyway, even if they are not platform-limiting.

--
 Cheers,
       Paul B.

'LED Display driving/sharing drawings'
1998\07\22@121325 by Montaigne, Mike

flavicon
face
Comment:
I'm just using the words of Don Lancaster who thinks Postscript
is the best thing since sliced bread.

I drew the "Cheap Junk ASCII schematic" of Mark Willis
(using Orcad, but the program doesn't matter)
and it created a 32K postscript file, which zipped down to 4K.

Two questions:
Is there a shareware utility to print postscript
for those people who don't have a postscript printer?
I hate drawing and reading "Cheap Junk ASCII schematics"
Is postscript not a good, way to go (for this group and/or in general)?

{Quote hidden}

1998\07\22@123756 by John Haggins

picon face
Could you email me a .jpg or .bmp file of the schematic?

TIA

At 12:10 PM 7/22/98 -0400, you wrote:
{Quote hidden}

1998\07\22@124014 by er

flavicon
face
The "cheap junk ASCII schematic" looked unreadable
at first, but when changed to courier font it is really
pretty good.

{Original Message removed}

1998\07\22@125228 by Thomas McGahee

flavicon
face
----------
> From: Montaigne, Mike <RemoveMEmontaignemKILLspamspamKILLspamAECL.CA>
> To: EraseMEPICLISTspamBeGonespamspamMITVMA.MIT.EDU
> Subject: Re: LED Display driving/sharing drawings
> Date: Wednesday, July 22, 1998 12:10 PM
>
> Comment:
> I'm just using the words of Don Lancaster who thinks Postscript
> is the best thing since sliced bread.
>
> I drew the "Cheap Junk ASCII schematic" of Mark Willis
> (using Orcad, but the program doesn't matter)
> and it created a 32K postscript file, which zipped down to 4K.
>
> Two questions:
> Is there a shareware utility to print postscript
> for those people who don't have a postscript printer?
> I hate drawing and reading "Cheap Junk ASCII schematics"
> Is postscript not a good, way to go (for this group and/or in general)?
>

I believe there is a program called 'ghostscript' that allows
non-postscript devices to output postscript files.

Try doing a web search on ghostscript.


Fr. Tom McGahee

1998\07\22@175033 by Mark Willis

flavicon
face
Oops, I'll try to mention monospace fonts in future <G>

 Need to get a couple machines running here so I can make good GIFs...

 One hidden problem for Win 3.x users: Many new s/w packages require
Win32s to run on Win 3.x;  Many other software packages choke and die a
slow, horrible death if Win32s is present.  (Dunno if GhostScript is an
offender here.)  It's frustrating, as I'm a reliability fanatic!

 Mark, KILLspammwillisspamnwlink.com

John Shreffler wrote:
>
> The "cheap junk ASCII schematic" looked unreadable
> at first, but when changed to courier font it is really
> pretty good.

1998\07\22@180719 by Peter L. Peres

picon face
On Wed, 22 Jul 1998, John Shreffler wrote:

> The "cheap junk ASCII schematic" looked unreadable
> at first, but when changed to courier font it is really
> pretty good.
>
> {Original Message removed}

1998\07\22@184236 by Peter L. Peres

picon face
On Wed, 22 Jul 1998, Mark Willis wrote:

>   One hidden problem for Win 3.x users: Many new s/w packages require
> Win32s to run on Win 3.x;  Many other software packages choke and die a
> slow, horrible death if Win32s is present.  (Dunno if GhostScript is an
> offender here.)  It's frustrating, as I'm a reliability fanatic!

Is that why you run Windoze on a PC ? What about a little UNIX [tm] (,
Linux, SCO, BSD, FreeBSD...)  propaganda here ;)

Peter

1998\07\22@194518 by Fred Dunn

flavicon
face
Try Ghostscript.  I've used it for years and it's an absolutely reliable
postscript viewer and printer.

Try:

http://www.cs.wisc.edu/~ghost/aladdin/
http://www.cs.wisc.edu/~ghost/gsview/

-----Original Message-----
snip
>Is there a shareware utility to print postscript
>for those people who don't have a postscript printer?
>I hate drawing and reading "Cheap Junk ASCII schematics"
>

1998\07\23@035633 by Mark Birks

flavicon
face
Hi folks,

Just came in on the end of this thread.

A good Postscript interpretor package (for windows anyway) is
GHOSTSCRIPT/GHOSTVIEW. It takes pretty much most postscript files I've ever
thrown at it and can print to configured printers, PDF files, graphics
files.

I use it to get GERBER files as a JPG file for use in engineering
documentation, sharing schematics etc etc.

Simply print, from your chosen package, to a postscript printer (configured
to print to a file) then load into GHOSTVIEW and print out to a 300DPI
bitmap. this can then be processed in a graphics package as required - I use
TIF or JPG output which gives a MUCH smaller file size....


      \\\|///
    \\  - -  // "Yes it IS safe
     (  @ @  )   to switch on"
+---oOOo-(_)-oOOo------------------+
| Mark Birks                       |
| Hardware Section Leader          |
| OmniBus Systems, Stanford House, |
| Stanford-on-Soar,                |
| Loughborough, Leicestershire. UK.|
|                                  |
| Tel/Fax: +44 (0)990 004300/333   |
| E-Mail: markbspam_OUTspamspamomnibus.co.uk      |
|   ooo0                           |
|  (    )   0ooo                   |
+---\  (----(   )------------------+
    \_)     ) /
           (_/



> {Original Message removed}

1998\07\23@052509 by Mark Willis

flavicon
face
Peter L. Peres wrote:
>
> On Wed, 22 Jul 1998, Mark Willis wrote:
>
> >   One hidden problem for Win 3.x users: Many new s/w packages require
> > Win32s to run on Win 3.x;  Many other software packages choke and die a
> > slow, horrible death if Win32s is present.  (Dunno if GhostScript is an
> > offender here.)  It's frustrating, as I'm a reliability fanatic!
>
> Is that why you run Windoze on a PC ? What about a little UNIX [tm] (,
> Linux, SCO, BSD, FreeBSD...)  propaganda here ;)
>
> Peter

 Sure;  I started out on a Wang 2200B years ago, moved to CP/M then to
MS-Dos at home (with time in NOS/BE, SCOPE, PR1ME OS, varied IBM OS'es
at work on Sys/370's, and a lot of Dos/Windows) - I'm in the learning
curve for Linux, have been putting Linux-compatible hardware in all
machines, and soon as I finish reading a couple books so I know what do
do once I've installed Slackware, I'll even LOAD Slackware.

 But I need to get there from here!  I need to stay (much more than I
am now!) productive until that day comes <G>  And these 96 hour work
weeks just eat me alive...

 I just use my Postscript printer, an old sturdy NEC LC 890, myself.
That works pretty well!  But that's cheating <G>

 Mark, Mr. "Too Many Computers, none under Win95 yet"


'Semi-[OT] Driving peizo transducers directly from'
1998\08\29@134313 by Ansel Sermersheim
flavicon
face
I'm contemplating a project which will use (ultrasonic) peizo
transducers.  I don't want to go to all the trouble of implementing
FSK in hardware, so I'd like to generate the already-modulated square
wave in software.

That's not a problem; I'm a decent programmer.  However, these xducers
take some odd drive circuitry.  Has anyone figured out a circuit to
drive these from a output pin?  I'm going to be running in the range
of 38-42 kHz.

If not, I'll have to learn quite a bit more about linear electronics
before I can implement this, I think.

Thanks very much,
-Ansel
--
I used to be convinced that MicroSquish shipped crap because they simply
didn't give a flying fuck as long as the sheep kept buying their shit.
Now, I'm convinced that they really do ship the best products they are
capable of writing, and *that's* tragic.
  - John C. Randolph, about MS quality control.

1998\08\29@153208 by Peter L. Peres

picon face
imho, you can obtain 20 usec loops relatively easily with a PIC at 4 MHz
for transmission ( == 50 kHz), but for a decent receiver at that frequency
you'd need to use a faster clock. What are your trying to modulate ? 4-bit
voice can be passed through such a channel but don't tell me about the
quality (you'd use crude ADPCM at 8 kHz). I've tried to do a simplex codec
with two PIC 16C71s once and it works but MAJOR work is required to make
the sound reasonable w/o external hardware.

Peter

1998\08\29@163746 by Ansel Sermersheim

flavicon
face
>>>>> "Peter" == Peter L Peres <plpspamspam@spam@ACTCOM.CO.IL> writes:

> imho, you can obtain 20 usec loops relatively easily with a PIC at 4
> MHz for transmission ( == 50 kHz), but for a decent receiver at that
> frequency you'd need to use a faster clock. What are your trying to
> modulate ? 4-bit voice can be passed through such a channel but
> don't tell me about the quality (you'd use crude ADPCM at 8

I'm using FSK to pass digital data.  I'm only going to be using about
2400 bps, with two filters to receive.  I can easily poll at 415 usec
to read that.

However, it would be a lot easier if I don't have to rig something
similar to that for xmit.

> Peter
-Ansel
--
I used to be convinced that MicroSquish shipped crap because they simply
didn't give a flying fuck as long as the sheep kept buying their shit.
Now, I'm convinced that they really do ship the best products they are
capable of writing, and *that's* tragic.
  - John C. Randolph, about MS quality control.

1998\08\29@165030 by cousens

flavicon
face
part 0 954 bytes
In one job where I needed to make a smart alarm to interface with an
analog pressure sensor
I used a micro (small) peizo siren, removing the existing pcb (35mm x
29mm)
fitting a 16f84 on the equivalent size perf-board

I kept the peizo drive circuit components which were

A 100 Ohm resistor to the base of a 2N5551, emitter to ground
colector to the stepup (20 to 1 ?) transformer(ferrite) pin 1
The stepup transformer common, pin 2 connects to +
and the peizo connects to + and the third pin

The main advantages of modifying a siren is that you get the case,
mounted peizo and transformer, but if you want to do it yourself
then I sugest you try this circuit with a trigger transformer
the type used for Xenon tubes the ratio is around 50 to 1

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

Attachment converted: wonderland:pdrive.gif (GIFf/JVWR) (00015505)

1998\08\29@170315 by Chip Weller

flavicon
face
Ansel Sermersheim wrote:


>>>>>> "Peter" == Peter L Peres <.....plp@spam@spamACTCOM.CO.IL> writes:
>
>> imho, you can obtain 20 usec loops relatively easily with a PIC at 4
>> MHz for transmission ( == 50 kHz), but for a decent receiver at that
>> frequency you'd need to use a faster clock. What are your trying to
>> modulate ? 4-bit voice can be passed through such a channel but
>> don't tell me about the quality (you'd use crude ADPCM at 8
>
>I'm using FSK to pass digital data.  I'm only going to be using about
>2400 bps, with two filters to receive.  I can easily poll at 415 usec
>to read that.
>
>However, it would be a lot easier if I don't have to rig something
>similar to that for xmit.
>
>> Peter
>-Ansel


The piezo and film devices normal require a high voltage, but very little
current. The current requirements from the raw supply normal requires you to
use an off chip transistor (NPN or N-Channel MOSFET) to switch the current.
Use this to drive a transformer single ended. Tune the transformer leakage
inductance to be complementary to your capacitive piezo device at your
center frequency, this can provide a large voltage boost at high
effieciency. It is not hard to produce 600Vpp this way.

If I was trying to receive FSK I would use a simple bandpass filter wide
enough for both frequencies and then feed that into TMR0 or TMR1. Every
1/(3*2400) seconds read the change in the counter and just compare against
the center frequency to determine if the input is a 0 or 1. To synchronize
with the start pulse you would expect to see the mean frequency on the pulse
which contains the edge, if it closer to the 1 level then shift your phase
back in time, and if it is closer to the 0 level then shift it forward in
time.

Chip Weller

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