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

Error in setup_uart
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
temtronic



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

View user's profile Send private message

PostPosted: Sat Aug 24, 2019 6:13 pm     Reply with quote

OK, it must be a language mis understanding....
I don't use the dsPIC series of PICs..too many features, too complicated and too little time to learn( I'm 66 BTW). It's taken me 1/2 my life just to begin to code PICs to do meaningful work around the shop....

There may be books or online websites, though I tend to look at dsPIC as a 'small' market, unlike the 16F and now 18F series. Others who use them professionally may reply. I know they are fast and complicated...

You should post what you want it to do...
Jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Aug 24, 2019 6:43 pm     Reply with quote

rfjhh wrote:
Can you tell me how to use the dsp motor with ccs?

Use the CCS forum's search page:
http://www.ccsinfo.com/forum/search.php
Put the following text into the search box:
Quote:
dsPIC* motor

Also select this tickbox:
Quote:
[x] Search for all terms

Then click the Search button. You will get many forum articles
with sample code for PWM motor control.
rfjhh



Joined: 31 Mar 2011
Posts: 51
Location: Mexico

View user's profile Send private message

PostPosted: Mon Aug 26, 2019 9:19 am     Reply with quote

Hi

Sorry I'm not talking about motor control, I talk about the use of DSP motor. I'd like to perform some digital filter and another complex operations with the DSP part of the dsPIC
temtronic



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

View user's profile Send private message

PostPosted: Mon Aug 26, 2019 10:43 am     Reply with quote

hmm ..'motor'... might be the langauge problem, as I think he means DSP 'engine', the internal peripheral/controller/subsection that does DSP.
Ttelmah



Joined: 11 Mar 2010
Posts: 19497

View user's profile Send private message

PostPosted: Mon Aug 26, 2019 10:45 am     Reply with quote

Problem is the term 'DSP motor', does not tell us what you actually have,
or give any idea of how it is controlled.
It means presumably a servo controlled by a DSP. If so, the manufacturer
and coder of this will have some documentation describing it's interface
and the command language it supports. You can't write a single line of code
or make any connections till you know what it needs, and we cannot help
you until you tell us this....
rfjhh



Joined: 31 Mar 2011
Posts: 51
Location: Mexico

View user's profile Send private message

PostPosted: Mon Aug 26, 2019 10:59 am     Reply with quote

YES... Very Happy you're right temtronic, I mean engine. The part DSP of dsPIC
rfjhh



Joined: 31 Mar 2011
Posts: 51
Location: Mexico

View user's profile Send private message

PostPosted: Mon Aug 26, 2019 11:04 am     Reply with quote

I have another question concerning ADC.
In dsPIC33FJ32MC202 we have a 12 bits ADC, but if I write

Code:
#device adc=12

I read a maximum value of 1023, 10 bits
Code:

int16 val_adc;
   setup_adc(ADC_CLOCK_INTERNAL|ADC_TAD_MUL_0);
      setup_adc_ports(sAN0|VSS_VDD);
      set_adc_channel(0);
for(;;)
   {
      delay_ms(1000);         
         val_adc = read_adc();            
         printf("\r\n El valor es:  %4Lu", val_adc);
    }
Ttelmah



Joined: 11 Mar 2010
Posts: 19497

View user's profile Send private message

PostPosted: Mon Aug 26, 2019 11:17 am     Reply with quote

The DsPIC, _is_ the DSP. There is no separate engine.
Some chips do have elements to do things like calculating checksums,
but not this one.
On the ADC example you show, where is the #device line placed in the
code?. What compiler version are you using?.
rfjhh



Joined: 31 Mar 2011
Posts: 51
Location: Mexico

View user's profile Send private message

PostPosted: Mon Aug 26, 2019 11:29 am     Reply with quote

Code:
#include<33FJ32MC202.h>
#device adc=10
#FUSES NOWDT            // No Watch Dog Timer
#FUSES ICS0             // ICD communication channel 0 
#FUSES NOJTAG           // JTAG disabled   
#FUSES NODEBUG          // No Debug mode for ICD
#FUSES NOPUT            // No Power Up Timer
#FUSES WPOSTS1          // Watch Dog Timer PostScalar 1:1     
#FUSES WPRES128         // Watch Dog Timer PreScalar 1:128     
#FUSES NOWINDIS         // Watch Dog Timer in Window mode
#FUSES NOOSCIO          // OSC2 is general purpose output 
#FUSES NOIESO           // Internal External Switch Over mode disabled
#FUSES NOWRT            // Program memory not write protected
#FUSES NOPROTECT        // Code not protected from reading
#FUSES NOWRTB           // Boot block not write protected
#FUSES NOBSS         // No boot segment
#use delay(internal=7.37MHz)


I'm using CCS 5.015 for:
IDE
PCB
PCM
PCH
PCD

Regardng the DSP, how may I use the DSP capabilities with CCS?
Ttelmah



Joined: 11 Mar 2010
Posts: 19497

View user's profile Send private message

PostPosted: Mon Aug 26, 2019 11:37 pm     Reply with quote

Ouch. 5.015, was a very early V5 compiler. I'd quite expect the ADC=
setting to not work properly on this. Probably your problem.

If you are programming the chip, you are using them!... The point is it
is a very fast core, able (for example) to read an ADC many thousands
of times a second, and the processor is then fast enough to do real time
processing on these values, so 'DSP'.
If you look at fft_filter.c, this shows the DMA (using an external codec),
being combined with the processor to perform FFT. The actual data
buffer handling is done in assembler for speed (in dsp_data_util.c), and
shows a good example of the processor being used for DSP.
rfjhh



Joined: 31 Mar 2011
Posts: 51
Location: Mexico

View user's profile Send private message

PostPosted: Fri Sep 06, 2019 3:07 pm     Reply with quote

Ttelmah

Do you know some document about clock settings with CCS. For instance, I don't understand how to use #use delay with all it's possibilities, the PLL settings, the prescaler configurations, etc.

Regards
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Sep 07, 2019 6:33 am     Reply with quote

CCS compiler manual:
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
rfjhh



Joined: 31 Mar 2011
Posts: 51
Location: Mexico

View user's profile Send private message

PostPosted: Sun Sep 08, 2019 7:03 pm     Reply with quote

PCM programmer, I use this manual, but it is not clear how to use, for instance
#use delay(clock=32MHz, oscillator=8MHz)
The examples shown in this manual are very simple and they don't show the power of this statement in dsPIC clock settings.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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