A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
|
I'm trying to establish simple I/O. Here's what I have. PortC connected to my serial port on my computer. Here is my code: #include <18F458.h> #fuses HS,NOWDT,NOPROTECT,NOLVP #use delay(clock=8000000) #use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7) void main() { do { output_high(PIN_B0); delay_ms(1000); printf("Hey now!"); delay_ms(1000); output_low(PIN_B0); } while (TRUE); } I have an LED connected to B0 and of course, the serial connections for C6 and C7 and my connection to GND. Any advice would be greatly appreciated. Shamoon |
|
|
|
You don't mention if you are using a Max232 chip. You'll need one if you are talking to the PC directly. Also, for others he's using the CCS-C compiler. I recognize the '#use' stuff. And, are you sure you should be using the 'HS' clock option? Perhaps the XT one would be better. --- In , honamos@y... wrote: > I'm trying to establish simple I/O. Here's what I have. PortC > connected to my serial port on my computer. Here is my code: > > #include <18F458.h> > #fuses HS,NOWDT,NOPROTECT,NOLVP > #use delay(clock=8000000) > #use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7) > > void main() { > do { > output_high(PIN_B0); > delay_ms(1000); > printf("Hey now!"); > delay_ms(1000); > output_low(PIN_B0); > } while (TRUE); > } > > I have an LED connected to B0 and of course, the serial connections > for C6 and C7 and my connection to GND. > > Any advice would be greatly appreciated. > > Shamoon |
|
|
|
Why would I need a Max232 chip? Don't the PC and the PIC both use TTL? Shamoon --- In , "Allan Lane" <allan.lane@h...> wrote: > You don't mention if you are using a > Max232 chip. You'll need one if you are > talking to the PC directly. > > Also, for others he's using the CCS-C compiler. > I recognize the '#use' stuff. > > And, are you sure you should be using the 'HS' > clock option? Perhaps the XT one would be better. > --- In , honamos@y... wrote: > > I'm trying to establish simple I/O. Here's what I have. PortC > > connected to my serial port on my computer. Here is my code: > > > > #include <18F458.h> > > #fuses HS,NOWDT,NOPROTECT,NOLVP > > #use delay(clock=8000000) > > #use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7) > > > > void main() { > > do { > > output_high(PIN_B0); > > delay_ms(1000); > > printf("Hey now!"); > > delay_ms(1000); > > output_low(PIN_B0); > > } while (TRUE); > > } > > > > I have an LED connected to B0 and of course, the serial connections > > for C6 and C7 and my connection to GND. > > > > Any advice would be greatly appreciated. > > > > Shamoon |
|
|
|
----- Original Message ----- From: <> To: <> Sent: Tuesday, June 22, 2004 7:43 PM Subject: [piclist] Re: Next 18F458 Question > Why would I need a Max232 chip? Don't the PC and the PIC both use > TTL? The PC serial port uses RS-232. Leon |
|
If you want to properly communicate with all RS232 type ports, you must use a MAX232 in order to keep levels correct. Well worth the investment and protection. Rick wrote: > Why would I need a Max232 chip? Don't the PC and the PIC both use > TTL? > > Shamoon > --- In , "Allan Lane" <allan.lane@h...> wrote: > > You don't mention if you are using a > > Max232 chip. You'll need one if you are > > talking to the PC directly. > > > > Also, for others he's using the CCS-C compiler. > > I recognize the '#use' stuff. > > > > And, are you sure you should be using the 'HS' > > clock option? Perhaps the XT one would be better. > > > |
|
|
|
No, the PC uses +/- 10V or so, and in addition the signals are inverted.
Use a MAX 202 or something similar. h...@yahoo.com wrote: Why would I need a Max232 chip? Don't the PC and the PIC both use-- ******************************************* VISIT MY HOME PAGE: <http://home.online.no/~eikarlse/index.htm> LAST UPDATED: 23/08/2003 ******************************************* Best Regards Eirik Karlsen |
|
In addition to the interface misunderstandings already discussed on this thread, I'd like to point out that the LOW transition of PIN_B0 would be only momentary in the code shown. It will be low only for the period of a jump instruction back to the top of the program loop. As it stands your LED will be either permanently lit or out depending on how it's wired. You need to swap the last delay and low instructions if you want the lamp to flash. At 04:08 AM 23/06/04, you wrote: >I'm trying to establish simple I/O. Here's what I have. PortC >connected to my serial port on my computer. Here is my code: > >#include <18F458.h> >#fuses HS,NOWDT,NOPROTECT,NOLVP >#use delay(clock=8000000) >#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7) > >void main() { > do { > output_high(PIN_B0); > delay_ms(1000); > printf("Hey now!"); > delay_ms(1000); > output_low(PIN_B0); > } while (TRUE); >} > >I have an LED connected to B0 and of course, the serial connections >for C6 and C7 and my connection to GND. > >Any advice would be greatly appreciated. > >Shamoon > > >to unsubscribe, go to http://www.yahoogroups.com and follow the instructions >Yahoo! Groups Links |
|
|
|
On Tue, 22 Jun 2004 wrote: > Why would I need a Max232 chip? Don't the PC and the PIC both use > TTL? sometimes, see here why: http://www.surducan.netfirms.com/RS232.html Who is teaching you electronics ? Vasile http://surducan.netfirms.com |
|
|
|
Hey, Thanks for the info. I have a Max232, but I can't seem to get it to serial out. My connections are as follows: PC Serial Port: Pin 2 - T1Out (Max232) Pin 3 - R1In (Max232) Pin 5 - Gnd PIC: Pin 25 (C6/TX) - T1In (Max232) Pin 26 (C7/RX) - R1Out (Max 232) I have connected the DB9 to the serial port of my PC and attempted to ues Hyperterminal to view the text, but alas... nothing. Any help would be greatly appreciated. Thanks. Shamoon My C code is as follows: #include <18F458.h> #fuses HS,NOWDT,NOPROTECT,NOLVP #use delay(clock=8000000) #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) void main() { set_tris_b(0x00); while(true) { delay_ms(500); output_high(PIN_B0); printf("Hey now!"); delay_ms(500); output_low(PIN_B0); } } --- In , Vasile Surducan <vasile@s...> wrote: > > > On Tue, 22 Jun 2004 honamos@y... wrote: > > > Why would I need a Max232 chip? Don't the PC and the PIC both use > > TTL? > > sometimes, see here why: > > http://www.surducan.netfirms.com/RS232.html > > Who is teaching you electronics ? > > Vasile > http://surducan.netfirms.com |
|
|
|
I didn't look at the code but you can view a schematic with the proper wiring at www.junun.org. Look under Mark III - Datasheets - Schematic (near the top center of the page). Follow the circuits for Tx, Rx (from PIC to DS232), 232Tx & 232Rx (from DS232 to DB-9 connector). With this arrangement you use a straight through cable - female to the computer, male to the DB-9 which is female. The DS-232 is identical to the MAX-232 in terms of pin-out. --- In , honamos@y... wrote: > Hey, > Thanks for the info. I have a Max232, but I can't seem to get it to > serial out. My connections are as follows: > > PC Serial Port: > Pin 2 - T1Out (Max232) > Pin 3 - R1In (Max232) > Pin 5 - Gnd > > PIC: > Pin 25 (C6/TX) - T1In (Max232) > Pin 26 (C7/RX) - R1Out (Max 232) > > I have connected the DB9 to the serial port of my PC and attempted > to ues Hyperterminal to view the text, but alas... nothing. Any > help would be greatly appreciated. Thanks. > > Shamoon > My C code is as follows: > > #include <18F458.h> > #fuses HS,NOWDT,NOPROTECT,NOLVP > #use delay(clock=8000000) > #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) > void main() > { > set_tris_b(0x00); > while(true) > { > delay_ms(500); > output_high(PIN_B0); > printf("Hey now!"); > delay_ms(500); > output_low(PIN_B0); > } > } > > --- In , Vasile Surducan <vasile@s...> wrote: > > > > > > > > > > On Tue, 22 Jun 2004 honamos@y... wrote: > > > > > Why would I need a Max232 chip? Don't the PC and the PIC both > use > > > TTL? > > > > sometimes, see here why: > > > > http://www.surducan.netfirms.com/RS232.html > > > > Who is teaching you electronics ? > > > > Vasile > > http://surducan.netfirms.com |
|
|
|
You don't say, but I assume you are using Pin 25 of the PIC to talk to DB9-Pin 3 of the PC? And using Pin 26 of the PIC to listen to DB-9 pin 2 of the PC? And, that you have DB-9 Pin 5 tied to PIC ground, as well? (People seem to miss this one, for some reason. You've GOT to have a common ground for RS-232 signals) The last thing that could be wrong is the 'invert' setting -- though with a Max232, I didn't think you would need it. --- In , honamos@y... wrote: > Hey, > Thanks for the info. I have a Max232, but I can't seem to get it to > serial out. My connections are as follows: > > PC Serial Port: > Pin 2 - T1Out (Max232) > Pin 3 - R1In (Max232) > Pin 5 - Gnd > > PIC: > Pin 25 (C6/TX) - T1In (Max232) > Pin 26 (C7/RX) - R1Out (Max 232) > > I have connected the DB9 to the serial port of my PC and attempted > to ues Hyperterminal to view the text, but alas... nothing. Any > help would be greatly appreciated. Thanks. > > Shamoon > My C code is as follows: > > #include <18F458.h> > #fuses HS,NOWDT,NOPROTECT,NOLVP > #use delay(clock=8000000) > #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) > void main() > { > set_tris_b(0x00); > while(true) > { > delay_ms(500); > output_high(PIN_B0); > printf("Hey now!"); > delay_ms(500); > output_low(PIN_B0); > } > } > > --- In , Vasile Surducan <vasile@s...> wrote: > > > > > > > > > > On Tue, 22 Jun 2004 honamos@y... wrote: > > > > > Why would I need a Max232 chip? Don't the PC and the PIC both > use > > > TTL? > > > > sometimes, see here why: > > > > http://www.surducan.netfirms.com/RS232.html > > > > Who is teaching you electronics ? > > > > Vasile > > http://surducan.netfirms.com |
|
|
|
I didn't see you meantion the 4 caps that need to be connected. Some of the Max232 chips need 4 .1uF caps while other require 4 1uF and other have them built internal to the Max chip. Ray Doerr --- In , honamos@y... wrote: > Hey, > Thanks for the info. I have a Max232, but I can't seem to get it to > serial out. My connections are as follows: > > PC Serial Port: > Pin 2 - T1Out (Max232) > Pin 3 - R1In (Max232) > Pin 5 - Gnd > > PIC: > Pin 25 (C6/TX) - T1In (Max232) > Pin 26 (C7/RX) - R1Out (Max 232) > > I have connected the DB9 to the serial port of my PC and attempted > to ues Hyperterminal to view the text, but alas... nothing. Any > help would be greatly appreciated. Thanks. > > Shamoon > My C code is as follows: > > #include <18F458.h> > #fuses HS,NOWDT,NOPROTECT,NOLVP > #use delay(clock=8000000) > #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) > void main() > { > set_tris_b(0x00); > while(true) > { > delay_ms(500); > output_high(PIN_B0); > printf("Hey now!"); > delay_ms(500); > output_low(PIN_B0); > } > } > > --- In , Vasile Surducan <vasile@s...> wrote: > > > > > > > > > > On Tue, 22 Jun 2004 honamos@y... wrote: > > > > > Why would I need a Max232 chip? Don't the PC and the PIC both > use > > > TTL? > > > > sometimes, see here why: > > > > http://www.surducan.netfirms.com/RS232.html > > > > Who is teaching you electronics ? > > > > Vasile > > http://surducan.netfirms.com |
|
|
|
I have the ground connected and everything else connected well, I think. Is there anything else that could be wrong? I need only one power supply, correct? Shamoon --- In , "Allan Lane" <allan.lane@h...> wrote: > You don't say, but I assume you are using > Pin 25 of the PIC to talk to DB9-Pin 3 of the PC? > > And using Pin 26 of the PIC to listen to > DB-9 pin 2 of the PC? > > And, that you have DB-9 Pin 5 tied to PIC ground, > as well? (People seem to miss this one, for some > reason. You've GOT to have a common ground for > RS-232 signals) > > The last thing that could be wrong is the 'invert' > setting -- though with a Max232, I didn't think you > would need it. > > --- In , honamos@y... wrote: > > Hey, > > Thanks for the info. I have a Max232, but I can't seem to get it > to > > serial out. My connections are as follows: > > > > PC Serial Port: > > Pin 2 - T1Out (Max232) > > Pin 3 - R1In (Max232) > > Pin 5 - Gnd > > > > PIC: > > Pin 25 (C6/TX) - T1In (Max232) > > Pin 26 (C7/RX) - R1Out (Max 232) > > > > I have connected the DB9 to the serial port of my PC and attempted > > to ues Hyperterminal to view the text, but alas... nothing. Any > > help would be greatly appreciated. Thanks. > > > > Shamoon > > > > > > My C code is as follows: > > > > #include <18F458.h> > > #fuses HS,NOWDT,NOPROTECT,NOLVP > > #use delay(clock=8000000) > > #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) > > > > > > void main() > > { > > set_tris_b(0x00); > > while(true) > > { > > delay_ms(500); > > output_high(PIN_B0); > > printf("Hey now!"); > > delay_ms(500); > > output_low(PIN_B0); > > } > > } > > > > > > > > --- In , Vasile Surducan <vasile@s...> wrote: > > > > > > > > > > > > > > > On Tue, 22 Jun 2004 honamos@y... wrote: > > > > > > > Why would I need a Max232 chip? Don't the PC and the PIC both > > use > > > > TTL? > > > > > > sometimes, see here why: > > > > > > http://www.surducan.netfirms.com/RS232.html > > > > > > Who is teaching you electronics ? > > > > > > Vasile > > > http://surducan.netfirms.com |
|
|
|
Of course you have connected the charge pump capacitors to the Max chip, haven't you? At 06:55 AM 24/06/04, you wrote: >I have the ground connected and everything else connected well, I >think. Is there anything else that could be wrong? I need only one >power supply, correct? > >Shamoon >--- In , "Allan Lane" <allan.lane@h...> wrote: >> You don't say, but I assume you are using >> Pin 25 of the PIC to talk to DB9-Pin 3 of the PC? >> >> And using Pin 26 of the PIC to listen to >> DB-9 pin 2 of the PC? >> >> And, that you have DB-9 Pin 5 tied to PIC ground, >> as well? (People seem to miss this one, for some >> reason. You've GOT to have a common ground for >> RS-232 signals) >> >> The last thing that could be wrong is the 'invert' >> setting -- though with a Max232, I didn't think you >> would need it. >> >> --- In , honamos@y... wrote: >> > Hey, >> > Thanks for the info. I have a Max232, but I can't seem to get >it >> to >> > serial out. My connections are as follows: >> > >> > PC Serial Port: >> > Pin 2 - T1Out (Max232) >> > Pin 3 - R1In (Max232) >> > Pin 5 - Gnd >> > >> > PIC: >> > Pin 25 (C6/TX) - T1In (Max232) >> > Pin 26 (C7/RX) - R1Out (Max 232) >> > >> > I have connected the DB9 to the serial port of my PC and >attempted >> > to ues Hyperterminal to view the text, but alas... nothing. Any >> > help would be greatly appreciated. Thanks. >> > >> > Shamoon >> > >> > >> > My C code is as follows: >> > >> > #include <18F458.h> >> > #fuses HS,NOWDT,NOPROTECT,NOLVP >> > #use delay(clock=8000000) >> > #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) >> > >> > >> > void main() >> > { >> > set_tris_b(0x00); >> > while(true) >> > { >> > delay_ms(500); >> > output_high(PIN_B0); >> > printf("Hey now!"); >> > delay_ms(500); >> > output_low(PIN_B0); >> > } >> > } >> > >> > >> > >> > --- In , Vasile Surducan <vasile@s...> >wrote: >> > > >> > > >> > > >> > > >> > > On Tue, 22 Jun 2004 honamos@y... wrote: >> > > >> > > > Why would I need a Max232 chip? Don't the PC and the PIC >both >> > use >> > > > TTL? >> > > >> > > sometimes, see here why: >> > > >> > > http://www.surducan.netfirms.com/RS232.html >> > > >> > > Who is teaching you electronics ? >> > > >> > > Vasile >> > > http://surducan.netfirms.com > > >to unsubscribe, go to http://www.yahoogroups.com and follow the instructions >Yahoo! Groups Links |
|
|
|
Assuming you have it wired like the schematic I referenced earlier, we should probably look at Hyperterminal. Close the connection and go into File-Properties and click on the Configure button. Make certain that Flow Control is set to None and verify the 8 bits, no parity and the proper baud rate. You will also need to add a line delay of 100 mS if you plan to send files at some point. File-Properties-Settings tab-ASCII Setup button. --- In , Phil Seakins <pseakins@a...> wrote: > Of course you have connected the charge pump capacitors to the Max chip, > haven't you? > > At 06:55 AM 24/06/04, you wrote: > >I have the ground connected and everything else connected well, I > >think. Is there anything else that could be wrong? I need only one > >power supply, correct? > > > >Shamoon > >--- In , "Allan Lane" <allan.lane@h...> wrote: > >> You don't say, but I assume you are using > >> Pin 25 of the PIC to talk to DB9-Pin 3 of the PC? > >> > >> And using Pin 26 of the PIC to listen to > >> DB-9 pin 2 of the PC? > >> > >> And, that you have DB-9 Pin 5 tied to PIC ground, > >> as well? (People seem to miss this one, for some > >> reason. You've GOT to have a common ground for > >> RS-232 signals) > >> > >> The last thing that could be wrong is the 'invert' > >> setting -- though with a Max232, I didn't think you > >> would need it. > >> > >> --- In , honamos@y... wrote: > >> > Hey, > >> > Thanks for the info. I have a Max232, but I can't seem to get > >it > >> to > >> > serial out. My connections are as follows: > >> > > >> > PC Serial Port: > >> > Pin 2 - T1Out (Max232) > >> > Pin 3 - R1In (Max232) > >> > Pin 5 - Gnd > >> > > >> > PIC: > >> > Pin 25 (C6/TX) - T1In (Max232) > >> > Pin 26 (C7/RX) - R1Out (Max 232) > >> > > >> > I have connected the DB9 to the serial port of my PC and > >attempted > >> > to ues Hyperterminal to view the text, but alas... nothing. Any > >> > help would be greatly appreciated. Thanks. > >> > > >> > Shamoon > >> > > >> > > >> > My C code is as follows: > >> > > >> > #include <18F458.h> > >> > #fuses HS,NOWDT,NOPROTECT,NOLVP > >> > #use delay(clock=8000000) > >> > #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) > >> > > >> > > >> > void main() > >> > { > >> > set_tris_b(0x00); > >> > while(true) > >> > { > >> > delay_ms(500); > >> > output_high(PIN_B0); > >> > printf("Hey now!"); > >> > delay_ms(500); > >> > output_low(PIN_B0); > >> > } > >> > } > >> > > >> > > >> > > >> > --- In , Vasile Surducan <vasile@s...> > >wrote: > >> > > > >> > > > >> > > > >> > > > >> > > On Tue, 22 Jun 2004 honamos@y... wrote: > >> > > > >> > > > Why would I need a Max232 chip? Don't the PC and the PIC > >both > >> > use > >> > > > TTL? > >> > > > >> > > sometimes, see here why: > >> > > > >> > > http://www.surducan.netfirms.com/RS232.html > >> > > > >> > > Who is teaching you electronics ? > >> > > > >> > > Vasile > >> > > http://surducan.netfirms.com > > > > > > > > > >to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > >Yahoo! Groups Links > > > > > > > |
|
Maybe is time to explain also to this guy what is a RS232 straight through cable ( and how it differs from a null modem cable or a standard modem cable and so on...) and how can be identified with a DVM. Then how to set the same parameters for the communications at the PIC end and at the PC end. Then how to set the flow control of the PC terminal accordingly with the cable connection. Finally which is the maximum cable lenght at the specified baud rate. And we'll have to answer till the summer end. :) top 10 wishes, Vasile http://surducan.netfirms.com On Wed, 23 Jun 2004, rtstofer wrote: > I didn't look at the code but you can view a schematic with the > proper wiring at www.junun.org. Look under Mark III - Datasheets - > Schematic (near the top center of the page). Follow the circuits > for Tx, Rx (from PIC to DS232), 232Tx & 232Rx (from DS232 to DB-9 > connector). With this arrangement you use a straight through cable - > female to the computer, male to the DB-9 which is female. > > The DS-232 is identical to the MAX-232 in terms of pin-out. > > --- In , honamos@y... wrote: > > Hey, > > Thanks for the info. I have a Max232, but I can't seem to get it > to > > serial out. My connections are as follows: > > > > PC Serial Port: > > Pin 2 - T1Out (Max232) > > Pin 3 - R1In (Max232) > > Pin 5 - Gnd > > > > PIC: > > Pin 25 (C6/TX) - T1In (Max232) > > Pin 26 (C7/RX) - R1Out (Max 232) > > > > I have connected the DB9 to the serial port of my PC and attempted > > to ues Hyperterminal to view the text, but alas... nothing. Any > > help would be greatly appreciated. Thanks. > > > > Shamoon > > > > > > My C code is as follows: > > > > #include <18F458.h> > > #fuses HS,NOWDT,NOPROTECT,NOLVP > > #use delay(clock=8000000) > > #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) > > > > > > void main() > > { > > set_tris_b(0x00); > > while(true) > > { > > delay_ms(500); > > output_high(PIN_B0); > > printf("Hey now!"); > > delay_ms(500); > > output_low(PIN_B0); > > } > > } > > > > > > > > --- In , Vasile Surducan <vasile@s...> > wrote: > > > > > > > > > > > > > > > On Tue, 22 Jun 2004 honamos@y... wrote: > > > > > > > Why would I need a Max232 chip? Don't the PC and the PIC both > > use > > > > TTL? > > > > > > sometimes, see here why: > > > > > > http://www.surducan.netfirms.com/RS232.html > > > > > > Who is teaching you electronics ? > > > > > > Vasile > > > http://surducan.netfirms.com > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > Yahoo! Groups Links |
|
|
|
Yes, I think it is that time. I'm trying hard to learn, but sometimes this stuff can be a bit confusing... especially when it just doesn't work and you're sure you have EVERYTHING right... and then it turns out to be some stupid little problem that someone on a newsgroup tells you and it solves all of your problems---- but yeah, I appreciate all of the help I've gotten so far. I really don't know what the problem could be. I have my capacitors (5 of 'em) and still... no dice. --- In , Vasile Surducan <vasile@s...> wrote: > > Maybe is time to explain also to this guy what is a RS232 straight > through cable ( and how it differs from a null modem cable or a standard > modem cable and so on...) and how can be identified with a DVM. > Then how to set the same parameters for the communications at the PIC end > and at the PC end. Then how to set the flow control of the PC terminal > accordingly with the cable connection. Finally which is the maximum cable > lenght at the specified baud rate. And we'll have to answer till the > summer end. > > :) > > top 10 wishes, > Vasile > http://surducan.netfirms.com > On Wed, 23 Jun 2004, rtstofer wrote: > > > > > I didn't look at the code but you can view a schematic with the > > proper wiring at www.junun.org. Look under Mark III - Datasheets - > > Schematic (near the top center of the page). Follow the circuits > > for Tx, Rx (from PIC to DS232), 232Tx & 232Rx (from DS232 to DB-9 > > connector). With this arrangement you use a straight through cable - > > female to the computer, male to the DB-9 which is female. > > > > The DS-232 is identical to the MAX-232 in terms of pin-out. > > > > --- In , honamos@y... wrote: > > > Hey, > > > Thanks for the info. I have a Max232, but I can't seem to get it > > to > > > serial out. My connections are as follows: > > > > > > PC Serial Port: > > > Pin 2 - T1Out (Max232) > > > Pin 3 - R1In (Max232) > > > Pin 5 - Gnd > > > > > > PIC: > > > Pin 25 (C6/TX) - T1In (Max232) > > > Pin 26 (C7/RX) - R1Out (Max 232) > > > > > > I have connected the DB9 to the serial port of my PC and attempted > > > to ues Hyperterminal to view the text, but alas... nothing. Any > > > help would be greatly appreciated. Thanks. > > > > > > Shamoon > > > > > > > > > My C code is as follows: > > > > > > #include <18F458.h> > > > #fuses HS,NOWDT,NOPROTECT,NOLVP > > > #use delay(clock=8000000) > > > #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) > > > > > > > > > void main() > > > { > > > set_tris_b(0x00); > > > while(true) > > > { > > > delay_ms(500); > > > output_high(PIN_B0); > > > printf("Hey now!"); > > > delay_ms(500); > > > output_low(PIN_B0); > > > } > > > } > > > > > > > > > > > > --- In , Vasile Surducan <vasile@s...> > > wrote: > > > > > > > > > > > > > > > > > > > > On Tue, 22 Jun 2004 honamos@y... wrote: > > > > > > > > > Why would I need a Max232 chip? Don't the PC and the PIC both > > > use > > > > > TTL? > > > > > > > > sometimes, see here why: > > > > > > > > http://www.surducan.netfirms.com/RS232.html > > > > > > > > Who is teaching you electronics ? > > > > > > > > Vasile > > > > http://surducan.netfirms.com > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > > Yahoo! Groups Links > > > > > > > > > |
|
|
|
I'd set about tracking this down methodically, in this order. 0) verify that your PIC is actually working and executing code 1) check your cable. Try jumpering TX to RX (pins 2 and 3) and see if a terminal program echoes. If not, bad cable. If echo, goto 2 2) check your max232 subsystem, short the TX and RX lines from the PIC (disconnect if possible, from PIC) and try the terminal program. If no echo, max232 subsystem is wrong. If echo, then its your PIC (goto 4 and or programming of the UART. 3) if max232 system fails, verify the polarity of your caps and check the voltages at various points of max232. The data sheet tells you what to expect. 4) verify that the PIC's RX and TX lines are going to the right places on the max232 5) reread section of BRG and programming of UART. check you code again. the problem is, most assuredly, in there somewhere. --- In , honamos@y... wrote: > Yes, I think it is that time. I'm trying hard to learn, but > sometimes this stuff can be a bit confusing... especially when it > just doesn't work and you're sure you have EVERYTHING right... and > then it turns out to be some stupid little problem that someone on a > newsgroup tells you and it solves all of your problems---- but yeah, > I appreciate all of the help I've gotten so far. I really don't > know what the problem could be. I have my capacitors (5 of 'em) and > still... no dice. > --- In , Vasile Surducan <vasile@s...> wrote: > > > > > > > > Maybe is time to explain also to this guy what is a RS232 straight > > through cable ( and how it differs from a null modem cable or a > standard > > modem cable and so on...) and how can be identified with a DVM. > > Then how to set the same parameters for the communications at the > PIC end > > and at the PC end. Then how to set the flow control of the PC > terminal > > accordingly with the cable connection. Finally which is the > maximum cable > > lenght at the specified baud rate. And we'll have to answer till > the > > summer end. > > > > :) > > > > top 10 wishes, > > Vasile > > http://surducan.netfirms.com > > > > > > On Wed, 23 Jun 2004, rtstofer wrote: > > > > > > > > I didn't look at the code but you can view a schematic with the > > > proper wiring at www.junun.org. Look under Mark III - > Datasheets - > > > Schematic (near the top center of the page). Follow the circuits > > > for Tx, Rx (from PIC to DS232), 232Tx & 232Rx (from DS232 to DB- 9 > > > connector). With this arrangement you use a straight through > cable - > > > female to the computer, male to the DB-9 which is female. > > > > > > The DS-232 is identical to the MAX-232 in terms of pin-out. > > > > > > --- In , honamos@y... wrote: > > > > Hey, > > > > Thanks for the info. I have a Max232, but I can't seem to get > it > > > to > > > > serial out. My connections are as follows: > > > > > > > > PC Serial Port: > > > > Pin 2 - T1Out (Max232) > > > > Pin 3 - R1In (Max232) > > > > Pin 5 - Gnd > > > > > > > > PIC: > > > > Pin 25 (C6/TX) - T1In (Max232) > > > > Pin 26 (C7/RX) - R1Out (Max 232) > > > > > > > > I have connected the DB9 to the serial port of my PC and > attempted > > > > to ues Hyperterminal to view the text, but alas... nothing. > Any > > > > help would be greatly appreciated. Thanks. > > > > > > > > Shamoon > > > > > > > > > > > > My C code is as follows: > > > > > > > > #include <18F458.h> > > > > #fuses HS,NOWDT,NOPROTECT,NOLVP > > > > #use delay(clock=8000000) > > > > #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) > > > > > > > > > > > > void main() > > > > { > > > > set_tris_b(0x00); > > > > while(true) > > > > { > > > > delay_ms(500); > > > > output_high(PIN_B0); > > > > printf("Hey now!"); > > > > delay_ms(500); > > > > output_low(PIN_B0); > > > > } > > > > } > > > > > > > > > > > > > > > > --- In , Vasile Surducan <vasile@s...> > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > On Tue, 22 Jun 2004 honamos@y... wrote: > > > > > > > > > > > Why would I need a Max232 chip? Don't the PC and the PIC > both > > > > use > > > > > > TTL? > > > > > > > > > > sometimes, see here why: > > > > > > > > > > http://www.surducan.netfirms.com/RS232.html > > > > > > > > > > Who is teaching you electronics ? > > > > > > > > > > Vasile > > > > > http://surducan.netfirms.com > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > > Yahoo! Groups Links > > > > > > > > > > > > > > |
|
OK, let's move in small steps: 1. by checking the hardware very carefully a. post your complete schematic, so we could see it b. if too lazy for a. then check: - all connection including possible cold solder points - +5V supply, the presence of +10V and -10V on pins 2 and 6 (MAX232 or equivalent chip) - connection with PICmicro on right (USART) pins c. if everythink looks ok, go back to b. and do it again d. check the cable and the way you did the connection, TXPIC to RXPC and RXPIC to TXPC, GNDPIC to GNDPC, the other connections are not necessary if no hardware flow is set inside the terminal parameters 2. by checking the software and hardware related parameters e. take care, the communication with MAX232 is active low, if you are not using the USART, set the bitbanging output/input appropiate f. use a good external crystal for your PIC and check that indeed is oscillating on right frequency g. compute carefully the error if you are using USART, and choose the best SPBRG-BRGH combination (for the smallest error with your crystal value) g+. be sure your compiler is not hanging on bugs.... 3. by setting right the PC terminal configuration h. if you are on com-x, be sure you are there with the cable and the terminal was set on that com-x i. if your communication parameters on PIC are 8N1, be sure that are the same in terminal configuration windows j. be sure you are not sharing the com with other program that terminal, keep closed all your programs on PC except the terminal k. be sure your flow control is set to "none" 4. say a pray and go back to 1. 5. take a look here: http://www.geocities.com/vsurducan/electro/PIC/pic84lcd.htm and notice there I've used a MAX3232 and not a MAX232, but are almost identical except minor changes to charge pump capacitors connections. you can say I'm a nasty guy, didn't you ? :) success, Vasile On Thu, 24 Jun 2004 wrote: > Yes, I think it is that time. I'm trying hard to learn, but > sometimes this stuff can be a bit confusing... especially when it > just doesn't work and you're sure you have EVERYTHING right... and > then it turns out to be some stupid little problem that someone on a > newsgroup tells you and it solves all of your problems---- but yeah, > I appreciate all of the help I've gotten so far. I really don't > know what the problem could be. I have my capacitors (5 of 'em) and > still... no dice. > --- In , Vasile Surducan <vasile@s...> wrote: > > > > > > > > Maybe is time to explain also to this guy what is a RS232 straight > > through cable ( and how it differs from a null modem cable or a > standard > > modem cable and so on...) and how can be identified with a DVM. > > Then how to set the same parameters for the communications at the > PIC end > > and at the PC end. Then how to set the flow control of the PC > terminal > > accordingly with the cable connection. Finally which is the > maximum cable > > lenght at the specified baud rate. And we'll have to answer till > the > > summer end. > > > > :) > > > > top 10 wishes, > > Vasile > > http://surducan.netfirms.com > > > > > > On Wed, 23 Jun 2004, rtstofer wrote: > > > > > > > > I didn't look at the code but you can view a schematic with the > > > proper wiring at www.junun.org. Look under Mark III - > Datasheets - > > > Schematic (near the top center of the page). Follow the circuits > > > for Tx, Rx (from PIC to DS232), 232Tx & 232Rx (from DS232 to DB-9 > > > connector). With this arrangement you use a straight through > cable - > > > female to the computer, male to the DB-9 which is female. > > > > > > The DS-232 is identical to the MAX-232 in terms of pin-out. > > > > > > --- In , honamos@y... wrote: > > > > Hey, > > > > Thanks for the info. I have a Max232, but I can't seem to get > it > > > to > > > > serial out. My connections are as follows: > > > > > > > > PC Serial Port: > > > > Pin 2 - T1Out (Max232) > > > > Pin 3 - R1In (Max232) > > > > Pin 5 - Gnd > > > > > > > > PIC: > > > > Pin 25 (C6/TX) - T1In (Max232) > > > > Pin 26 (C7/RX) - R1Out (Max 232) > > > > > > > > I have connected the DB9 to the serial port of my PC and > attempted > > > > to ues Hyperterminal to view the text, but alas... nothing. > Any > > > > help would be greatly appreciated. Thanks. > > > > > > > > Shamoon > > > > > > > > > > > > My C code is as follows: > > > > > > > > #include <18F458.h> > > > > #fuses HS,NOWDT,NOPROTECT,NOLVP > > > > #use delay(clock=8000000) > > > > #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) > > > > > > > > > > > > void main() > > > > { > > > > set_tris_b(0x00); > > > > while(true) > > > > { > > > > delay_ms(500); > > > > output_high(PIN_B0); > > > > printf("Hey now!"); > > > > delay_ms(500); > > > > output_low(PIN_B0); > > > > } > > > > } > > > > > > > > > > > > > > > > --- In , Vasile Surducan <vasile@s...> > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > On Tue, 22 Jun 2004 honamos@y... wrote: > > > > > > > > > > > Why would I need a Max232 chip? Don't the PC and the PIC > both > > > > use > > > > > > TTL? > > > > > > > > > > sometimes, see here why: > > > > > > > > > > http://www.surducan.netfirms.com/RS232.html > > > > > > > > > > Who is teaching you electronics ? > > > > > > > > > > Vasile > > > > > http://surducan.netfirms.com > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > Yahoo! Groups Links |
|
Hi all, I have used 1206 and 0805 format SMD ceramic capacitors with my MAX232As, values in the 50nF region, and it works good. The size of the circuit can be considerably reduced. Regards, Mike ----- Original Message ----- From: "Phil" <> To: <> Sent: Monday, June 28, 2004 7:17 AM Subject: [piclist] Re: Next 18F458 Question > for the max232, use 1 uF. for the max232A, use 0.1 uF. However, I've > used 1 uF with the max232A successfully. > > look at the datasheets of the non-maxim parts. > > --- In , "rdoerr01" <rdoerr01@y...> wrote: > > I didn't see you meantion the 4 caps that need to be connected. > Some > > of the Max232 chips need 4 .1uF caps while other require 4 1uF and > > other have them built internal to the Max chip. > > > > > > > > Ray Doerr > > > > > > --- In , honamos@y... wrote: > > > Hey, > > > Thanks for the info. I have a Max232, but I can't seem to get it > > to > > > serial out. My connections are as follows: > > > > > > PC Serial Port: > > > Pin 2 - T1Out (Max232) > > > Pin 3 - R1In (Max232) > > > Pin 5 - Gnd > > > > > > PIC: > > > Pin 25 (C6/TX) - T1In (Max232) > > > Pin 26 (C7/RX) - R1Out (Max 232) > > > > > > I have connected the DB9 to the serial port of my PC and > attempted > > > to ues Hyperterminal to view the text, but alas... nothing. Any > > > help would be greatly appreciated. Thanks. > > > > > > Shamoon > > > > > > > > > My C code is as follows: > > > > > > #include <18F458.h> > > > #fuses HS,NOWDT,NOPROTECT,NOLVP > > > #use delay(clock=8000000) > > > #use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7) > > > > > > > > > void main() > > > { > > > set_tris_b(0x00); > > > while(true) > > > { > > > delay_ms(500); > > > output_high(PIN_B0); > > > printf("Hey now!"); > > > delay_ms(500); > > > output_low(PIN_B0); > > > } > > > } > > > > > > > > > > > > --- In , Vasile Surducan <vasile@s...> > wrote: > > > > > > > > > > > > > > > > > > > > On Tue, 22 Jun 2004 honamos@y... wrote: > > > > > > > > > Why would I need a Max232 chip? Don't the PC and the PIC > both > > > use > > > > > TTL? > > > > > > > > sometimes, see here why: > > > > > > > > http://www.surducan.netfirms.com/RS232.html > > > > > > > > Who is teaching you electronics ? > > > > > > > > Vasile > > > > http://surducan.netfirms.com > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > Yahoo! Groups Links |
|
|