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 support@ccsinfo.com

Soft-RS232 kills SPI

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



Joined: 12 Jan 2006
Posts: 6

View user's profile Send private message

Soft-RS232 kills SPI
PostPosted: Tue Feb 07, 2006 7:49 am     Reply with quote

My application runs on a 16F76. It uses The UART as well as SPI - both are on port C. In order to debug my program I added:

#use rs232(baud=19200,parity=N,xmit=PIN_C0,rcv=PIN_C1,bits=8,DISABLE_INTS,stream=dbgs)

also on port C. While the soft-RS232 works fine - e. g. with the statement

fprintf(dbgs,"\r\naci:%2u",aci);

it has the ugly side effect, that the SPI no longer works. There are just no more clock pulses when calling the built in function spi_write or spi_read.

Who knows a remedy against this? Thanks for help.
Robert
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 07, 2006 12:14 pm     Reply with quote

This might be a TRIS problem.

1. Post a small, simple program that demonstrates the problem.
Just a few lines of code. Make sure to post all of your #use,
#fuses, #include and #device statements.

2. Post your compiler version. It's given at the top of the .LST
file, which is in your project folder. It will be a number such
as 3.191 or 3.242, etc.
Roebi



Joined: 12 Jan 2006
Posts: 6

View user's profile Send private message

More on RS232 problem: Work-around
PostPosted: Thu Feb 09, 2006 4:39 am     Reply with quote

It is indeed a TRISC-problem Idea . Following any call to

fprintf(dbgs,....etc

the TRISC-bits 3..5 are all ones. No supprise SPI does not work anymore. The work-around is to set TRISC prior to any use of spi_read or spi_write. But - hellas - why does the soft-RS232-code mess around with bits of TRISC that are absolutely not its business? Question

I am using PCW V3.242
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu Feb 09, 2006 8:17 am     Reply with quote

As was told you before: post a small compilable program that demonstrates your problem. We know it will take you some effort to produce such a program, but you want our help, so don't put the effort on us.
The easier you make it for us to investigate your problem, the quicker and better responses you'll get.
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