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

Wrong compiler function if not defining "xmit="?

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








Wrong compiler function if not defining "xmit="?
PostPosted: Sat Nov 29, 2008 3:54 am     Reply with quote

Wrong compiler function if not defining "xmit="?


Ex1. This will generate right code.
Code:
#use rs232(baud=9600,xmit=PIN_A5,rcv=PIN_A4)


Ex2. This will generate _wrong_ code!
Code:
#use rs232(baud=9600,rcv=PIN_A4)


If only using the "xmit" and _not_ the "rcw" there are no problem?

Compiler (PCH) V_4.074
Ttelmah
Guest







PostPosted: Sat Nov 29, 2008 4:00 am     Reply with quote

This is completely normal.
_If_ you only select one pin, the compiler will assume you deliberately want to use a _software_ UART, and generate the code for this.
Do a search here. I have posted in the past, how to turn off half the UART, if you only want to use one hardware pin.

Best Wishes
Guest








PostPosted: Sat Nov 29, 2008 8:21 am     Reply with quote

Hi

If looking at the generated code, i think it,s wrong!
Code:
#use rs232(baud=9600,rcv=PIN_A4)


Code:
0050:  BSF    STATUS.RP0
0051:  BCF    TRISIO.TRISIO0
0052:  BCF    STATUS.RP0
0053:  BCF    GPIO.GP0 <----This will clear GP0 and it's not defined???
0054:  MOVLW  08
0055:  MOVWF  @21
0056:  GOTO   057
........


But the workaround is define both pin and only use one, thanks.
Ttelmah
Guest







PostPosted: Sat Nov 29, 2008 8:46 am     Reply with quote

Problem is I see no suggestion that this is the generated code for the RS232 line...
You need to give us something to work on:
1) What processor.
2) A_minimum_ compilable program that shows the fault. Normally just the processor include, fuses, clock settings, RS232 declaration, and a couple of lines, showing some serial I/O, to show where this code is actually being generated.
You say the compiler is PCH, but the code shown, looks to be PCM code.

Best Wishes
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