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

MULTI_MASTER declaration in #USE RS232

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



Joined: 26 Feb 2005
Posts: 64

View user's profile Send private message

MULTI_MASTER declaration in #USE RS232
PostPosted: Fri Jun 30, 2006 4:30 am     Reply with quote

In my code I use this declaration in PIC16F876:
#use rs232(baud=9600 ,xmit=PIN_C6,rcv=PIN_C7,enable=PIN_C5,parity=e)

if i try to use MULTI_MASTER optinn

#use rs232(baud=9600 ,xmit=PIN_C6,rcv=PIN_C7,enable=PIN_C5,parity=e,MULTI_MASTER)

i've problems and i cant compile my code, instead it works fine.
Problems seem to concern ROM . as compilers goes out of ROM.

how can i solve this problem?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jun 30, 2006 4:56 pm     Reply with quote

Quote:

If i try to use MULTI_MASTER option, i've problems and i cant compile my
code. Problems seem to concern ROM, as compiler goes out of ROM.
#use rs232(baud=9600 ,xmit=PIN_C6,rcv=PIN_C7,enable=PIN_C5,parity=e,MULTI_MASTER)

I don't get that error. I do get the following error message from
the compiler if I try to compile your #use rs232 line.
Quote:
Error: USE parameter value is out of range. H/W USART cannot multi-master


The CCS manual says you can't use the hardware UART (on pins C6 and
C7) for Multi-Master mode:
Quote:
MULTI_MASTER -- Uses the RETURN pin to determine if another master
on the bus is transmitting at the same time. If a collision is detected bit 6
is set in RS232_ERRORS and all future PUTC's are ignored until bit 6 is
cleared. The signal is checked at the start and end of a bit time.
May not be used with the UART.


You have to use a soft UART with Multi-Master mode. You can use pins
that are not used by the hardware UART, such as B1 and B0. Example:
Code:
#use rs232(baud=9600 ,xmit=PIN_B1,rcv=PIN_B0,enable=PIN_C5,parity=e,MULTI_MASTER)


Or, if you want to use pins C6 and C7, you can add the FORCE_SW
parameter as shown below, and the compiler will create a soft UART
on those pins. Example:
Code:
#use rs232(baud=9600 ,xmit=PIN_C6,rcv=PIN_C7,enable=PIN_C5,parity=e,MULTI_MASTER,FORCE_SW)
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Jul 01, 2006 8:07 am     Reply with quote

Quote:

i've problems and i cant compile my code, instead it works fine.
Problems seem to concern ROM . as compilers goes out of ROM.


You did not post the preprocessor definitions used in the header in your code.
Are you aware of #device *=16 pointer qualifier for 16F series ?
Did you try to reduce the size of some of your bigger functions for a most efficient
allocation in memory blocks ?

Quote:

In my code I use this declaration in PIC16F876:
#use rs232(baud=9600 ,xmit=PIN_C6,rcv=PIN_C7,enable=PIN_C5,parity=e)

What compiler version are you using ? I had problems regarding the "enable pin"
handler with some of the last versions.

Humberto
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