Author |
Message |
Topic: Help: a/abs(a)=0 when a positive?? |
louarnold
Replies: 7
Views: 6278
|
Forum: General CCS C Discussion Posted: Sun Jul 18, 2010 9:35 am Subject: Help: a/abs(a)=0 when a positive?? |
That version is basically pre-beta and is well known to be buggy.
Haha. I think he already knows.
Thanks very much for your help.
Lou. |
Topic: Help: a/abs(a)=0 when a positive?? |
louarnold
Replies: 7
Views: 6278
|
Forum: General CCS C Discussion Posted: Sat Jul 17, 2010 9:46 pm Subject: Help: a/abs(a)=0 when a positive?? |
My friend has a V4.0 compiler
That isn't a very definitive version number.
Wait for one of us to test it with vs. 4.109 later in the weekend.
We'll tell you if it works or not.
Its V4.013. T ... |
Topic: Help: a/abs(a)=0 when a positive?? |
louarnold
Replies: 7
Views: 6278
|
Forum: General CCS C Discussion Posted: Sat Jul 17, 2010 8:34 pm Subject: Help: a/abs(a)=0 when a positive?? |
well, a/abs(a) should fail when a=0, so its not a useful function as it stands.
A better one is:
#define sgn(x) ((x==0) ? 0 : ((x < 0) ? -1 : 1)) ... |
Topic: Help: a/abs(a)=0 when a positive?? |
louarnold
Replies: 7
Views: 6278
|
Forum: General CCS C Discussion Posted: Sat Jul 17, 2010 6:40 pm Subject: Help: a/abs(a)=0 when a positive?? |
Yes, that works for me also.
My friend has a V4.0 compiler. It has the same bug.
How do I find out if the bug has been reported? |
Topic: Help: a/abs(a)=0 when a positive?? |
louarnold
Replies: 7
Views: 6278
|
Forum: General CCS C Discussion Posted: Sat Jul 17, 2010 6:10 pm Subject: Help: a/abs(a)=0 when a positive?? |
Here is the code and the output wth the CCS V3.170b compiler.
#include <16f877A.h>
#fuses HS, NOLVP, NOWDT, PUT, NODEBUG
#use delay (clock = 20000000)
#use rs232 (baud=9600, xm ... |
Topic: Help: Out of ROM. |
louarnold
Replies: 6
Views: 10210
|
Forum: General CCS C Discussion Posted: Fri Jul 16, 2010 1:47 pm Subject: Help: Out of ROM. |
That's a great idea about blocking the memory. And I didn't use the math library in this project so that isn't a problem.
Thanks for the ideas tho,
Lou. |
Topic: Help: Out of ROM. |
louarnold
Replies: 6
Views: 10210
|
Forum: General CCS C Discussion Posted: Thu Jul 15, 2010 8:06 pm Subject: Help: Out of ROM. |
This is for a PIC 16F877A with the CCS PCM C Compiler, Version 3.170b,
ROM used: 2042 (100%)
Largest free fragment is 6
You have a compiler version that is limited to only 2K of ROM, instead ... |
Topic: Help: Out of ROM. |
louarnold
Replies: 6
Views: 10210
|
Forum: General CCS C Discussion Posted: Thu Jul 15, 2010 7:51 pm Subject: Help: Out of ROM. |
What is the ROM usage ? Look at the top of the .LST file. The .LST file
is in your project directory after a successful compilation.
Is your ROM usage close to 2K ? Do you have a version of ... |
Topic: Help: Out of ROM. |
louarnold
Replies: 6
Views: 10210
|
Forum: General CCS C Discussion Posted: Wed Jul 14, 2010 6:48 pm Subject: Help: Out of ROM. |
This is for a PIC 16F877A with the CCS PCM C Compiler, Version 3.170b, 16412. This is a limited edition compiler.
All seemed well, and then suddenly no more ROM.
I have:
- used #separate directive ... |
Topic: Help: 16F877A How to get Interrupt on ADC change only? |
louarnold
Replies: 3
Views: 5829
|
Forum: General CCS C Discussion Posted: Mon Jul 12, 2010 8:56 am Subject: Help: 16F877A How to get Interrupt on ADC change only? |
If you were just looking for a interrupt if the input moved above or
below a fixed voltage, then you could use the comparator, and use
the INT_COMP interrupt. You could even change the reference ... |
Topic: Help: 16F877A How to get Interrupt on ADC change only? |
louarnold
Replies: 3
Views: 5829
|
Forum: General CCS C Discussion Posted: Sun Jul 11, 2010 6:03 pm Subject: Help: 16F877A How to get Interrupt on ADC change only? |
I've been reading and trying code to get the ADC to interrupt only when it changes. But it seems to interrupt every time I prime it, and none if I don't prime it. I want an interrupt only when the ADC ... |
Topic: Help: Confused about Assembly listing. |
louarnold
Replies: 2
Views: 3802
|
Forum: General CCS C Discussion Posted: Thu Jul 01, 2010 10:07 am Subject: Help: Confused about Assembly listing. |
OK, I worked it out after finding the TRISB register:
At 72, RP0 (reg 3,bit 5) in the status register is set to 1. This switches access to register bank 1. This bank has the TRISB register in it.
At ... |
Topic: Help: Confused about Assembly listing. |
louarnold
Replies: 2
Views: 3802
|
Forum: General CCS C Discussion Posted: Thu Jul 01, 2010 9:27 am Subject: Help: Confused about Assembly listing. |
I'm not that familiar with the 16F877A. Can someone please explain the following instructions from an assembly listing of a C program.
.................... output_low(EEPROM_SELECT);
00 ... |
Topic: Help:Code gives different results on different hardware. |
louarnold
Replies: 16
Views: 16976
|
Forum: General CCS C Discussion Posted: Mon Jun 28, 2010 7:07 pm Subject: Help:Code gives different results on different hardware. |
Could you post the .lst file for your routine.
Cheers. Here it is.
CCS PCM C Compiler, Version 3.170b, 16412
ROM used: 216 (11%)
... |
Topic: Help:Code gives different results on different hardware. |
louarnold
Replies: 16
Views: 16976
|
Forum: General CCS C Discussion Posted: Mon Jun 28, 2010 8:02 am Subject: Help:Code gives different results on different hardware. |
I can't duplicate your problem. I don't have your test setup. I have an
ICD2. I believe you have a PicKit2. I tested it with vs. 4.109. I used
"Programmer" mode in MPLAB (not Debugger ... |
|