Author |
Message |
Topic: CCS math operation problems |
castek
Replies: 24
Views: 26519
|
Forum: General CCS C Discussion Posted: Mon Oct 22, 2012 11:17 am Subject: CCS math operation problems |
Thanks a lot for your help.
I thought that simulation was the future for electronic project, but I realize that there's not any good simulator that avoid physical testings on pic. I will use schema ... |
Topic: CCS math operation problems |
castek
Replies: 24
Views: 26519
|
Forum: General CCS C Discussion Posted: Mon Oct 22, 2012 8:11 am Subject: CCS math operation problems |
If cannot use proteus with CCS compiler, which simulator does CCS support or recommend? You should know mplab is not as good as proteus to test and simulate, cause you cannot do what proteus allow. Yo ... |
Topic: CCS math operation problems |
castek
Replies: 24
Views: 26519
|
Forum: General CCS C Discussion Posted: Tue Oct 16, 2012 5:14 am Subject: CCS math operation problems |
Well.. I´m printing the result in an LCD in proteus... maybe there´s the problem. I´m using PCD 4.134 same as you. However I´m downloading the demo version of PCD 4.137 to check... I´m getting cr ... |
Topic: CCS math operation problems |
castek
Replies: 24
Views: 26519
|
Forum: General CCS C Discussion Posted: Tue Oct 16, 2012 3:24 am Subject: CCS math operation problems |
I have changed but got same problem, result is still 511. How can I see the true value for res16?? I dont know if its a printf problem or a PCD math problem.
However I found a bad solution.
PCD ... |
Topic: CCS math operation problems |
castek
Replies: 24
Views: 26519
|
Forum: General CCS C Discussion Posted: Mon Oct 15, 2012 2:16 pm Subject: CCS math operation problems |
I compiled the same code with PCD 4.134 but got same wrong result... this is quite weird !! (I have updated to 4.134)
unsigned int16 ind1=5000;
unsigned int16 ind2=5000;
unsigned int16 res16; ... |
Topic: CCS math operation problems |
castek
Replies: 24
Views: 26519
|
Forum: General CCS C Discussion Posted: Mon Oct 15, 2012 9:07 am Subject: CCS math operation problems |
I´ve executed your code and res16=511
When I use ind1=500 and ind2=500, and divide per 1000 result is 3, if I divide per 100 result is 2500 and if I divide per 10 result is 25000.
Something do ... |
Topic: CCS math operation problems |
castek
Replies: 24
Views: 26519
|
Forum: General CCS C Discussion Posted: Mon Oct 15, 2012 5:43 am Subject: CCS math operation problems |
ok..
I just want to multiply unsigned int16 5000 * unsigned int16 5000 = unsigned int32 25000000, and then divide it per 1000 so I get unsigned int32 25000 so I can store in a unsigned int16 with ... |
Topic: CCS math operation problems |
castek
Replies: 24
Views: 26519
|
Forum: General CCS C Discussion Posted: Sat Oct 13, 2012 12:19 pm Subject: CCS math operation problems |
This is a fixed point function for multiplications.
int16 mul(int16 ind1, int16 ind1_fx, int16 ind2, int16 ind2_fx, int16& res_fx)
{
volatile unsigned int16 res;
volatile un ... |
Topic: CCS math operation problems |
castek
Replies: 24
Views: 26519
|
Forum: General CCS C Discussion Posted: Sat Oct 13, 2012 11:16 am Subject: CCS math operation problems |
It seems there are just two ways:
One way is using float point, but this seems not to be the right way. Too slow. However, why float point does not work OK and feedback me strange symbols like ?, R ... |
Topic: CCS math operation problems |
castek
Replies: 24
Views: 26519
|
Forum: General CCS C Discussion Posted: Sat Oct 13, 2012 8:20 am Subject: CCS math operation problems |
Hello everyone,
First of all:
My ver. is 4.130 PCD, and dspic33FJ32MC204
I´m trying to do some test calculations, first tried with fixed point calculations (_fixed(n)).
So my code is:
... |
Topic: PWM problem with pic16F1503 |
castek
Replies: 14
Views: 33561
|
Forum: General CCS C Discussion Posted: Mon Jul 16, 2012 5:53 am Subject: PWM problem with pic16F1503 |
It works!!!
Thanks a lot
CCS is GREAT |
Topic: PWM problem with pic16F1503 |
castek
Replies: 14
Views: 33561
|
Forum: General CCS C Discussion Posted: Fri Jul 13, 2012 11:39 am Subject: PWM problem with pic16F1503 |
Thanks for you help!!!
My compiler version is 4.133.
I like new pics because they are cheap and more powerful than older ones.
Are there anyway to run pwm on my new pic16F1503??
Which cod ... |
Topic: PWM problem with pic16F1503 |
castek
Replies: 14
Views: 33561
|
Forum: General CCS C Discussion Posted: Fri Jul 13, 2012 6:38 am Subject: PWM problem with pic16F1503 |
Hello everyone!
I'm trying to setup pwm1 on pic16F1503 but I don't have success.
I try to setup_ccp1(CCP_PWM) as I saw in forums, but compiler does not recognize that function. It seems way to d ... |
|