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 62 matches
CCS Forum Index
Author Message
  Topic: Memory confusion on PIC16F devices
Martin Berriman

Replies: 5
Views: 14212

PostForum: General CCS C Discussion   Posted: Fri Apr 10, 2020 11:21 am   Subject: Memory confusion on PIC16F devices
PIC's store a copy of the FUSES at the "very end" of program memory. PROGRAM_MEMORY returns the start of where those fuses are (so that you don't overwrite them by mistake)

Thanks - for ...
  Topic: Memory confusion on PIC16F devices
Martin Berriman

Replies: 5
Views: 14212

PostForum: General CCS C Discussion   Posted: Fri Apr 10, 2020 11:15 am   Subject: Memory confusion on PIC16F devices
Hex files are in bytes. The program memory words are 14-bits in that PIC and take 2 bytes per word.

Thank you, that makes sense.

I have however, as an experiment, written to the top of program ...
  Topic: Memory confusion on PIC16F devices
Martin Berriman

Replies: 5
Views: 14212

PostForum: General CCS C Discussion   Posted: Fri Apr 10, 2020 10:17 am   Subject: Memory confusion on PIC16F devices
I'm using a PIC16F18445 at the moment. I've used many 18F parts with CCS but I'm struggling to understand the program memory usage with the 16F part.

The 16F18445 has 8k of program memory so up to ...
  Topic: Optimising code
Martin Berriman

Replies: 15
Views: 15276

PostForum: General CCS C Discussion   Posted: Sun Mar 09, 2008 6:47 am   Subject: Optimising code
Thought I would post on the outcome of my optimisation efforts.

Having followed the suggestions from Ttelmah and ckielstra, I managed to save over 20% code space! Shocked Particular thanks to ckie ...
  Topic: Optimising code
Martin Berriman

Replies: 15
Views: 15276

PostForum: General CCS C Discussion   Posted: Wed Mar 05, 2008 3:47 am   Subject: Optimising code
Ages ago, I posted here, a 'demo' routine showing a more efficient way of doing the arithmetic for this. Cannot remember what the thread was about!. Basically, when you perform an /10, the remainder, ...
  Topic: Optimising code
Martin Berriman

Replies: 15
Views: 15276

PostForum: General CCS C Discussion   Posted: Wed Mar 05, 2008 1:59 am   Subject: Optimising code
A lot of folks here disagree with me on this, but I use floats a lot - makes code much simpler and more readable (maintainable). Yes, there are instances where the speed penalty comes into play, but . ...
  Topic: Optimising code
Martin Berriman

Replies: 15
Views: 15276

PostForum: General CCS C Discussion   Posted: Tue Mar 04, 2008 8:32 am   Subject: Optimising code
138 variations on the same theme sounds like an opportunity for optimization. Take note that pointer arithmetic is using a lot of code space in the PIC processor, so try to avoid passing variables as ...
  Topic: Optimising code
Martin Berriman

Replies: 15
Views: 15276

PostForum: General CCS C Discussion   Posted: Tue Mar 04, 2008 8:00 am   Subject: Optimising code
Here an example on the difference in code size between sprintf and manual coding:

void main()
{
snip
}

Wow Shocked
Thank you very much for doing that - it is like a slap i ...
  Topic: Optimising code
Martin Berriman

Replies: 15
Views: 15276

PostForum: General CCS C Discussion   Posted: Tue Mar 04, 2008 7:05 am   Subject: Optimising code
Thanks ckielstra,

The 32 bit division + multiply requires a lot of code space but this is about as good as it gets. The assembly code you show us is mostly for storing and retrieving the 32-bit par ...
  Topic: Optimising code
Martin Berriman

Replies: 15
Views: 15276

PostForum: General CCS C Discussion   Posted: Tue Mar 04, 2008 3:43 am   Subject: Optimising code
Thanks Ttelmah,

The reason for the small improvement, is that the compiler is already using a generic 'divide' routine in the original code.

Is it likely that I could improve over the generic di ...
  Topic: Optimising code
Martin Berriman

Replies: 15
Views: 15276

PostForum: General CCS C Discussion   Posted: Tue Mar 04, 2008 2:50 am   Subject: Optimising code
Thanks for your reply Pret

With some versions of CCS, (*calib_parameters).oil_flow_rate is better than calib_parameters->oil_flow_rate

I was not aware there was any difference there b ...
  Topic: Optimising code
Martin Berriman

Replies: 15
Views: 15276

PostForum: General CCS C Discussion   Posted: Tue Mar 04, 2008 1:47 am   Subject: Optimising code
I am using a PIC18F4685 but I have a very large program and am short on code space! I'm therefore trying to optimise things a bit.

I have quite a lot of int32 multiplies followed by divides to do ...
  Topic: ICD-U40 and FT245 chips in target system
Martin Berriman

Replies: 2
Views: 25258

PostForum: CCS ICD / Mach X / Load-n-Go   Posted: Fri May 25, 2007 8:08 am   Subject: ICD-U40 and FT245 chips in target system
For my solution,.. I move my target boards VID/PID to 0856/AC01. while doing test and debug.
Then change it to my assinged VID/PID when in production.

Cracking idea Treitmey Very Happy - now why di ...
  Topic: USB Conflict between ICDU-40 and FTDI chips
Martin Berriman

Replies: 1
Views: 20231

PostForum: CCS ICD / Mach X / Load-n-Go   Posted: Fri May 25, 2007 8:02 am   Subject: USB Conflict between ICDU-40 and FTDI chips
Sergio, did you get anywhere with this?
  Topic: ICD-U40 not working with another board using an FTDI
Martin Berriman

Replies: 7
Views: 43674

PostForum: CCS ICD / Mach X / Load-n-Go   Posted: Fri May 25, 2007 7:59 am   Subject: Re: ICD-U40 not working with another board using an FTDI
It is true, CCS does not play nicely when other FTDI devices are plugges in - it is pretty poor really - I have been putting up with it for over a year now and just checked on here today to see if the ...
 
Page 1 of 5 Goto page 1, 2, 3, 4, 5  Next
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group