CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RS232, ICD, fuses

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

RS232, ICD, fuses
PostPosted: Mon Aug 09, 2004 1:25 pm     Reply with quote

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
PostPosted: Mon Aug 09, 2004 2:50 pm     Reply with quote

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







PostPosted: Wed Aug 11, 2004 9:17 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Wed Aug 11, 2004 9:21 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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