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

compiler strange behavior

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



Joined: 05 Aug 2017
Posts: 41
Location: brazil

View user's profile Send private message

compiler strange behavior
PostPosted: Sun Dec 31, 2017 1:03 pm     Reply with quote

Debugging different programs i have experiences 3 or 4 times lately that the compiler output behaves different from source, some times on very simple routines.

On all cases the solution was to cut/ paste the source program to a text file and do the reverse from the text file, that I understand will eliminate any character not recognized as a valid one. ( on my cases they were not displayable characters as I carefully revised the few source input lines were the execution problem occurs not finding anything estrange.)

The filtering through text file have solved the problem.

They generally appeared after somehow heavy editing on that portion of source.

Have anyone have same problem ?

Is there any way to tell compiler force an error on invalid characters???

Oops, i should mention the editing was performed from the proteus editor and compiled by PCW 5.075.


happy 2018
jujo
temtronic



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

View user's profile Send private message

PostPosted: Sun Dec 31, 2017 2:55 pm     Reply with quote

The editing was performed from the Poteus editor.

Therein lies your answer.

Get RID of Proteus and have a Happy New year !
jujoab



Joined: 05 Aug 2017
Posts: 41
Location: brazil

View user's profile Send private message

PostPosted: Sun Dec 31, 2017 4:31 pm     Reply with quote

temtronic wrote:
The editing was performed from the Proteus editor.

Therein lies your answer.

Get RID of Proteus and have a Happy New year !


Thanks, i have already heard of Proteus problems.

But I don't know of any other PIC simulator with a RS232 or other kind of output where to show the results. So that's why at the beginning of a program development that it later will be passed to mplab x and a physical h/w device. I love to simulate at my PC.
Any suggestion ????

regards
jujo
temtronic



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

View user's profile Send private message

PostPosted: Sun Dec 31, 2017 5:06 pm     Reply with quote

I've heard...MPLAB has simulator capabilty
though I've never used any 'simulator' in 30 years of using PICs.
No 'simulator' can accurately simulate the Real World so I always build/burn/test in the Real World.
I understand the 'new' generation of programmers who need to use simulators but after seeing thousands of problems with Proteus on this one forum confirms 'simulators' are not for me. Then again I 'cut my teeth' on machine code and paper tape.

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19499

View user's profile Send private message

PostPosted: Mon Jan 01, 2018 2:21 am     Reply with quote

I suppose it is down to some confidence (maybe stupidity...). However the first thing I do is spend the time to genuinely work out if I can route all the peripherals I want to the PIC devices I want. I'll then have a text 'table' describing each pin, what connects to it, with notes on any restrictions this brings.
With this done, I'll design the PCB, possibly with changes on the way if the layout could be improved by moving pins. For small boards I'll get them made 'in house' (I have a small CNC that can make up to four layer boards, but gets very expensive if the board area is large), so for boards larger than this, I'll use one of the Indian or Chinese prototyping services. These are really impressive. Typically take a couple of weeks to produce full PCB's with silk and masks (Ragworm, PCB-Pool etc..), for less than you could buy a bit of Vero for in the past... Probably order a minimum of four for prototypes.
While the board is being made I'll start writing the code.

I may well find some small faults when the prototype is tested. For instance on the last board I did, there was a difference between the PIC I finally used and the one I originally intended to use, that meant one pin had to have a wire attached, and two tracks swapped. However fine PTFE insulation sleeving and a little delicate soldering, and the result is still a usable board. These are what are used for the test-bench trials and often to one or two customers for beta testing.

Now I have used the MPLAB simulator, and the Isis (Proteus) simulator.
Both completely ignore electrical effects. So capacitances timings etc., do not affect the operation. The MPLAB one can be great for checking a timing. Both though completely ignore things that make the chip actually work or not (Proteus will 'believe' you if you tell it the chip has a clock, when the hardware can't work, and neither has any awareness of smoothing, supplies etc..). The only emulators/simulators that are honestly worth using for the whole design are full hardware ICE systems. However these are rare now, and very expensive.

I repeat what I have said many times here. If you rely on one of the simulator programs to try to develop a design, you may well think "I'm saving lots of time", but be prepared to have to completely re-design the board when you eventually switch to hardware. At the company where I worked a couple of years ago, they did a 'cost benefit' analysis of the various design routes available (which included Proteus 7), and found that the simulators cost more, than doing a genuine prototype.....
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jan 01, 2018 3:05 am     Reply with quote

jujoab wrote:

On all cases the solution was to cut/ paste the source program to a text
file and do the reverse from the text file, that I understand will eliminate
any character not recognized as a valid one. (on my cases they were not
displayable characters
as I carefully revised the few source input lines
were the execution problem occurs not finding anything estrange.)

Maybe this is caused by the code page used by your Proteus editor. Are
you using unicode ?

Or maybe you are doing some accidental keypresses that insert invisible
characters in the text.
Ttelmah



Joined: 11 Mar 2010
Posts: 19499

View user's profile Send private message

PostPosted: Mon Jan 01, 2018 5:04 am     Reply with quote

A very good point.

Worth saying, if you want to keep on using Proteus, why not make CCS your editor?. Source, Setup external editor. Much safer really to keep the tools the same...
jujoab



Joined: 05 Aug 2017
Posts: 41
Location: brazil

View user's profile Send private message

PostPosted: Mon Jan 01, 2018 9:35 am     Reply with quote

All suggestions are very valuable. I appreciate your time and effort.

The simplest one for me ( as suggested on one of your answers ) is to maintain both proteus and PWM open, edit and compile with the ccs editor only going to proteus for the simulation. They live together very well.
other reason to use proteus is the pcb design.



The prototype way is difficult for me because if I order transportation by mail ( with Chinese suppliers at least ) when arriving to Brasil the customs procedures take an enormous amount of time for clearance. Lead time is very uncertain.


The other way, Fedex or UPS have a fast clearance time, but the cost is prohibitive for hobby projects, as duty and taxes are high and calculated over CIF value. On top of that the companies charge a high local administration cost over the taxes.

Once again thanks to all.

jujo
temtronic



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

View user's profile Send private message

PostPosted: Mon Jan 01, 2018 10:10 am     Reply with quote

You might try www.banggood.com for some of the electronics. I've ordered a great many 'modules' and been pleased with quality and the FREE delivery, from China. It takes +-3 weeks though. While most of the modules are for 'Arduino', really that's their 'generic English' term for parts.

Jay
jujoab



Joined: 05 Aug 2017
Posts: 41
Location: brazil

View user's profile Send private message

PostPosted: Mon Jan 01, 2018 11:58 am     Reply with quote

temtronic wrote:
You might try www.banggood.com for some of the electronics. I've ordered a great many 'modules' and been pleased with quality and the FREE delivery, from China. It takes +-3 weeks though. While most of the modules are for 'Arduino', really that's their 'generic English' term for parts.

Jay


Thanks but I was referring to a Chinese prototyping service PCB manufacturer.
For parts / tools / etc I have long experience with dealextreme ( www.dx.com ).
very reliable
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