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

Search found 91 matches
CCS Forum Index
Author Message
  Topic: Is it possible to detect the state of SS when using the PIC
vsmguy

Replies: 2
Views: 3866

PostForum: General CCS C Discussion   Posted: Fri Apr 19, 2013 1:33 pm   Subject: Is it possible to detect the state of SS when using the PIC
In a SPI slave using the PIC Hardware spi peripheral, is it possible to find out if SS went low for the current byte or was already low to begin with before the current byte was transferred, without h ...
  Topic: #use spi, selecting baud mode and slave select logic
vsmguy

Replies: 0
Views: 3244

PostForum: General CCS C Discussion   Posted: Fri Apr 19, 2013 1:28 pm   Subject: #use spi, selecting baud mode and slave select logic
A SPI slave I am using (a FRAM device) requires me to hold the SS line low for multiple bytes in the same transaction (the first byte in a transaction is the command byte followed by context dependent ...
  Topic: SPI Read returns only 0 in slave when I hook up SS to INT
vsmguy

Replies: 4
Views: 5324

PostForum: General CCS C Discussion   Posted: Thu Apr 18, 2013 3:29 pm   Subject: SPI Read returns only 0 in slave when I hook up SS to INT

Obvious question is how fast the data is being sent, and whether there is any delay between operating the select, and the data being sent. Given the way the code is written, there is a huge delay be ...
  Topic: SPI Read returns only 0 in slave when I hook up SS to INT
vsmguy

Replies: 4
Views: 5324

PostForum: General CCS C Discussion   Posted: Thu Apr 18, 2013 10:03 am   Subject: SPI Read returns only 0 in slave when I hook up SS to INT
I am coding a SPI slave using a PIC16F877A and need to be aware when the SS line goes from high (idle) to low (active) as information from the master is framed as a stream of bytes with the leading by ...
  Topic: Two poll type questions about the PCH compiler
vsmguy

Replies: 2
Views: 4417

PostForum: General CCS C Discussion   Posted: Tue Jul 27, 2010 7:33 pm   Subject: Two poll type questions about the PCH compiler
@collink : I am interested in seeing the project that make the compiler behave so.

Could I have a look at it please?
  Topic: Writing equivalent of MPASM $+1 in inline assembly
vsmguy

Replies: 15
Views: 16778

PostForum: General CCS C Discussion   Posted: Thu Jul 15, 2010 6:23 pm   Subject: Writing equivalent of MPASM $+1 in inline assembly
Well?

:-)
  Topic: delay_us has a spurious check that introduces error
vsmguy

Replies: 8
Views: 7116

PostForum: General CCS C Discussion   Posted: Tue Jul 13, 2010 6:50 pm   Subject: delay_us has a spurious check that introduces error

Just wondering.... 0.002% == 20ppm
Have you checked the accuracy of your clock? Most likely your crystal will have a larger frequency spread over your application's operating temperature range.
...
  Topic: Writing equivalent of MPASM $+1 in inline assembly
vsmguy

Replies: 15
Views: 16778

PostForum: General CCS C Discussion   Posted: Tue Jul 13, 2010 7:14 am   Subject: Writing equivalent of MPASM $+1 in inline assembly

The problem is that the optimiser sees the second jump and says 'this is a waste of time'....

In that case why does this work correctly:

#inline
void delay4(void) {
#asm
...
  Topic: Writing equivalent of MPASM $+1 in inline assembly
vsmguy

Replies: 15
Views: 16778

PostForum: General CCS C Discussion   Posted: Tue Jul 13, 2010 5:30 am   Subject: Writing equivalent of MPASM $+1 in inline assembly
The nearest I can think of, would be (as a standalone function):

#inline
void delay4(void) {
#asm
GOTO inner1
inner1:
GOTO inner2
inner2:
#endasm
}

Or jus ...
  Topic: delay_us has a spurious check that introduces error
vsmguy

Replies: 8
Views: 7116

PostForum: General CCS C Discussion   Posted: Tue Jul 13, 2010 5:26 am   Subject: delay_us has a spurious check that introduces error
What compiler version?.

4.107


You comment on their not being routes to some parts of the code. Yet looking through the code, I can see routes to every line.

So 'no', I don't think your ana ...
  Topic: delay_us has a spurious check that introduces error
vsmguy

Replies: 8
Views: 7116

PostForum: General CCS C Discussion   Posted: Mon Jul 12, 2010 10:41 pm   Subject: delay_us has a spurious check that introduces error
It's not about the inaccuracy.

It's about the spurious check making the delay inaccurate.

Had those two lines not being there - it would have been 100% accurate.

( why handcode a delay - as I ...
  Topic: Counting number of instructions in CCS C
vsmguy

Replies: 7
Views: 8498

PostForum: General CCS C Discussion   Posted: Mon Jul 12, 2010 10:39 pm   Subject: Counting number of instructions in CCS C
Start exploring MPLAB. Go to the View menu. Bring up the Disassembly
Listing window. Put your breakpoints in there. Explore the program.

That's it. Thanks again.

Read the Help file.

I ...
  Topic: delay_us has a spurious check that introduces error
vsmguy

Replies: 8
Views: 7116

PostForum: General CCS C Discussion   Posted: Mon Jul 12, 2010 9:58 pm   Subject: delay_us has a spurious check that introduces error
For delays less than 153uS, CCS C generates the delay inline yeilding a 100% accurate delay.

Above 154uS ( and < 256uS ), CCS C uses a function call.

This function has a spurious check that i ...
  Topic: Counting number of instructions in CCS C
vsmguy

Replies: 7
Views: 8498

PostForum: General CCS C Discussion   Posted: Mon Jul 12, 2010 9:56 pm   Subject: Counting number of instructions in CCS C
Look it up in the PIC data sheet. For example, for the 18F452, look in
this section:

TABLE 20-2: PIC18FXXX INSTRUCTION SET

It lists the number of cycles used by each type of instruction.
Just ...
  Topic: Counting number of instructions in CCS C
vsmguy

Replies: 7
Views: 8498

PostForum: General CCS C Discussion   Posted: Mon Jul 12, 2010 7:29 pm   Subject: Counting number of instructions in CCS C
MPLAB Stopwatch can count instruction cycles.
http://www.ccsinfo.com/forum/viewtopic.php?t=38351

One more question - how do I do the same *but* between two lines in assembly generated by CCS?

F ...
 
Page 1 of 7 Goto page 1, 2, 3, 4, 5, 6, 7  Next
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group