View previous topic :: View next topic |
Author |
Message |
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Sat Aug 24, 2019 6:13 pm |
|
|
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
|
|
Posted: Sat Aug 24, 2019 6:43 pm |
|
|
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:
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
|
|
Posted: Mon Aug 26, 2019 9:19 am |
|
|
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
|
|
Posted: Mon Aug 26, 2019 10:43 am |
|
|
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: 19498
|
|
Posted: Mon Aug 26, 2019 10:45 am |
|
|
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
|
|
Posted: Mon Aug 26, 2019 10:59 am |
|
|
YES... you're right temtronic, I mean engine. The part DSP of dsPIC |
|
|
rfjhh
Joined: 31 Mar 2011 Posts: 51 Location: Mexico
|
|
Posted: Mon Aug 26, 2019 11:04 am |
|
|
I have another question concerning ADC.
In dsPIC33FJ32MC202 we have a 12 bits ADC, but if I write
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: 19498
|
|
Posted: Mon Aug 26, 2019 11:17 am |
|
|
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
|
|
Posted: Mon Aug 26, 2019 11:29 am |
|
|
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: 19498
|
|
Posted: Mon Aug 26, 2019 11:37 pm |
|
|
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
|
|
Posted: Fri Sep 06, 2019 3:07 pm |
|
|
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
|
|
|
rfjhh
Joined: 31 Mar 2011 Posts: 51 Location: Mexico
|
|
Posted: Sun Sep 08, 2019 7:03 pm |
|
|
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. |
|
|
|