Author |
Message |
Topic: format operator (%) invalid |
pfo
Replies: 1
Views: 9308
|
Forum: General CCS C Discussion Posted: Sun Feb 29, 2004 4:00 pm Subject: format operator (%) invalid |
my compiler doesn want to compile this:
int16 Analog_0_Filtered;
printf(rsputc,"\r\n %lh",Analog_0_Filtered);
but this is accepted:
printf(rsputc,"\r\n %lu",Analog_0_Filtered); |
Topic: PIC18X hardware multiply unit |
pfo
Replies: 2
Views: 11156
|
Forum: General CCS C Discussion Posted: Thu Feb 26, 2004 1:21 am Subject: PIC18X hardware multiply unit |
how do i use it? is optimized code for using it automaticaly generated by PCWH ? |
Topic: integrating with PIC |
pfo
Replies: 1
Views: 8733
|
Forum: General CCS C Discussion Posted: Wed Feb 25, 2004 7:51 am Subject: integrating with PIC |
hi!
i want to double integrate acceleration values (255 - 768 for - 1g and +1 g, respecivley)to get the new position ...
how would i design an algorithm that calculates the new position?
i mean ... |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Wed Feb 25, 2004 3:56 am Subject: rs232 communication knicks overall performance |
You can do something like this and achieve resultes simular to an RC filter.
set_adc_channel(0);
GO_DONE=1;
Analog_0_Work+=Analog_0_RAW;
Analog_0_Fi ... |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Tue Feb 24, 2004 6:43 am Subject: rs232 communication knicks overall performance |
i'm trying to sample a MMA series accelerometer, it has a refresh freq @ ~ 1KHz, and i want to oversample it, cause its quite noisy.
but i'm hardly ablue to got even to nyquist!
You may be better ... |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Tue Feb 24, 2004 6:41 am Subject: rs232 communication knicks overall performance |
pfo,
Max speed rs232 at 115.2k =>
115200/10 = 11520 characters if you devide over two channels
5760 characters / channel if you use 2 bytes per sample
2880 samples/ channel are posib ... |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Tue Feb 24, 2004 12:18 am Subject: rs232 communication knicks overall performance |
i'm trying to sample a MMA series accelerometer, it has a refresh freq @ ~ 1KHz, and i want to oversample it, cause its quite noisy.
but i'm hardly ablue to got even to nyquist! |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Mon Feb 23, 2004 4:27 pm Subject: rs232 communication knicks overall performance |
Is there a method of proving the the average computation takes realy place and that i sample ~ 10KHz (for both channels) and that the rs232 comm is thre real slow part of the while statement?
I gue ... |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Mon Feb 23, 2004 4:01 pm Subject: rs232 communication knicks overall performance |
i now put a new variable in the update_running_average() function and after 1 minute its value is ~ 22K (-> 11K samples/channel/minute) ....
:((
who could i improve this? i nead at least ~ 5K ... |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Mon Feb 23, 2004 3:27 pm Subject: rs232 communication knicks overall performance |
printf(bputc,"\r\n%lu",X.average);
printf(bputc," %lu",Y.average);
Let's assume that these statements together put out an
average of 10 characters per record. That assumes
4 charact ... |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Mon Feb 23, 2004 2:40 pm Subject: rs232 communication knicks overall performance |
pfo,
Is it 70000 records or 70000 characters in 60 seconds ?
First check if the printf(%ul is the problem
just disable all AD parts and use:
printf("\r\n12345"); // for the first and
pri ... |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Mon Feb 23, 2004 2:34 pm Subject: rs232 communication knicks overall performance |
pfo,
Is it 70000 records or 70000 characters in 60 seconds ?
First check if the printf(%ul is the problem
just disable all AD parts and use:
printf("\r\n12345"); // for the first and
pri ... |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Mon Feb 23, 2004 2:11 pm Subject: rs232 communication knicks overall performance |
i capture the output to a file, and w/ w/o the file just contains ~ 70K entries after 60secs ... :(
it just gets slower when i use a larger buffer or use more printfs! |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Mon Feb 23, 2004 1:12 pm Subject: rs232 communication knicks overall performance |
i used the code that's provided in the examples, but it doesn't seem to increase my overall performance ... that's my code:
#include <18F452.h>
#device ADC=10
#fuses HS,NOWDT,NOPROTECT,NOLV ... |
Topic: rs232 communication knicks overall performance |
pfo
Replies: 26
Views: 52775
|
Forum: General CCS C Discussion Posted: Mon Feb 23, 2004 3:37 am Subject: rs232 communication knicks overall performance |
hi!
my code looks like that:
while(1)
{
do stuff (); // it takes ~ 100uS to do it ...
printf("blah blah"); // rs232 @ 115kba ... |
|