View previous topic :: View next topic |
Author |
Message |
pingice
Joined: 04 May 2013 Posts: 4
|
PGC and PGD as UART PROBLEM |
Posted: Fri May 17, 2013 8:59 pm |
|
|
hi,
i misused the pins of PGC and PGD instead of usual tx rx pins for uart of my circuit to transmit the sms through gsm. It is found that the msg not constantly can be sent.. meaning that the msg can be send bt sometime not, it's very unstable. can actually other pins act exactly same as the hardware uart pins? because i just discovered this mistaken and i am lack of time of changing it.. thx.. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19549
|
|
Posted: Fri May 17, 2013 11:59 pm |
|
|
A transmitting software UART, will give erratic timings, if any interrupts occur during the transmission. If you use the option 'DISABLE_INTS' in #use rs232, interrupts will be turned off for each byte, to prevent problems from this, but with it comes the 'cost' that servicing of other interrupts will be delayed by up to one character time.
Best Wishes |
|
|
pingice
Joined: 04 May 2013 Posts: 4
|
|
Posted: Sat May 18, 2013 8:14 am |
|
|
ok.. i will try to work on it.. thx so much.. another question is, why when i use 18f44k22 with 20MHz oscillator, the speed of the pic is extremely slow.. I eliminate this problem by changing the coding part to Code: | #Use delay (clock = 1000000) |
but i am not sure whether this will cause any problem to the PIC |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19549
|
|
Posted: Sat May 18, 2013 9:43 am |
|
|
The UART won't work, unless the clock rate declared in the clock statement matches what your chip is actually clocking at. I'd have a strong suspicion that your 20MHz oscillator is not setup right, and is not working. The chip 'falls back' to running the internal oscillator at 1MHz (unless you turn off the FSCM fuse). You have an oscillator problem. Either wrong fuse or wrong connection.....
Best Wishes |
|
|
|