|
|
View previous topic :: View next topic |
Author |
Message |
pk178
Joined: 10 Mar 2010 Posts: 10
|
Help me with RS232 circuit |
Posted: Thu May 06, 2010 4:30 am |
|
|
Hi everybody !
I have a pickit, and I've tested RS232 module on that, it's ok, but when I design my printed circuit, it doesn't work. I tried it 3 times
I use max232 (product of maxim) and PIC16F887. I designed circuit according to datasheet, this is my printed circuit :
I don't know where is error ! Please help me ! Thanks so much ! |
|
|
jbmiller
Joined: 07 Oct 2006 Posts: 73 Location: Greensville,Ontario
|
|
Posted: Thu May 06, 2010 5:09 am |
|
|
It would be easier if you sent the schematic instead of the PCB layout. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19555
|
|
Posted: Thu May 06, 2010 8:12 am |
|
|
Looking at the PCB though. What is the component left of the PIC, with just four pins?.
Assuming this part isn't doing anything silly, then it looks 'possible'. I'd say the most likely proiblems were:
1) If this is a homemade (not PTH) board, then are you sure the connections to the top tracking are made OK?.
2) Have you verified the PIC is actually running?. Try just toggling a pin in a loop. Does it toggle, and at the right frequency. If it doesn't toggle, are you sure the capacitors used on the crystal are 'right'. Classic mistake would be fitting something like 22nF, instead of 22pF for these, which will normally stop the oscillator running.
3) You have an ICSP header. Are you using LVP?. If not, have you disabled LVP in the fuses?. If not, then the PGM pin, _must_ have a resistor holding it low...
4) Whiskers.
etc. etc...
Best Wishes |
|
|
jbmiller
Joined: 07 Oct 2006 Posts: 73 Location: Greensville,Ontario
|
|
Posted: Thu May 06, 2010 8:34 am |
|
|
Looks like an onboard 'reset' switch (coneccted to mclr).
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19555
|
|
Posted: Thu May 06, 2010 9:40 am |
|
|
Yes, easily could be. In which case, add 'check that switch really _is_ going off when released' to likely failure modes....
Best Wishes |
|
|
pk178
Joined: 10 Mar 2010 Posts: 10
|
|
Posted: Thu May 06, 2010 8:34 pm |
|
|
Ttelmah wrote: | Looking at the PCB though. What is the component left of the PIC, with just four pins?.
Assuming this part isn't doing anything silly, then it looks 'possible'. I'd say the most likely proiblems were:
1) If this is a homemade (not PTH) board, then are you sure the connections to the top tracking are made OK?.
2) Have you verified the PIC is actually running?. Try just toggling a pin in a loop. Does it toggle, and at the right frequency. If it doesn't toggle, are you sure the capacitors used on the crystal are 'right'. Classic mistake would be fitting something like 22nF, instead of 22pF for these, which will normally stop the oscillator running.
3) You have an ICSP header. Are you using LVP?. If not, have you disabled LVP in the fuses?. If not, then the PGM pin, _must_ have a resistor holding it low...
4) Whiskers.
etc. etc...
Best Wishes |
Many thanks to Ttelmah !
1. The component at left of PIC is a button, it's used to reset PIC.
2. PIC is still ok, I tried some simple programs, and it's run ok.
3. With a same program, the circuit on my pickit operate good, but the circuit above doesn't operate, so my program is still ok.
4 The ICSP header, I don't use LVP, the PGM is actually can be remove.
The problem is not in my program, I only don't understand why I draw circuit according to datasheet, the circuit doesn't work !
Please help me with this problem, or anybody,who has a PCB, please share me. Thanks a lot! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19555
|
|
Posted: Fri May 07, 2010 2:49 am |
|
|
OK.
If a 'simple program' works, the first thing to do, is prove that your oscillator is actually running at the expected frequency. Do the classic "pin high for one second, low for one second" test, and with a scope, or just by eye, verify that the frequency really is 0.5Hz. If not, then the serial won't work...
As a 'comment', look to adding a small capacitor close to the PIC, across the supply. The only smoothing on the supply, is the single electrolytic capacitor above the MAX232. electrolytic capacitors perform badly at high frequencies, and you also want the impedance path to the capacitor from active components like the PIC, and MAX232, to be short. This is why if youo look at a piece of electronics like a PC, you will see several large electrolytics at the supply, but also small polyester, or ceramic capacitors close to almost every IC that is performing any form of switching operation.
Best Wishes |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|