| View previous topic :: View next topic |
| Author |
Message |
Gary Tait Guest
|
Posted: Sat Jul 26, 2003 5:49 am Post subject: Re: Serial IC |
|
|
On Thu, 24 Jul 2003 20:27:44 -0000, dplatt@radagast.org (Dave Platt)
wrote:
[quote]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.
[/quote]
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. |
|
| |
|
Back to top |
Hal Murray Guest
|
Posted: Sun Jul 27, 2003 4:33 am Post subject: Re: Serial IC |
|
|
[quote]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.
....[/quote]
[quote]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.
....[/quote]
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. |
|
| |
|
Back to top |
Roger Hamlett Guest
|
Posted: Sun Jul 27, 2003 2:17 pm Post subject: Re: Serial IC |
|
|
"Hal Murray" <hmurray@suespammers.org> wrote in message
news:vi63tpqlo9pn11@corp.supernews.com...
[quote]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[/quote]
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 |
|
| |
|
Back to top |
Wouter van Ooijen (www.vo Guest
|
Posted: Sun Jul 27, 2003 4:45 pm Post subject: Re: Serial IC |
|
|
[quote]I>m scheming for a way to do this in an 8 pin part.
[/quote]
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 |
|
| |
|
Back to top |
Wouter van Ooijen (www.vo Guest
|
Posted: Tue Jul 29, 2003 1:16 am Post subject: Re: Serial IC |
|
|
[quote]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).
[/quote]
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 |
|
| |
|
Back to top |
Hal Murray Guest
|
Posted: Tue Jul 29, 2003 12:07 pm Post subject: Re: Serial IC |
|
|
[using PIC internal osc for RS232]
[quote]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.
[/quote]
So how good a clock do I need to generate (or receive)
an RS-232 signal?
The specs say 1% for initial calibration (at 25C and 3.5V and
2% over 2.5V to 5.5V and 0C to 85C.
Is 2% good enough? That>s 20% of a bit time if you have 10 bits
(10 is 8 rounded up to make handwaving like this simpler) with
no transitions to resync on. Double that if the other end is
off as far in the other direction and we are getting to an
"interesting" value.
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. |
|
| |
|
Back to top |
Wouter van Ooijen (www.vo Guest
|
Posted: Tue Jul 29, 2003 12:53 pm Post subject: Re: Serial IC |
|
|
[quote][using PIC internal osc for RS232]
The specs say 1% for initial calibration (at 25C and 3.5V and
2% over 2.5V to 5.5V and 0C to 85C.
Is 2% good enough? That>s 20% of a bit time if you have 10 bits
(10 is 8 rounded up to make handwaving like this simpler) with
no transitions to resync on. Double that if the other end is
off as far in the other direction and we are getting to an
"interesting" value.
[/quote]
There is some ~ 3% margin. But there are a lot of factors that 'eat'
from this margin:
- clock accuracy (on both sides!!!)
- a receiving UART samples at discrete moments only
- a receiving UART samples a fixed number of times in each bit cell
(often 3 or 5 times)
- drivers can have different H-t-L and L-t-H delays
- the cable will add some interesting (waveform-dependent) distortions
For myself I would not trust asynch communication with less than 1%
accuracy, unless I know the other side is accurate (crystal), the T
and Vcc are stable, and the user does not have my phone number.
Wouter van Ooijen
-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting |
|
| |
|
Back to top |
Wouter van Ooijen (www.vo Guest
|
Posted: Tue Jul 29, 2003 8:13 pm Post subject: Re: Serial IC |
|
|
[quote]The specs for RS232, allow for up to 4% drift at both ends.
[/quote]
That would surprise me, with 8% clock difference the last bit cell can
be shifted almost one cell.
Exactly which spec are you referring to? The RS-232 specs I know do
not even hint at the format of the tranferred data.
Wouter van Ooijen
-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting |
|
| |
|
Back to top |
Roger Hamlett Guest
|
Posted: Tue Jul 29, 2003 8:47 pm Post subject: Re: Serial IC |
|
|
"Wouter van Ooijen (www.voti.nl)" <wouter@voti.nl> wrote in message
news:3f268ec7.351226216@news.xs4all.nl...
[quote]The specs for RS232, allow for up to 4% drift at both ends.
That would surprise me, with 8% clock difference the last bit cell can
be shifted almost one cell.
Exactly which spec are you referring to? The RS-232 specs I know do
not even hint at the format of the tranferred data.
Wouter van Ooijen
CCITT V5. This is based on the older RS232D specs, and gives timing[/quote]
recommendations (as opposed to the signalling specs). Though the basic RS232
paperwork, only covers the signalling standards, they do give
recommendations for clock drift, and for 10bit data say this should be
better than 4%.
This is the whole 'point', that the worst case drift should not take the
sampling point outside the cell, allowing for the switching time (which is
also defined).
Best Wishes |
|
| |
|
Back to top |
Wouter van Ooijen (www.vo Guest
|
Posted: Wed Jul 30, 2003 12:14 pm Post subject: Re: Serial IC |
|
|
[quote]Exactly which spec are you referring to? The RS-232 specs I know do
not even hint at the format of the tranferred data.
CCITT V5.
[/quote]
Can you check that again? I have a recent ITU-T/CCITT CDROM and V5
isn>t even mentioned as an obsolete standard.
Wouter van Ooijen
-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting |
|
| |
|
Back to top |
|