Hi...
Im working on with my project and got stuck.i want my
output from pic16f84a to be feed to Computer using
rs232.I have already check the internet about that
and stiil confuse.Some of solution says
-1-that in order to interface pic16f84a with rs232
MUST have MAX 232
-2-there is no need of MAX232.
Problem -How can i interface pic16f84a with com via
rs232.
thanks
As in the article, I will be using a MAX232 IC to translate the 5v levels from
the PIC to the +v and -v signal levels (+-12v IIRC) actually required on the
wire. The MAX232 uses a charge pump to ramp up the voltage, so no additional
power supply is required.
> Hi...
> Im working on with my project and got stuck.i want my
> output from pic16f84a...
Is there any specific reason to use the old PICF84A ?
There is no hardware USART in that one, and you must
use software serial communications routines.
> to be feed to Computer using rs232.
You need a RS232 level shifter, such as the MAX232.
> I have already check the internet about that
> and stiil confuse.Some of solution says
> -1-that in order to interface pic16f84a with rs232
> MUST have MAX 232
Right, if you want a solution that always works.
> -2-there is no need of MAX232.
Wrong, but *might* work in *some* cases.
Not recomended anyway...
> Problem -How can i interface pic16f84a with com via
> rs232.
Using a MAX232.
But, but do your *have* to use the F84A ?
(You need the MAX232 anyway, of course...)
In my "first release" of datalogger (was 16F84a based) I don't used a RS232 level converter to send data to the PC and this "generally" worked (tested on my home and Office PC). However, as Jan Erik says, it *might* work but isn' t generally recomended as it is out of RS232 specs. On many PC this method may work if you have a short cable (ex. 1-2 feet max.).
If you want sure to work without problems use the MAX232 or, if you have difficult to find it, build an alternative RS232 level converter as this simple circuit:
> Hi...
> Im working on with my project and got stuck.i want my
> output from pic16f84a to be feed to Computer using
> rs232.I have already check the internet about that
> and stiil confuse.Some of solution says
> -1-that in order to interface pic16f84a with rs232
> MUST have MAX 232
> -2-there is no need of MAX232.
>
> Problem -How can i interface pic16f84a with com via
> rs232.
> thanks
>
> Find local movie times and trailers on Yahoo! Movies.
> http://au.movies.yahoo.com
> _______________________________________________
> http://www.piclist.com
> View/change your membership options at
> mailman.mit.edu/mailman/listinfo/piclist
>
____________________________________________________________
Libero ADSL: navighi gratis a 1.2 Mega, senza canone e costi di attivazione.
Abbonati subito su http://www.libero.it
While on the subject of RS232. I have a micro controller for my turbine engine. It has it's own interface (LCD) for programming, but can be connected to the pc via a rs232 adapter. The manual says to use a " standard RS232 adapter " so I made up 1 using a max232, (DB9 - RJ45). Ran the software supplied, but still no communication. Tried changing baud rates still nothing.
My question is just how "standard" is standard? by that I mean r there other pin configurations?
Dave Smith
Cape Town
South Africa
> While on the subject of RS232. I have a micro controller for
> my turbine engine. It has it's own interface (LCD) for
> programming, but can be connected to the pc via a rs232
> adapter. The manual says to use a " standard RS232 adapter"
Would "adapter" possible be just a cable ?
Maybe it should be read as "use a standard RS232 cable"...
> so I made up 1 using a max232, (DB9 - RJ45).
Where is the RJ-connector ?
> Ran the software supplied,...
Run where ? On a PC ? On the controller ?
> but still no communication. Tried changing baud
> rates still nothing.
>
> My question is just how "standard" is standard? by that I
> mean r there other pin configurations?
RS232 has a standard for DB9 and DB25 connectors (at least).
Not sure about RJ connectors. But *if* the RJ45 is in the
controller *and* it's "nonstandard", I'd definitly expect to find the
pinout of the RJ-conector in the controller docs !
Maybe the "RS232 adapter" is an option from the same supplier
for the controller ? And you are not expected to make your own ?
What does the supplier of the controller say about it ?
Have you tried Hyperterminal to establish any basic comms ?
> My question is just how "standard" is standard? by that I mean
> r there other pin configurations?
AFAIK most comms between a micro and PC would be Rx-Tx,
Tx-Rx. Although I'm interfacing with a GSM/GPRS modem that
requires wiring as a terminal, ie Tx-Tx, Rx-Rx
There are various configurations of CTS, RTS and other control
lines (none of which I'm using with the modem). You should look
these up to see if they are needed for your particular controller
----- Original Message ----- From: Jinx To: Microcontroller discussion list - Public. Sent: Friday, October 15, 2004 2:15 PM
Subject: Re: [pic]-Interface pic16f84a with rs232
Have you tried Hyperterminal to establish any basic comms ?
----- Original Message ----- From: Jinx To: Microcontroller discussion list - Public. Sent: Friday, October 15, 2004 2:53 PM
Subject: Re: [pic]-Interface pic16f84a with rs232
> How many wires are used ?
> 4wires
Including ground ? And to which pins do they go ?
If I remember corectly
gnd
power
TX
RX
will check when I get home as I'm still at work. I will let u know monday?
On Thu, 2004-10-14 at 23:12, Mr.Pink bedak wrote:
> Hi...
> Im working on with my project and got stuck.i want my
> output from pic16f84a to be feed to Computer using
> rs232.I have already check the internet about that
> and stiil confuse.Some of solution says
> -1-that in order to interface pic16f84a with rs232
> MUST have MAX 232
> -2-there is no need of MAX232.
While there are numerous ways of "cheaping out" when it comes to
interfacing to an RS-232 line I would definitely recommend forgoing them
and choosing the MAX232 route.
While the cheaper methods work on many serial ports, there are also many
cases where they won't work, and unless you're experienced with
debugging RS-232 problems it's best to go with a proper chip.
> Problem -How can i interface pic16f84a with com via
> rs232.
> thanks
You can have a look at my carmondi project, it's basically a PIC, and
LCD and an RS-232 connection:
Sorry for off subject. Jan-Erik what is the url for your
smd soldering tutorial?
-----------------------------------------------------------------------
-----------------------------------------------------------------
DXTron Technology Inc
PCB Assembly
PIC Chip Programming
----------------------------------------------------------------- redrock8KILLspamdxtron.com http://www.dxtron.com
-----------------------------------------------------------------
{Original Message removed}
On Fri, Oct 15, 2004 at 01:12:47PM +1000, Mr.Pink bedak wrote:
> Hi...
> Im working on with my project and got stuck.i want my
> output from pic16f84a to be feed to Computer using
> rs232.
Here's my obligatory 16F84 is obsolete comment...
The 16F84A is obsolete. Check the archives for arguments
for and against. I have a webpage that talks about why
you should move up to newer parts featuring the 16F88:
> I have already check the internet about that
> and stiil confuse.Some of solution says
> -1-that in order to interface pic16f84a with rs232
> MUST have MAX 232
That's not completely true.
> -2-there is no need of MAX232.
That's not completely true either.
>
> Problem -How can i interface pic16f84a with com via
> rs232.
By understanding that there are tradeoffs in the two
approaches. RS232 (actually EIA232) specifies electrical
characteristics for the interface. However most hardware
especially PC hardware is much more forgiving. The spec
says max of +/- 25V, min +/- 3 volts with the space
between -3V and 3V as undefined. However most PC serial
ports are quite happy receiving a 0V, 5V signal even
though it's out of spec.
But in the end you have other worries. So use the MAX232
which guarantees a +/- 10V signal which is RS-232 spec.
That way you're assured that it'll work in every situation.
However if you wish to be say.... frugal, there are other
out of spec interfaces that you can utilize. Two examples
off the top of my head are Dale Botkin's two transistor
interface here:
Note that on Wouter's page he points out that while the
MAX232 works reliably in almost all situations, that the
El-Cheapo often had problems. Which illutrates the point.
I strongly encourage you to use the MAX 232... or even simpler the MAX 233 less components required and you can also request free samples from the manufacturer. I have tested both parts in designs and they both have performed flawlessly for all of my projects.
I also suggest that you ditch the 16f84 for a Pic with a built in serial USART, it will make your life so much easier. You can even request free samples from Microchip too. I believe learning is not about using old technology and bit banging, it is about learning how to utilize the newest technology at you disposal, it's quicker, it's easier, and its a lot more forward compatible as your project evolves. Don't waste your time with old technology, move forward and use components that are not or will not be discontinued soon. In an R&D environment where I work, we are actively looking for the newest technology to push the envelope, using Obsolete components may leave you in a position where you will have to do a complete redesign then the obsolete parts are no longer available this is time consuming and not forward thinking. If you are anything like me, I'd rather do the right thing the first time, rather than have to redesigning a failed design later, I have better thing!
s to do, like search for newer technology for my next project, rather then do something over that should have been done right the first time. Always do you research before you start a project, it pays off in the long run, you become a leader in the newest technologies available, before you know it others will come to you for advice, and you become a successful circuit designer.
And last but not least, this Pic list is one of the most resourceful places to get quick suggestions, pro and cons, and good advice.
I also advise you to use a Pic with build in serial. And if you do
not want to change the Pic for now because you have code snippets for 16F84,
then I tell you you have nothing to worry about. The PIC16F628 is (you may
see it like) an improved version of the old 16F84. It has built in USART and
4 comparators, CCP, PWM a 16bit timer, and it can be really easy configured
to act like the good but old from now 16F84. If you cannot manage to
configure it a lot of people here (including me) can offer you the code.
And YES use MAX232. I never had a problem with it.
> I strongly encourage you to use the MAX 232... or even simpler the MAX 233
> less components required and you can also request free samples from the
> manufacturer. I have tested both parts in designs and they both have
> performed flawlessly for all of my projects.
Prices on the MAX233 are awful! $5 USD? OUCH!
But I could be convinced on the MAX 232. The TI version at digikey is 78 cents
each and 65 cents a pop for 25 of them. That's cheap enough to make it
usable.
>
> I also suggest that you ditch the 16f84 for a Pic with a built in serial
> USART, it will make your life so much easier.
Definitely agreement on that.
> You can even request free samples from Microchip too.
Great for small project quantities.
>I believe learning is not about using old technology and bit banging, it is
> about learning how to utilize the newest technology at you disposal, it's
> quicker, it's easier, and its a lot more forward compatible as your project
> evolves. Don't waste your time with old technology, move forward and use
> components that are not or will not be discontinued soon.
Some agreement and some disagreement here. I agree that new tech is usually
a good thing. However there's nothing wrong with old tech, except that it
generally makes life harder. I believe that you need to learn both. But the
order is important. For example right here in this thread. If you want to do
serial, you should learn how to use the USART first. Learn how to do it in
hardware. Why? Because the vast majority of the time you'll only need one
port and the hardware supports it. However bit banging can be useful when you
need a second slow port for example. So don't dismiss it. Just don't emphesize
it as the primary option.
> In an R&D environment where I work, we are actively
> looking for the newest technology to push the envelope, using Obsolete
> components may leave you in a position where you will have to do a complete
> redesign then the obsolete parts are no longer available this is time
> consuming and not forward thinking.
Disagree here especially where Microchip is concerned. You can still get those
parts in quantity that are more than 10 years old. They are not going anywhere.
But even MChip discourages their use via pricing. A 16F84A costs 3 times as
much as a 16F628A. And the latter part is jam packed with goodies. It's
even more obvious with the 16F88 which has everything known to PIC stuffed
in a 18 pin package (USART, comparators, A/D, multiple timers, sync serial,
PWM, nanowatt tech with precision internal osciallator) while the 16F84A has
basically nothing but a single timer and an interrupt. Yet the latter part
is nearly double the cost.
Discouragement at its very best.
> If you are anything like me, I'd rather do the right thing the first time,
rather than have to redesigning a failed design later, I have better thing!
> s to do, like search for newer technology for my next project, rather then
> do something over that should have been done right the first time. Always do
> you research before you start a project, it pays off in the long run, you
> become a leader in the newest technologies available, before you know it
> others will come to you for advice, and you become a successful circuit
> designer.
Well here's where things fall down. The reason that the 16F84 is still so
popular is precisely because of this research. You hit google and type
PIC project or PIC programmer, and you're still going to get 10000 hits
for 16F84 based projects without any reference to the newer stuff.
> And last but not least, this Pic list is one of the most resourceful places
> to get quick suggestions, pro and cons, and good advice.
On Fri, Oct 15, 2004 at 08:52:34PM +0300, Sascha wrote:
> I also advise you to use a Pic with build in serial. And if you do
> not want to change the Pic for now because you have code snippets for 16F84,
> then I tell you you have nothing to worry about. The PIC16F628 is (you may
> see it like) an improved version of the old 16F84. It has built in USART and
> 4 comparators, CCP, PWM a 16bit timer, and it can be really easy configured
> to act like the good but old from now 16F84. If you cannot manage to
> configure it a lot of people here (including me) can offer you the code.
The 16F88 is even better. More memory, more goodies, and self programmable.
> And YES use MAX232. I never had a problem with it.
I see now that they are less than a US dollar. That may make them worth
using.
> But I could be convinced on the MAX 232. The TI version at digikey is 78
cents
> each and 65 cents a pop for 25 of them. That's cheap enough to make it
> usable.
Keep in mind that the MAX232 needs a handful of caps which the 233 doesn't.
I doubt if U.S. proces could make up the difference, but if the OPs 150
units are hand assembled and his ca sources are a little pricey, the labor
and caps could make the 233 a better deal.
>I believe learning is not about using old technology and bit banging, it is
> about learning how to utilize the newest technology at you disposal, it's
> quicker, it's easier, and its a lot more forward compatible as your project
> evolves. Don't waste your time with old technology, move forward and use
> components that are not or will not be discontinued soon.
Some agreement and some disagreement here. I agree that new tech is usually
a good thing. However there's nothing wrong with old tech, except that it
generally makes life harder. I believe that you need to learn both. But the
order is important. For example right here in this thread. If you want to do
serial, you should learn how to use the USART first. Learn how to do it in
hardware. Why? Because the vast majority of the time you'll only need one
port and the hardware supports it.
However bit banging can be useful when you
need a second slow port for example. So don't dismiss it. Just don't emphesize
it as the primary option.
>I understand that some people like to do things the hard way, but don't dismiss
>the fact that Microchip now also offers Pic's with 2 Hardware USART's, thus
>speeding up you development time.
> >I believe learning is not about using old technology and bit banging, it is
> > about learning how to utilize the newest technology at you disposal, it's
> > quicker, it's easier, and its a lot more forward compatible as your project
> > evolves. Don't waste your time with old technology, move forward and use
> > components that are not or will not be discontinued soon.
>
> Some agreement and some disagreement here. I agree that new tech is usually
> a good thing. However there's nothing wrong with old tech, except that it
> generally makes life harder. I believe that you need to learn both. But the
> order is important. For example right here in this thread. If you want to do
> serial, you should learn how to use the USART first. Learn how to do it in
> hardware. Why? Because the vast majority of the time you'll only need one
> port and the hardware supports it.
>
> However bit banging can be useful when you
> need a second slow port for example. So don't dismiss it. Just don't emphesize
> it as the primary option.
>
> >I understand that some people like to do things the hard way, but don't dismiss
> >the fact that Microchip now also offers Pic's with 2 Hardware USART's, thus
> >speeding up you development time.
>
>
>
> _______________________________________________
> http://www.piclist.com
> View/change your membership options at
> mailman.mit.edu/mailman/listinfo/piclist
Jan-Erik Soderholm wrote:
> redtock8@dxtron wrote :
>>Sorry for off subject. Jan-Erik what is the url for your
>>smd soldering tutorial?
>
> The page is not mine, I found it in 30 sec using Google
> and I don't remember the URL.
> (And I'm not going to search for it again... :-) )
Of course not. It would be in your browser's history file <G>.
R
Aloha!!
Im using pic16f84a because I had found the coding
fo my project from microchip.com app notes.Before this
I didnt know that USART is important in interface with
com. I'll try to change to 16f628 and use
MAX232.Thanks again for your advice and recomendation.
I use this to configure the 16F628 to act like the 16F84:
CLRF PORTA
MOVLW b'00000111'
MOVWF CMCON ; turn off comparators
CLRF STATUS
BSF STATUS,RP0 ; select BANK1 for operation
CLRF TRISB ; config PORTB & PORTA pins
CLRF TRISA
; do OPTION_REG configuration here
; do INTCON configuration here
BCF STATUS,RP0 ; back to BANK0
MOVF CMCON,F
On Sat, Oct 16, 2004 at 05:31:59PM +1000, Mr.Pink bedak wrote:
> Aloha!!
> Im using pic16f84a because I had found the coding
> fo my project from microchip.com app notes.Before this
> I didnt know that USART is important in interface with
> com. I'll try to change to 16f628 and use
> MAX232.Thanks again for your advice and recomendation.
You're welcome. Also be sure to take a look at the 16F88
which has even more features you may want to use down the
road.
Finally be sure to get yourself a copy of the 16F Midrange
Reference manual. You can download it here:
hi..
Is there any configurtion that i need to
change so that 16f628 act like the 16F84?what abouT
USART?should i include some command in my programing?
--- Sascha <KILLspamsaschaKILLspamgo.ro> wrote: {Quote hidden}
>
> I use this to configure the 16F628 to act like the
> 16F84:
>
> CLRF PORTA
> MOVLW b'00000111'
> MOVWF CMCON ; turn off comparators
> CLRF STATUS
> BSF STATUS,RP0 ; select BANK1 for operation
> CLRF TRISB ; config PORTB & PORTA pins
> CLRF TRISA
> ; do OPTION_REG configuration here
> ; do INTCON configuration here
> BCF STATUS,RP0 ; back to BANK0
> MOVF CMCON,F
>
> Regards,
> Sascha
>
On Sun, Oct 17, 2004 at 11:25:34AM +1000, Mr.Pink bedak wrote:
> hi..
> Is there any configurtion that i need to
> change so that 16f628 act like the 16F84?
The changes listed below. Microchip consistently takes
any analog inputs and configures them as analog by default.
So when you want to emulate a 16F84A, which has no analog
inputs, you have to change them to digital. The CMCON
register, which controls the analog comparators on the 16F628
is what you need to set.
>what abouT
> USART?should i include some command in my programing?
The by far best description of the PIC USART is Fr. Tom
McGahee's PICUART tutorial. You can find it here:
> --- Sascha <RemoveMEsaschaTakeThisOuTgo.ro> wrote:
> >
> > I use this to configure the 16F628 to act like the
> > 16F84:
> >
> > CLRF PORTA
> > MOVLW b'00000111'
> > MOVWF CMCON ; turn off comparators
> > CLRF STATUS
> > BSF STATUS,RP0 ; select BANK1 for operation
> > CLRF TRISB ; config PORTB & PORTA pins
> > CLRF TRISA
> > ; do OPTION_REG configuration here
> > ; do INTCON configuration here
> > BCF STATUS,RP0 ; back to BANK0
> > MOVF CMCON,F
> >
> > Regards,
> > Sascha
> >
>
>
> Find local movie times and trailers on Yahoo! Movies.
> http://au.movies.yahoo.com
> _______________________________________________
> http://www.piclist.com
> View/change your membership options at
> mailman.mit.edu/mailman/listinfo/piclist
> Is there any configurtion that i need to
> change so that 16f628 act like the 16F84?
If you are asking this because you are very uncomfortable with the different
processor, stick with the F84. It is the simplest of the 16F PICs.
In the 628, some of the I/O pins power up as comparator pins. The code
Sasha sent switches these pins back to be I/Os, so you are covered for most,
simple, 16F84 programs.
However, there are a few bits in the 628 that are in different registers
than they are in the 84, and there are some registers in different banks.
If your programs rely on these (most don't) it could be very confusing until
you get better at the PIC.
None of these things are especially hard to deal with, but if you are
struggling with the 84, you might be well advised to put the more complex
chips off for now.
The 16F88 has even more features, and as a result, more differences. None
of these differences are really major. All the 16F parts share the same 35
instructions. But as each part adds features, it also adds registers to
deal with those features, and sometimes juggls a few things around to fit a
little better. So while many 16F84 programs will work on a 628 with the
changes Sasha mentioned, not all will. Some of the changes are pretty
subtle, and if the code you are working from is rough (and a lot of F84 code
is), it could be a real challenge to figure out what's going on.
I think it was Byron that suggested getting the mid-range manual. This is a
great resource, and it tells you how to use the USART.