Author |
Message |
Topic: math function: pow(X,Y) error |
Piccolo
Replies: 9
Views: 18975
|
Forum: General CCS C Discussion Posted: Tue Aug 30, 2011 3:09 pm Subject: math function: pow(X,Y) error |
That was the problem! My project Options->Include Files was pointing to the version 3 compiler Drivers folder. the code is working as expected now, but I've got to do some trimming somewhere as the ... |
Topic: math function: pow(X,Y) error |
Piccolo
Replies: 9
Views: 18975
|
Forum: General CCS C Discussion Posted: Tue Aug 30, 2011 2:37 pm Subject: math function: pow(X,Y) error |
Sorry, I am using the PIC16F886 |
Topic: math function: pow(X,Y) error |
Piccolo
Replies: 9
Views: 18975
|
Forum: General CCS C Discussion Posted: Tue Aug 30, 2011 2:34 pm Subject: math function: pow(X,Y) error |
Here's the ASM output:
.................... Value = pow(10,0);
0F84: CLRF 58
0F85: CLRF 57
0F86: MOVLW 20
0F87: MOVWF 56
0F88: MOVLW 82
0F89: ... |
Topic: math function: pow(X,Y) error |
Piccolo
Replies: 9
Views: 18975
|
Forum: General CCS C Discussion Posted: Tue Aug 30, 2011 2:30 pm Subject: math function: pow(X,Y) error |
Here's some more information:
with this code,
#include "math.h"
float Value;
void CalcPOW(void)
{
Value = pow(10,0); //should be 1 but actual result is ... |
Topic: math function: pow(X,Y) error |
Piccolo
Replies: 9
Views: 18975
|
Forum: General CCS C Discussion Posted: Tue Aug 30, 2011 12:43 pm Subject: math function: pow(X,Y) error |
Sorry, I must have hit a wrong button, as I was not finished with my query.
I tried this code with a PIC24 part, and when I used float64 the code ran properly.
I cannot use float64 with PIC16 part ... |
Topic: math function: pow(X,Y) error |
Piccolo
Replies: 9
Views: 18975
|
Forum: General CCS C Discussion Posted: Tue Aug 30, 2011 12:37 pm Subject: math function: pow(X,Y) error |
Hello Forum,
I am using a PIC16F866 with CCS compiler version 4.124.
It seems the math.h function pow(X,Y) does not behave, or I'm missing something (quite possible).
Here's my code snippet:
... |
Topic: PIC24FJ128GB106 int16 to int32 error |
Piccolo
Replies: 2
Views: 3316
|
Forum: General CCS C Discussion Posted: Thu Sep 09, 2010 3:05 pm Subject: PIC24FJ128GB106 int16 to int32 error |
I changed int16 to unsigned int16 and then it worked just fine.
Thank you for your help. |
Topic: PIC24FJ128GB106 int16 to int32 error |
Piccolo
Replies: 2
Views: 3316
|
Forum: General CCS C Discussion Posted: Thu Sep 09, 2010 1:22 pm Subject: PIC24FJ128GB106 int16 to int32 error |
Using PCWHD IDE 4.112
Part is PIC24FJ128GB106 w/ Date code 10171R6
Here's my test code:
MyInt16 = 32768;
MyInt32 = (int32)MyInt16;
Set_LCD_Page(9);
printf(lcd_p ... |
Topic: PIC16LF1937 |
Piccolo
Replies: 3
Views: 7448
|
Forum: General CCS C Discussion Posted: Fri Feb 05, 2010 10:18 am Subject: PIC16LF1937 PIN_D1 won't work as input |
I should have included this:
#byte ANSELD = 0x18F
bit_clear(ANSELD,1);
Piccolo |
Topic: PIC16LF1937 |
Piccolo
Replies: 3
Views: 7448
|
Forum: General CCS C Discussion Posted: Fri Feb 05, 2010 10:16 am Subject: PIC16F1937 PIN_D1 won't work as input |
Here's what I found to fix the problem:
I need to go and clear the ANSELD register bit 1.
bit_clear(ANSELD,1);
Works fine now. |
Topic: PIC16LF1937 |
Piccolo
Replies: 3
Views: 7448
|
Forum: General CCS C Discussion Posted: Fri Feb 05, 2010 8:44 am Subject: PIC16LF1937 |
Using PCWH 4.103
Here's my FUSEs:
#include <16LF1937.h>
#device *=16
#FUSES NOWDT //No Watch Dog Timer
#FUSES INTRC_IO //Internal RC Osc, no CLKOUT
#FUSE ... |
Topic: How do I convert float to Int or long? |
Piccolo
Replies: 3
Views: 9238
|
Forum: General CCS C Discussion Posted: Tue Nov 24, 2009 5:33 pm Subject: How do I convert float to Int or long? |
Note: when you cast from a float to an integer your integer will "drop off" any of the original float value that was to the right of the decimal point. This means 20.5 will become 20 as an i ... |
Topic: problem with shift_left function |
Piccolo
Replies: 4
Views: 13928
|
Forum: General CCS C Discussion Posted: Mon Nov 23, 2009 10:52 am Subject: problem with shift_left function |
FYI: I received notice today from CCS Tech Support that the fix is in the next release. |
Topic: problem with shift_left function |
Piccolo
Replies: 4
Views: 13928
|
Forum: General CCS C Discussion Posted: Fri Nov 20, 2009 5:11 pm Subject: problem with shift_left function |
I'm using the PIC16F1937. I didn't post it because I guess it's not part-specific, but I could be wrong.
Code something like this:
To read 16 bits of data from PIN_A1 into a 16-bit:
int16 MyB ... |
Topic: problem with shift_left function |
Piccolo
Replies: 4
Views: 13928
|
Forum: General CCS C Discussion Posted: Fri Nov 20, 2009 4:25 pm Subject: problem with shift_left function |
I have been working with PCWH compiler version 4.100 for a couple of days now. I have been able to get my circuit to function, but in the process I have discovered that the functions shift_left and sh ... |
|