|
|
View previous topic :: View next topic |
Author |
Message |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
RS232, ICD, fuses |
Posted: Mon Aug 09, 2004 1:25 pm |
|
|
Colleagues,
I'm using ICD-U40 to program the PIC. The problem is that I don't get the RS232 output unless the ICD is attached to the PIC.
Here are my declarations:
Code: |
#include <18F452.h>
// #device ICD=TRUE
#device adc=10
#use delay(clock=12800000)
#fuses NOWDT,WDT128,HS, NOPROTECT, NOOSCSEN, BROWNOUT, BORV20, NOPUT, STVREN, NODEBUG, LVP, NOWRT, NOWRTD, NOWRTB, NOWRTC, NOCPD, NOCPB, NOEBTR, NOEBTRB
#use rs232(baud=19200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=9)
#use i2c(Master,Fast,sda=PIN_C4,scl=PIN_C3)
|
What do you think is wrong?
Thanks,
Nick[/code] |
|
|
Ttelmah Guest
|
Re: RS232, ICD, fuses |
Posted: Mon Aug 09, 2004 2:50 pm |
|
|
kender wrote: | Colleagues,
I'm using ICD-U40 to program the PIC. The problem is that I don't get the RS232 output unless the ICD is attached to the PIC.
Here are my declarations:
Code: |
#include <18F452.h>
// #device ICD=TRUE
#device adc=10
#use delay(clock=12800000)
#fuses NOWDT,WDT128,HS, NOPROTECT, NOOSCSEN, BROWNOUT, BORV20, NOPUT, STVREN, NODEBUG, LVP, NOWRT, NOWRTD, NOWRTB, NOWRTC, NOCPD, NOCPB, NOEBTR, NOEBTRB
#use rs232(baud=19200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=9)
#use i2c(Master,Fast,sda=PIN_C4,scl=PIN_C3)
|
What do you think is wrong?
Thanks,
Nick[/code] |
Given you are enabling LVP, what are you connecting to the control line, to ensure it floats to a disabled state?. RB5, must be pulled down (If you enable internal pullups, you have to clear bit 5 of the TRIS register, to turn off the pullup on this pin), or the chip won't run.
Best Wishes |
|
|
DisgruntledPostalWorker Guest
|
|
Posted: Wed Aug 11, 2004 9:17 am |
|
|
I had a similar problem with the debug environment. If I was debugging, all was well. If I was running in standalone mode, I couldn't get anything in the UART. After 12 hours of experimenting, I found that the #USE RS232 calls create an interrupt each time they're used. In the debug environment, the interrupts aren't seen, so it works. In standalone mode, the #USE interrupt blocked my UART interrupt and I never received anything. The fix: stop using #USE each time I switched ports. Put all your #USE statements at the top of the file ONCE only, and identify them as streams. Then, use fprintf to print to streams, without using the #USE statments in running code. It was the only workaround I could find.
Any others with this problem? |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Wed Aug 11, 2004 9:21 am |
|
|
The solution was in hardware in my case. RS232 had poor ground connection, so when I was attaching the ICD, it was creating an additional ground connection.
Nick |
|
|
|
|
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
|