Serial IC

M

Martin Stefanus

Guest
Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way. Do you know an IC that does that without any other
supporting IC(s)? The speed does not need to be very high, something
around 9600 bps would do more than fine. Thank you in advance.
 
Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way. Do you know an IC that does that without any other
supporting IC(s)? The speed does not need to be very high, something
around 9600 bps would do more than fine. Thank you in advance.
A suitably programmed microcontroller would do this easily.


Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting
 
Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way. Do you know an IC that does that without any other
supporting IC(s)? The speed does not need to be very high, something
around 9600 bps would do more than fine. Thank you in advance.
These days, the easy way to do that would probably be to use a PIC or
similar microcontroller. There's probably a 14-pin PIC which can run
from an internal R/C oscillator with enough precision to let you hit
9600 bits/second accurately enough to talk to a UART.

--
Dave Platt <dplatt@radagast.org> AE6EO
Hosting the Jade Warrior home page: http://www.radagast.org/jade-warrior
I do _not_ wish to receive unsolicited commercial email, and I will
boycott any company which has the gall to send me such ads!
 
On 24 Jul 2003 12:05:18 -0700, emails@newmail.net (Martin Stefanus) wrote:

Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way. Do you know an IC that does that without any other
supporting IC(s)? The speed does not need to be very high, something
around 9600 bps would do more than fine. Thank you in advance.
A suitably programmed pic16c505 will do this easily and cheaply.
 
"Dave Platt" <dplatt@radagast.org> wrote in message
news:vi0ga054k2lcb4@corp.supernews.com...
Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way. Do you know an IC that does that without any other
supporting IC(s)? The speed does not need to be very high, something
around 9600 bps would do more than fine. Thank you in advance.

These days, the easy way to do that would probably be to use a PIC or
similar microcontroller. There's probably a 14-pin PIC which can run
from an internal R/C oscillator with enough precision to let you hit
9600 bits/second accurately enough to talk to a UART.
Look at the PIC16F628. An overkill in a lot of ways, but it has the
following features going for it. 18pin package, including a USART built in.
Built in 4MHz oscillator, calibrated to better than 1%. the problem is that
most of the 8pin variants have the oscillator, but the larger chips often
don't. Obviously the 'minimum' requirement, is 11pins, unless an external
multiplexer is used. Having a built in USART, makes the output a doddle. It
is also remarkably cheap (funnily, the 628, is cheaper than the 627, despite
having twice the memory...). Currently runs at about 2$, in '1 off'.
Programming is also a 'doddle', and simple circuits, can do this with only a
handful of parts necessary.

Best Wishes
 
"Mike Harrison" <mike@whitewing.co.uk> wrote in message
news:jfg0ivgh8oognt624icgoo19pvri2u620t@4ax.com...
On 24 Jul 2003 12:05:18 -0700, emails@newmail.net (Martin Stefanus) wrote:

Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way. Do you know an IC that does that without any other
supporting IC(s)? The speed does not need to be very high, something
around 9600 bps would do more than fine. Thank you in advance.

A suitably programmed pic16c505 will do this easily and cheaply.
A few years ago, I'd have agreed with you, but the older parts have risen in
cost massively compared to the newer reprogrammable parts. The 16C505,
currently lists at $6.25, when the much more powerful (and reprogrammable -
better for development 16F627-04), is listing at $1.81 from the same
supplier.
It is well worth looking at the newer PICs, there prices are much more
aggressive. :)

Best Wishes
 
In article <vi0ga054k2lcb4@corp.supernews.com>, dplatt@radagast.org
mentioned...
Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way. Do you know an IC that does that without any other
supporting IC(s)? The speed does not need to be very high, something
around 9600 bps would do more than fine. Thank you in advance.

These days, the easy way to do that would probably be to use a PIC or
similar microcontroller. There's probably a 14-pin PIC which can run
from an internal R/C oscillator with enough precision to let you hit
9600 bits/second accurately enough to talk to a UART.
I tore apart a mouse recently that didn't have the usual resonator,
all it had was a 1% resistor. So apparently they use some internal
capacitance and the resistor to generate the clock with enough
accuracy to give the mouse baudrate of 1200 baud.

I suppose one could build it out of a CMOS parallel in, serial out
chip like the 4014 or 4021, but it would take other chips, too.

--
@@F@r@o@m@@O@r@a@n@g@e@@C@o@u@n@t@y@,@@C@a@l@,@@w@h@e@r@e@@
###Got a Question about ELECTRONICS? Check HERE First:###
http://users.pandora.be/educypedia/electronics/databank.htm
My email address is whitelisted. *All* email sent to it
goes directly to the trash unless you add NOSPAM in the
Subject: line with other stuff. alondra101 <at> hotmail.com
Don't be ripped off by the big book dealers. Go to the URL
that will give you a choice and save you money(up to half).
http://www.everybookstore.com You'll be glad you did!
Just when you thought you had all this figured out, the gov't
changed it: http://physics.nist.gov/cuu/Units/binary.html
@@t@h@e@@a@f@f@l@u@e@n@t@@m@e@e@t@@t@h@e@@E@f@f@l@u@e@n@t@@
 
On Thu, 24 Jul 2003 23:48:53 -0700, Watson A.Name - 'Watt Sun' <alondra101@hotmail.com> wrote:

In article <vi0ga054k2lcb4@corp.supernews.com>, dplatt@radagast.org
mentioned...
Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way. Do you know an IC that does that without any other
supporting IC(s)? The speed does not need to be very high, something
around 9600 bps would do more than fine. Thank you in advance.

These days, the easy way to do that would probably be to use a PIC or
similar microcontroller. There's probably a 14-pin PIC which can run
from an internal R/C oscillator with enough precision to let you hit
9600 bits/second accurately enough to talk to a UART.

I tore apart a mouse recently that didn't have the usual resonator,
all it had was a 1% resistor. So apparently they use some internal
capacitance and the resistor to generate the clock with enough
accuracy to give the mouse baudrate of 1200 baud.
Not necessarily - it could be calibrating against an incoming data byte.
 
"Mike Harrison" <mike@whitewing.co.uk> wrote in message
news:dpt1ivkq1siv5p6mad0nkni5cpo7b0vk85@4ax.com...
On Thu, 24 Jul 2003 22:47:15 +0100, "Roger Hamlett"
rogerspamignored@ttelmah.demon.co.uk> wrote:


"Mike Harrison" <mike@whitewing.co.uk> wrote in message
news:jfg0ivgh8oognt624icgoo19pvri2u620t@4ax.com...
On 24 Jul 2003 12:05:18 -0700, emails@newmail.net (Martin Stefanus)
wrote:

Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way. Do you know an IC that does that without any other
supporting IC(s)? The speed does not need to be very high, something
around 9600 bps would do more than fine. Thank you in advance.

A suitably programmed pic16c505 will do this easily and cheaply.
A few years ago, I'd have agreed with you, but the older parts have risen
in
cost massively compared to the newer reprogrammable parts. The 16C505,
currently lists at $6.25, when the much more powerful (and
reprogrammable -
better for development 16F627-04), is listing at $1.81 from the same
supplier.
It is well worth looking at the newer PICs, there prices are much more
aggressive. :)

www.findchips.com shows prices wown to $1.33 for 16c505. and $1.68 for
16F627.

The newer ones are certainly good value, but if you don't need their extra
functions, the older
parts can often be cheaper for production.
Did you actually check stock on the suppliers listing the 16C505 at this
price?. I found two suppliers with cheap prices listed for the 505, but
neither showed stock. The $6.25, was on a quick search, the lowest price I
could see, where the supplier actually had the chips. I was also looking for
'one off' availability, since unless I read the question wrong, I don't
think the original enquirer is after 1000 off prices (the findchip prices
are normally for bulk quantities). At the 'low run' end of the market, the
older parts have a premium price. Also, the 'source' prices of these parts
have shot up in the last couple of months, so the suppliers offering these
at low prices, are probably shifting old stock (hence my comment), and I
have to suspect that production now is in relatively small small batches
with massive price variations as these become available.

Best Wishes
 
These days, the easy way to do that would probably be to use a PIC or
similar microcontroller. There's probably a 14-pin PIC which can run
from an internal R/C oscillator with enough precision to let you hit
9600 bits/second accurately enough to talk to a UART.
The 16F630 has an internall OSC and it will probably work, but from
the worst case figures you should not rely on it. Add a cheap crystal
or resonator.

PS in my webshop a16F630 + Xtal ~ E 3.00 (plus S/H).


Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting
 
www.findchips.com shows prices wown to $1.33 for 16c505. and $1.68 for 16F627.

The newer ones are certainly good value, but if you don't need their extra functions, the older
parts can often be cheaper for production.
I did not get the impression that the OP was aiming at 1k+ units :)



Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting
 
Why does everyone nowadays insist on using a PIC to do absolutely anything,
however simple? You have to program the thing, worry about which one to use,
etc etc. This simple requirement would be satisfied by just 2 ordinary logic
IC's. Just connect them up and they go, no programming. Yes you *could* do
it with a PIC. If you weren't already a PIC expert, waste of time. Even for
a PIC expert, I doubt you'd be able to get it working as quickly as the
simple 2-logic-chip version. The 2 logic chips almost certainly cheaper than
a PIC too!
The OP mentioned something about 9600 baud, which suggests to me that
he probably wants asynch serial data, which would not be so easy using
TTL.

I cannot comment for a non-PIC expert, but maybe you forget that a
PIC-expert is (by lazyness, maybe) probably not as expert in using TTL
chips. For me writing the program to send the data would probably take
a few minutes to write and a few more to debug. In fact, this would
probably be the program for a 16F630:

include f675_20 -- no 16F630/676 support yet, use 12F675
include jlib

port_a_direction = all_output
port_c_direction = all_input

const asynch_baudrate = 9600
const asynch_polarity = active_high
const asynch_parity = parity_none
const asynch_stopbits = 2

var volatile bit asynch_in_pin is pin_a0
var volatile bit asynch_in_direction is pin_a0_direction

var volatile bit asynch_out_pin is pin_a1
var volatile bit asynch_out_direction is pin_a1_direction

include seriali

forever loop
delay_100ms( 5 )
asynch_send( port_a )
end loop


Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting
 
On Thu, 24 Jul 2003 20:05:18 +0100, Martin Stefanus wrote:

Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in serial
way. Do you know an IC that does that without any other supporting
IC(s)? The speed does not need to be very high, something around 9600
bps would do more than fine. Thank you in advance.
A UART?

--
Then there's duct tape ...
(Garrison Keillor)
nofr@sbhevre.pbzchyvax.pb.hx
 
Hiya!

Okay, as we're suggesting programs, here's some code I cooked up for
using a GAL for the same purpose - 8 bits in, transmitting an 8-N-1
serial stream (in CUPL):

Device g22v10;

/** Inputs **/

Pin 1 = d0;
Pin 2 = d1;
Pin 3 = d2;
Pin 4 = d3;
Pin 5 = d4;
Pin 6 = d5;
Pin 7 = d6;
Pin 8 = d7;
Pin 9 = a0;
Pin 10 = a1;
Pin 11 = a2;
Pin 13 = a3;

/** Outputs **/

Pin 19 = so; /** Serial output **/
Pin 18 = sr; /** Synchronous Reset **/

/** main **/

sr = a3 & !a2 & !a1 & a0;

/** 8-N-1 equation, others could be specified **/

so = (!a3 & !a2 & !a1 & !a0 & 'b'0) #
(!a3 & !a2 & !a1 & a0 & d0) #
(!a3 & !a2 & a1 & !a0 & d1) #
(!a3 & !a2 & a1 & a0 & d2) #
(!a3 & a2 & !a1 & !a0 & d3) #
(!a3 & a2 & !a1 & a0 & d4) #
(!a3 & a2 & a1 & !a0 & d5) #
(!a3 & a2 & a1 & a0 & d6) #
(a3 & !a2 & !a1 & !a0 & d7) #
(a3 & !a2 & !a1 & a0 & 'b'1);

Okay, maybe not as cheap as a pic (especially as you need a 22v10), and
you'd need a sync. resetable counter, and an oscillator, but it just
shows another way. The equation could be altered for other stop bits,
and a parity equation could be written as well.

Yours, Mark.


"Wouter van Ooijen (www.voti.nl)" wrote:
Why does everyone nowadays insist on using a PIC to do absolutely anything,
however simple? You have to program the thing, worry about which one to use,
etc etc. This simple requirement would be satisfied by just 2 ordinary logic
IC's. Just connect them up and they go, no programming. Yes you *could* do
it with a PIC. If you weren't already a PIC expert, waste of time. Even for
a PIC expert, I doubt you'd be able to get it working as quickly as the
simple 2-logic-chip version. The 2 logic chips almost certainly cheaper than
a PIC too!

The OP mentioned something about 9600 baud, which suggests to me that
he probably wants asynch serial data, which would not be so easy using
TTL.

I cannot comment for a non-PIC expert, but maybe you forget that a
PIC-expert is (by lazyness, maybe) probably not as expert in using TTL
chips. For me writing the program to send the data would probably take
a few minutes to write and a few more to debug. In fact, this would
probably be the program for a 16F630:

include f675_20 -- no 16F630/676 support yet, use 12F675
include jlib

port_a_direction = all_output
port_c_direction = all_input

const asynch_baudrate = 9600
const asynch_polarity = active_high
const asynch_parity = parity_none
const asynch_stopbits = 2

var volatile bit asynch_in_pin is pin_a0
var volatile bit asynch_in_direction is pin_a0_direction

var volatile bit asynch_out_pin is pin_a1
var volatile bit asynch_out_direction is pin_a1_direction

include seriali

forever loop
delay_100ms( 5 )
asynch_send( port_a )
end loop

Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting
 
Hi (to myself!)

Actually, I've just thought, the counter could be written into the GAL
as well, so you'd only need an external oscillator. Would have to change
a few of the pinouts around though....

Yours, Mark.

"Mark (UK)" wrote:
Hiya!

Okay, as we're suggesting programs, here's some code I cooked up for
using a GAL for the same purpose - 8 bits in, transmitting an 8-N-1
serial stream (in CUPL):

Device g22v10;

/** Inputs **/

Pin 1 = d0;
Pin 2 = d1;
Pin 3 = d2;
Pin 4 = d3;
Pin 5 = d4;
Pin 6 = d5;
Pin 7 = d6;
Pin 8 = d7;
Pin 9 = a0;
Pin 10 = a1;
Pin 11 = a2;
Pin 13 = a3;

/** Outputs **/

Pin 19 = so; /** Serial output **/
Pin 18 = sr; /** Synchronous Reset **/

/** main **/

sr = a3 & !a2 & !a1 & a0;

/** 8-N-1 equation, others could be specified **/

so = (!a3 & !a2 & !a1 & !a0 & 'b'0) #
(!a3 & !a2 & !a1 & a0 & d0) #
(!a3 & !a2 & a1 & !a0 & d1) #
(!a3 & !a2 & a1 & a0 & d2) #
(!a3 & a2 & !a1 & !a0 & d3) #
(!a3 & a2 & !a1 & a0 & d4) #
(!a3 & a2 & a1 & !a0 & d5) #
(!a3 & a2 & a1 & a0 & d6) #
(a3 & !a2 & !a1 & !a0 & d7) #
(a3 & !a2 & !a1 & a0 & 'b'1);

Okay, maybe not as cheap as a pic (especially as you need a 22v10), and
you'd need a sync. resetable counter, and an oscillator, but it just
shows another way. The equation could be altered for other stop bits,
and a parity equation could be written as well.

Yours, Mark.

"Wouter van Ooijen (www.voti.nl)" wrote:

Why does everyone nowadays insist on using a PIC to do absolutely anything,
however simple? You have to program the thing, worry about which one to use,
etc etc. This simple requirement would be satisfied by just 2 ordinary logic
IC's. Just connect them up and they go, no programming. Yes you *could* do
it with a PIC. If you weren't already a PIC expert, waste of time. Even for
a PIC expert, I doubt you'd be able to get it working as quickly as the
simple 2-logic-chip version. The 2 logic chips almost certainly cheaper than
a PIC too!

The OP mentioned something about 9600 baud, which suggests to me that
he probably wants asynch serial data, which would not be so easy using
TTL.

I cannot comment for a non-PIC expert, but maybe you forget that a
PIC-expert is (by lazyness, maybe) probably not as expert in using TTL
chips. For me writing the program to send the data would probably take
a few minutes to write and a few more to debug. In fact, this would
probably be the program for a 16F630:

include f675_20 -- no 16F630/676 support yet, use 12F675
include jlib

port_a_direction = all_output
port_c_direction = all_input

const asynch_baudrate = 9600
const asynch_polarity = active_high
const asynch_parity = parity_none
const asynch_stopbits = 2

var volatile bit asynch_in_pin is pin_a0
var volatile bit asynch_in_direction is pin_a0_direction

var volatile bit asynch_out_pin is pin_a1
var volatile bit asynch_out_direction is pin_a1_direction

include seriali

forever loop
delay_100ms( 5 )
asynch_send( port_a )
end loop

Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting
 
On Thu, 24 Jul 2003 20:27:44 -0000, dplatt@radagast.org (Dave Platt)
wrote:

Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way. Do you know an IC that does that without any other
supporting IC(s)? The speed does not need to be very high, something
around 9600 bps would do more than fine. Thank you in advance.
How about a remote control transmitter, such as the Holtek HT6221
(or it's equals). It will serially transmit 8 bits, twice, the second
time as a complement, for error correction.
 
Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way.
....

Look at the PIC16F628. An overkill in a lot of ways, but it has the
following features going for it. 18pin package, including a USART built in.
....

If you like low level software, PICs are fun and a good tool to
have in your collection.

You need a programming setup. Search the web for various
homebrew hacks.

Or spend $36 for Microchip's PICKit that connects via USB.
http://www.microchip.com/1010/pline/tools/picmicro/demo/pickit/index.htm
Digikey has them.

It only works with the 12F629/675 (8 pin) and 16F630/676 (14 pins).
The second of each pair has an A/D. The second pair has 6 more
GPIO pins. All 4 have a builtin 1 MHz osc.

I'm scheming for a way to do this in an 8 pin part. The classic way
to read switches is with an X-Y decoding matrix. That would take 6
pins, 3 for X and 3 for Y to read up to 9 switches. But we only have
5 pins: 8 minus 2 for power and 1 for the serial/output signal.

The tips and tricks memo (off above web page) has several ideas, but
I didn't find anything directly appropriate for this problem.

5 pins is 3x2 for 6 switches. So we would have to double up twice.
It might be reasonable to do it by adding a C and putting different
valued resistors in series with each of the doubled up pair and then
measuring the time constant.

--
The suespammers.org mail server is located in California. So are all my
other mailboxes. Please do not send unsolicited bulk e-mail or unsolicited
commercial e-mail to my suespammers.org address or any of my other addresses.
These are my opinions, not necessarily my employer's. I hate spam.
 
"Hal Murray" <hmurray@suespammers.org> wrote in message
news:vi63tpqlo9pn11@corp.supernews.com...
Hello everyone! I have a question, I hope you can give me a possible
solution to this. I need an IC that reads a binary combination (dip
switch - 8 bit) and the transmit that combination using logic in
serial way.
...

Look at the PIC16F628. An overkill in a lot of ways, but it has the
following features going for it. 18pin package, including a USART built
in.
...

If you like low level software, PICs are fun and a good tool to
have in your collection.

You need a programming setup. Search the web for various
homebrew hacks.

Or spend $36 for Microchip's PICKit that connects via USB.
http://www.microchip.com/1010/pline/tools/picmicro/demo/pickit/index.htm
Digikey has them.

It only works with the 12F629/675 (8 pin) and 16F630/676 (14 pins).
The second of each pair has an A/D. The second pair has 6 more
GPIO pins. All 4 have a builtin 1 MHz osc.

I'm scheming for a way to do this in an 8 pin part. The classic way
to read switches is with an X-Y decoding matrix. That would take 6
pins, 3 for X and 3 for Y to read up to 9 switches. But we only have
5 pins: 8 minus 2 for power and 1 for the serial/output signal.

The tips and tricks memo (off above web page) has several ideas, but
I didn't find anything directly appropriate for this problem.

5 pins is 3x2 for 6 switches. So we would have to double up twice.
It might be reasonable to do it by adding a C and putting different
valued resistors in series with each of the doubled up pair and then
measuring the time constant.
Remember chips like the F629, have A/D converters built it. You can quite
easily distinguish say four keys, by using weighting resistors (eight would
be asking rather too much of resistor accuracy, and the A/D), to give a
sixteen level voltage output, so using two A/D inputs, makes it possible on
just three pins (two analog inputs, and one for serial). :)

Best Wishes
 
I'm scheming for a way to do this in an 8 pin part.
IMHO the price difference between the 8 and 14 pin parts is so small
that it is not worth the effort. And the internal osc is just barely
adequate for aynch communication, so you might want an xtal or
resonator anyway.


Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting
 
Agreed. It will certainly do the job. You'll need to add a crystal to
get the frequency stability required to do the serial interface.
I disagree on this. The internal oscillator, has a 'worst case' drift, that
is _just_ bad enough to kill serial comms, but this is over the full
operating temperature range. They actually quote the oscillator to be better
than 1% accurate, over the range 15C to 25C, and this is plenty good enough
for serial comms (it is this good, provided you supply is stable - the
frequency changes noticeably with supply changes).
IIRC you are quoting 'typical' data now, not worst case. Good enough
for a hobby project, and for a 1M+ units project that can afford
extensive testing, but not good for your night's rest when you have a
10k units project.

And don't tell me you built it and it worked - tell me again when you
sold 10k units and did not get a complaint.

And I forgot - did the OP state that the device would be used in
15-25C only?


Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting
 

Welcome to EDABoard.com

Sponsor

Back
Top