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

Difference V4 to V5 ?

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



Joined: 01 Mar 2020
Posts: 5

View user's profile Send private message

Difference V4 to V5 ?
PostPosted: Sun Mar 01, 2020 11:47 am     Reply with quote

I have a project with a communication stack for modbus working under CCS V4.25 since 2009.
Ported this project to V5 (newest version) with no changes to the source code - failed to work. If I debug the receive buffer - the contents is scrambled under V5.
Took the project back to V4 - open by double clicking the project.PJT - download - fine again.
It does not matter if you debug the program with the ccs IDE's or if you use MPLAB 8 (for V4) or MPLAB C IPE (for V5) to program the controller.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Mar 01, 2020 11:53 am     Reply with quote

Post your PIC.
ccsHowTo



Joined: 01 Mar 2020
Posts: 5

View user's profile Send private message

Microcontroller used - PIC16F886
PostPosted: Sun Mar 01, 2020 12:16 pm     Reply with quote

I use the PIC16F886 ..

#use rs232(baud=19200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
Ttelmah



Joined: 11 Mar 2010
Posts: 19375

View user's profile Send private message

PostPosted: Sun Mar 01, 2020 1:35 pm     Reply with quote

Do you do any custom interrupt handling?. The format of saved data
in the ISR changes with V5.
Also CCS 5 fixes the interrupts being disabled in some printf statements.
Some fuses change names in CCS 5, and the defaults are changed to
match what the chip defaults to. You need to look at the fuses from the
V4 compile and ensure you set the fuses to match this.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Mar 01, 2020 1:38 pm     Reply with quote

ccsHowTo wrote:
CCS V4.25 since 2009.

One more thing. Clarify your compiler version. Do you have 4.025 or 4.125 ?
temtronic



Joined: 01 Jul 2010
Posts: 9176
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Mar 01, 2020 2:12 pm     Reply with quote

re: ...
#use rs232(baud=19200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

you NEED to add 'ERRORS' to the options, unless YOU handle UART overflow....
Ttelmah



Joined: 11 Mar 2010
Posts: 19375

View user's profile Send private message

PostPosted: Mon Mar 02, 2020 1:37 am     Reply with quote

Also, are you using the modbus.c from the old compiler or the new?. If the
new, this needs MODBUS_PROTOCOL #defined as
MODBUS_PROTOCOL_SERIAL to be compatible with the older driver. This didn't
support MODBUS_RTU now it does, and the defines needed have changed
to add support for this.
jeremiah



Joined: 20 Jul 2010
Posts: 1329

View user's profile Send private message

PostPosted: Mon Mar 02, 2020 3:09 pm     Reply with quote

Also since you say the contents are scrambled, this could suggest either a UART setup or clock setup problem.

How did you verify your clock settings were correct?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 02, 2020 5:20 pm     Reply with quote

Also, when you were running vs. 4.025, did you copy the PIC's .h file
into your project folder ? There can be substantial differences between
some of the constants in the PIC .h files between compiler versions.
CCS can add features to functions and change constants or their meaning.
If you did this, remove the old vs. 4.025 PIC .h files, and let the vs. 5
compiler pick up the correct vs. 5 .h file for it.

Also, you said things are scrambled. I smell pointer arithmetic. It's a
possibility. Post any code where you're doing pointer arithmetic.
temtronic



Joined: 01 Jul 2010
Posts: 9176
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 03, 2020 5:39 am     Reply with quote

I have to ask, why, did you change compiler versions ? You were cutting and compiling fine BEFORE.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 03, 2020 6:21 am     Reply with quote

Temtronic, this is a bogus post of yours. It's done just because you are
bored. The truth: He has an ancient version, 4.025, left over from Feb.
19, 2007. There are tons of reasons to go to version 5. Let's list them.

New library code added:
#use pwm()
#use capture()
#use timer() allows creation of timer ticks.
These new libraries make it easy to use the PIC's features without calling
a lot of setup functions. Just like #use rs232() makes it really easy to use
serial comms.

Enhanced features added:
#use rs232() flow control (RTS/CTS), and transmit and receive buffers.
#use SPI() streams added
pin_select() function added (in addition to #pin_select directive).

Compiler efficiency:
Vs. 5 reduces ROM usage in the compiled code by about 20% compared
to the older vs. 4 compiler. Temtronic, that alone is worth upgrading.

IDE
Many new features, for those who use the IDE.

Other non-documented features
Lots of little things work better or have been slightly enhanced.
You can tell this by comparing the manual sizes. The current CCS manual
is 622 pages. The latest vs. 4 compiler manual only has 382 pages.
Admittedly, the new manual incorporates PCD, but there are still many
pages of new stuff. June 2012 CCS manual:
https://t1.daumcdn.net/cfile/tistory/184FAE3A5102B90E20?download
Ttelmah



Joined: 11 Mar 2010
Posts: 19375

View user's profile Send private message

PostPosted: Tue Mar 03, 2020 7:47 am     Reply with quote

Must admit though that it should not actually be that hard to move between the versions. A number of things apply:

1) There is some custom code that was generated to fix issues with the V4
compiler. 4.025, is early enough that this could be the case.
2) Possibility that the clock setup is wrong. As I said early on, look at
the fuses actually being used with the V4 version and verify these are the
same on the V5 version. There have been quite a few changes to the fuse
default behaviour.
3) Possibility of incorrect pointer handling.

I must admit I'd put my money on '2', followed by '3'.

I've ported a lot of old V3 and V4 code up to modern compilers and have never
seen any major issues.
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