Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 22nd December 2007, 07:40 PM   (permalink)
Default

k im a lil confused coz of what blueroom and nigel said. just to confirm.... if i was to feed the data DIRECTLY from d pic uart to the PC, in terms of inversion nothing needs to be done, but it just needs to be converted from ttl to rs232.... however, because we are feeding it into a max232 chip to convert ttl to rs232, this chip will invert the signal from the PIC uart, which means, as soon as the data leaves pic uart, we invert it before supplying it to max232 chip, so that when max232 chip inverts it, and data leaves this chip, it is now in the correct "inversion" or polarity state? is this right? coz blueroom said it differently to nigel so its confused me a bit. thanks
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Old 22nd December 2007, 07:56 PM   (permalink)
Default

RS232 has voltages PICs won't like, it can be as high as +12 or - 12V AND it's inverted.
Use any of the above circuits, they'll work.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Old 22nd December 2007, 08:28 PM   (permalink)
Default

Quote:
Originally Posted by cyprio7
k im a lil confused coz of what blueroom and nigel said. just to confirm.... if i was to feed the data DIRECTLY from d pic uart to the PC, in terms of inversion nothing needs to be done, but it just needs to be converted from ttl to rs232.... however, because we are feeding it into a max232 chip to convert ttl to rs232, this chip will invert the signal from the PIC uart, which means, as soon as the data leaves pic uart, we invert it before supplying it to max232 chip, so that when max232 chip inverts it, and data leaves this chip, it is now in the correct "inversion" or polarity state? is this right? coz blueroom said it differently to nigel so its confused me a bit. thanks
No, you can't connect the PIC UART directly to a PC, because it needs to be inverted, it's designed to feed via a MAX232 (the PC already has an inverting RS232 driver inside it). If you use a software UART, then you can connect it directly - with a simple series resistor from PC TX to PIC RX, and a direct wire from PIC TX to PC RX (plus ground of course).
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 9th January 2008, 03:03 AM   (permalink)
Default

hi there... thanks for all your replies. i have purchased the chips from maplin(rip off), and drawn a schematic iv attatched it.

because people said i have to invert signal and level shift it, i thought i had to use a seperate inverter ic to invert, THEN feed the signal to the max232 chip. iv included the inverter ic in my schematic but you can ignore that as now i know i can just feed the lines from the pic directly into the max232 as this does the inverting?

a question tho, my usb-serial dongle uses +/-6.25V on the serial end for rs232..the MAX232CPE chip that im using uses slightly higher than this voltage...about +/- 10 or 12V. is it ok to still use this max chip with this dongle? i dont want to supply 12V if it takes 6.25V only and blow up my laptop or something. it may accept it but i just wanted the opinion of you guys, better to be safe than sorry. (capacitors and power lines etc have been omitted from my schematic)

and thanks for the help, much appreciated.
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Old 9th January 2008, 03:08 AM   (permalink)
Default

here is my schematic
Attached Images
File Type: jpg ttl rs232 converter circuit diagram2.jpg (97.2 KB, 16 views)
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Old 9th January 2008, 03:37 AM   (permalink)
Default

Your DB9 connections are wrong. You need pin3 (you have pin 7) to RX (via max232), pin 2 to TX and pin 5 to ground. I'm assuming a 1 to 1 cable to a PC.

Mike.
Pommie is online now  
Old 9th January 2008, 03:43 AM   (permalink)
Default

The MAX232 does both the inversion and the voltage doubling.
You also need to add several more caps including the decoupling caps.
You should try Google as it's an easy find.
http://www.piclist.com/techref/micro...8/UARTtest.htm
Attached Images
File Type: gif 628uart.gif (950 Bytes, 29 views)
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com

Last edited by blueroomelectronics; 9th January 2008 at 03:47 AM.
blueroomelectronics is offline  
Old 9th January 2008, 10:22 AM   (permalink)
Default

Yes, you don't need an extra inverter, the MAX232 does it all - why don't you check my tutorials that show how to connect it all up properly?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 9th January 2008, 01:49 PM   (permalink)
Default

ok in some examples on the net, it shows capacitors with two straight parallel lines (circuit symbol), and some symbols with one straight line and one slightly curved line parrallel to each other, i take it the latter is polarised... this is the one iv seen in most examples so i take it i should use a polarised one which is called "electrolytic"? iv also noticed there are so many different shapes of capacitors does it matter which i use? i know i need a 1uF one, i just dont want to get the wrong one because there are so many types.

also please let me know if the max232 using slightly higher voltage than the +/- 6.25 V on my DB9 connection matters..will it still work without damaging my pc? thanks

and i will look at your tutorial nigel thanks, i was actually looking at it for manchester encoding/rf transmission but i got so confused because there is so much code but (no offence) not a lot of explanation to what is actually happening and how its working, so i was finding it hard to follow the code and know whats actually going on, but i will have a look again.

while im on the subject of RF though, i might as well ask you this. i purchased this tx/rx pair from maplin

http://www.maplin.co.uk/Module.aspx?...module&doy=9m1

it says they are "matched" or "paired", does this mean that this transmitter can only send to this reciever? i want to buy 2 pairs, so i end up with tx1.tx2,rx1,rx2. i want tx1 to be able to send to both rx's or an indivual specified one (i take it i use packet system for this like in your tutorial)..... but because it says these are "paired" it made me wonder wether i will be able to make them function in this way. i want either tx to be able to send to a specific, or all recievers.
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Old 9th January 2008, 03:29 PM   (permalink)
Default

Hmm, I can help you but first you must help me. Is your shift key broken? If not please start using it.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Old 9th January 2008, 03:43 PM   (permalink)
Default

Ok, i will start using it. Is this easier to read?
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Old 9th January 2008, 03:48 PM   (permalink)
Default

oh and nigel i read through your rs232 tutorial, thanks, it helped a lot, however about all that timing stuff... is that relavent if i am using the in-built pic's uart? i take it that timing & delays etc are used if you are doing the transmission manually in software?
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Old 9th January 2008, 03:50 PM   (permalink)
Default

Quote:
Originally Posted by cyprio7
oh and nigel i read through your rs232 tutorial, thanks, it helped a lot, however about all that timing stuff... is that relavent if i am using the in-built pic's uart? i take it that timing & delays etc are used if you are doing the transmission manually in software?
You are correct, if you use the USART, you don't need all that - check the last tutorial that one uses the USART.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 9th January 2008, 04:21 PM   (permalink)
Default

Quote:
Originally Posted by cyprio7
Ok, i will start using it. Is this easier to read?
It's a start, it's simply good practice to not use SMS style text on a forum. And will help you break a bad habit (wouldn't be acceptable at school, work etc...)

Avoid using RF till you get the hang of RS232, you'll only make the project harder to troubleshoot.

The PIClist project I posted earlier works as does Nigels example. Build them as is and try them out. Your PCs RS232 is pretty robust and can handle +/-15V on the I/O pins no problem. The MAX232 is limited to about 20ma and can do no damage to the port.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Old 14th January 2008, 09:45 PM   (permalink)
Default

Hi guys. Thanks so much for all your help. Good news and bad news. Good news is that I have now got the basic communication working (at 4am in the morning which resulted me dancing around the room and clicking my fingers like a loony) lol.

I have written a program which sends the word "hello" from the pic to hyperterminal when the PIC first starts up, then, waits for a user to make rb6 high, so that it can then transmit the word "santa" ONCE, then, continue to wait in the loop and test rb6 to go high so it can transmit the word santa again.

When I make a connection to hyperterminal and start up the PIC, the word "hello" is displayed on hyperterminal, but then, the word "santa" keeps being transmitted over and over again so it looks something like this

hello
santasantasantasantasantasantasantasantasantasanta santasantasantasantasantasantasantasantasantasanta santasanta............. and so on

I have checked my code but I cannot find the problem. I checked to make sure that rb6 wasnt continuously being held high but it isnt, i also tried using rb4 as the user input button but the same problem occurs.

I also get some strange messages when I compile the code, such as

"processor superseded by command line. Verify processor symbol"
"processor-header file mismatch. verify selected processor"


could you please have a quick look at my code incase i am missing something, I have attatched it as a text file.

Thanks again for your help
Attached Files
File Type: txt hypterm submit.txt (2.6 KB, 10 views)
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Quik PIC Programming kit Krumlink General Electronics Chat 5 28th January 2008 12:27 AM
Problems switchin relay with PIC Andy1845c General Electronics Chat 5 17th November 2007 07:14 PM
High ADC sampling rate PIC, 18F needed? bananasiong Micro Controllers 24 28th October 2007 01:13 PM
PIC16F88, PIC simulator lcd trouble superbrew Micro Controllers 11 17th October 2007 03:18 AM
Programming PIC to generate square wave elec123 Micro Controllers 11 13th October 2007 02:15 PM



All times are GMT. The time now is 02:09 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker