Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 28, 2024, 06:54:54 18:54


Login with username, password and session length


Pages: [1]
Print
Author Topic: DSP/dsPIC Getting Started  (Read 4924 times)
0 Members and 1 Guest are viewing this topic.
biomed12
Junior Member
**
Offline Offline

Posts: 94

Thank You
-Given: 67
-Receive: 5


« on: September 25, 2016, 09:28:11 21:28 »

Hello dear members,

I am a last class eee student and I started to study on digital filters. I want to design a 0-150 Hz band pass filter for getting started(I have not determined certain parameters, I want to do something that behaves like 0-150Hz analog bandpass filter. I say it because some experts come and asking always about details and advanced topics. I dont ask that. Just I said my intention, anyway...).(Also I know theory and fundamentals, I started the pyhsically implementation).

I have coded MCUs about 1 years. So I thought that, I could implement a digital filter using a dsPIC easyly. I asked some people to use dsPIC, almost everyone told about that as if it is a s*it. First question is about that, why signallers see the dsPIC as an enemy? Can't I do an digital filter with dsPIC, that behaves like 0-150 hz analog band pass filter?

Secondly, How can I get started with DSPs? For example, for MCU coding, I got a PICKIT2 programmer, downloaded an IDE, and wrote the C codes and the last, I flashed my hex to PIC using that programmer, so all things was that. But I don't know how to start with DSP coding and implementation. What is the requirements? I found some books which were written 15 maybe 20 years ago and DSPs which are in that books are not available yet. I googled also searched from Digi-Key to find a starter kit or any chip to start, and now I am very very confused. If you were me, how did you started with DSPs? (I am a student so low cost kits would be perfect for me)

Lastly, What is the exact discrimination between DSPs and ordinary MCUs? There are always turning the same things about these on the internet. Allmost all of web site writes like copied from wikipedia. The discrimination comes from architecture? For example, can't I use my raspberry PI 3, which has cortex CPU, as a DSP?

I hope some of members don't distribute the topic with details. I tried to ask clearly.

Thanks.
« Last Edit: September 25, 2016, 09:35:27 21:35 by biomed12 » Logged
h0nk
Senior Member
****
Offline Offline

Posts: 256

Thank You
-Given: 208
-Receive: 230



« Reply #1 on: September 26, 2016, 03:09:38 15:09 »

Hello biomed12,

for a band pass 0-150 Hz You can use nearly any controller which can do
16 bit additions and multiplications in hardware.

I have not worked with dsPIC, but i have read that they use a lot of power.
Of course they should be able to run this bandpass.

I started my journey into DSP many years ago with the Motorola 56002.
This DSP has 3 address rooms on which he can work in one cycle.
One for the code and perhaps coefficients and two other for data.
At 80 MHz clock this gives a peak performance of 240 MLOPs.
This was not to bad for the time the 56002 arrieved.
Other DSPs have a similar architecture to achieve a good data throughput.

To access the data the 56002 has 8 address registers which hold
3 components: base, increment and modulo.
While the DSP operates on an array, this three components automagically
address the data for Your program.

There was a small framework for the eval kit which was sufficient to realize
Your own programs.
One part was the initialization of the DSP, the CODEC and other things.
The other part reads and writes the data to the codec with the speed of the samplerate
of the codec.
So to implement something with the DSP:

call init
loop:
call adda
do your calculations
goto loop

The subroutine adda also waits for the next occurence of the sample rate timer.
Thats all...

But, Your program must fit, in the matter of time, between the occurences of the sample rate.
Thats the way a DSP works. :-)


Best Regards
« Last Edit: September 26, 2016, 03:16:31 15:16 by h0nk » Logged
biomed12
Junior Member
**
Offline Offline

Posts: 94

Thank You
-Given: 67
-Receive: 5


« Reply #2 on: September 26, 2016, 03:27:55 15:27 »

Dear h0nk,

Thanks for your answers and sharing experiments. Do DSPs work concurrent like an FPGA or work sequential such as ordinary MCUs and CPUs? I understand that, there are some architectural differences in DSPs apart from others, some special registers and logical process parts...

Today, fortunately, one of my lecturer gave me a starter kit which is TMS3230C6416. This evaluation board is very expensive, 580 dolars on Digi-Key. I wonder that, there are 2 DSPs chip on this board, I could see... The value of those are about 160 dolars totally. So, suppose that, I have developed a filter whic is what I want and the development term will be ended. After, what will be? Will I write the pcb directly? So, I want to learn how can I program a single chip? Is there any special programmer or such tool?

Thanks.
« Last Edit: September 26, 2016, 03:33:10 15:33 by biomed12 » Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 972

Thank You
-Given: 230
-Receive: 959



« Reply #3 on: September 26, 2016, 04:47:51 16:47 »

That will all be answerd in the accompanying documents probably the one named manual. It could be in form of a hard copy or in digital fom on one of the CDs
Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
intel
Hero Member
*****
Offline Offline

Posts: 520

Thank You
-Given: 53
-Receive: 2141



« Reply #4 on: September 26, 2016, 05:14:43 17:14 »


The following links may be useful to you.

http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=SW300001
http://www.microchip.com/SWLibraryWeb/product.aspx?product=dsPIC%20DSC%20Equalizer%20Library
http://orca.cf.ac.uk/54726/1/U585115.pdf

Logged

In life, most genuine mentor is science.
h0nk
Senior Member
****
Offline Offline

Posts: 256

Thank You
-Given: 208
-Receive: 230



« Reply #5 on: September 26, 2016, 05:16:39 17:16 »

Hello biomed12,

for the floating point range of TI-DSP's there a JTAG-adapters available.
Look for TI XDS-510 and XDS-560.

DSP's are not parallel in the sense of a FPGA could do it.
As i wrote, the 56002 could do 3 parallel computations in one cycle.
The TMS320C67 use a VLIW (very large instruction word) to do some parallel computation.

But, i would think that using such beasts would not do favour to You.

I would recommend for Your purpose a much smaller ARM M3 or M4.
Some of them already have a ADC and DAC on the chip.
In the moment i do some evaluation on the STM32L152.
This one has 12 bit ADC's and 12 bit DAC's ready on the chip.

For Your bandpass You need a minimum sample rate of 300 Hz.

So most of the time the DSP/controller has to wait for the next sample...


Best Regards
Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 972

Thank You
-Given: 230
-Receive: 959



« Reply #6 on: September 26, 2016, 09:03:31 21:03 »

.....Some of them already have a ADC and DAC on the chip.
In the moment i do some evaluation on the STM32L152.
This one has 12 bit ADC's and 12 bit DAC's ready on the chip.
For Your bandpass You need a minimum sample rate of 300 Hz.
So most of the time the DSP/controller has to wait for the next sample...
Best Regards
I beg to differ here. Given that it is this board we are talking about her http://www.ti.com/tool/tmdsdsk6416
This board is fitted with a 24bit stereo codec. It also have all that is needed for debugging on board. And also it will be shipped with a lot examples. In other words it will contain all that is need for this project. Maybe it is somewhat overkill. But that does not matter in this case as it is a student project

Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
h0nk
Senior Member
****
Offline Offline

Posts: 256

Thank You
-Given: 208
-Receive: 230



« Reply #7 on: September 26, 2016, 09:42:25 21:42 »

Hello Sideshow Bob,

i would assume that the filter is used in a graphical device for medical purposes.
So i expected that 12 bit should be sufficient. But who knows :-).

And since it starts at 0 Hz i would estimate that it should DC-coupled.
I know that some TI Codecs on other TI-DSP-boards allow this, but i would not
be sure that this is always the case.

And if the final design should be implemented in hardware and not as an
exercise on an evalboard, then i would not deal with the complexity of
a floating-point-DSP.

As an small proof i implemented a FIR-filter on a STM32L053.
Running at 32 MHz there was plenty of spare time waiting for the next sample
at a sample rate of 1 kHz.
The filter was a minimal phase 256 tap FIR calculated with gods (matlab) help.


Best Regards
Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 972

Thank You
-Given: 230
-Receive: 959



« Reply #8 on: September 26, 2016, 09:54:45 21:54 »

Hello Sideshow Bob,
i would assume that the filter is used in a graphical device for medical purposes.
So i expected that 12 bit should be sufficient. But who knows :-).
And since it starts at 0 Hz i would estimate that it should DC-coupled.
I know that some TI Codecs on other TI-DSP-boards allow this, but i would not
be sure that this is always the case.
This is an ECG project. But I do not know any more than that. I have looked at the schematics for board. And yes the stereo codec input is AC coupled. That is for sure not ideal in many ECG projects. But well let us solve one problem at the time. The AC coupling is quite simple so it may bypassedfor this project and restored later
Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
Gallymimu
Hero Member
*****
Offline Offline

Posts: 704

Thank You
-Given: 151
-Receive: 214


« Reply #9 on: September 28, 2016, 02:13:47 02:13 »

I think it would be unusual to DC couple an ECG measurement.  There is no valuable information in the DC and it really causes problems (i.e. saturation) if not AC coupled.  This is one of the reasons many ECG systems use what is called a "right leg drive" which drives a small current to zero out the offsets in the isolation amplifiers (this is generally used in a mains connected ECG).

Here is a reference that indicates typical bandwidth of 0.5 to 100Hz.

http://www.analog.com/library/analogDialogue/archives/37-11/ecg.html
Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 972

Thank You
-Given: 230
-Receive: 959



« Reply #10 on: September 28, 2016, 03:36:45 15:36 »

The RLD is a tool in the toolbox to improve common-mode rejection in ECG. The ECG amp shown in your paper is still DC coupled per common definition of DC coupling. In Medical Instrumentation Application and Design, 4th Edition. John G. Webster. The recomandation for ECG is 0.01 to 250 Hz. But 0.5 to 100Hz may be good enough for say a bedside monitor. And if you only are looking for say extracting heart rate. AC coupling with corner frequency found in say sound cards does not matter
Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
Gallymimu
Hero Member
*****
Offline Offline

Posts: 704

Thank You
-Given: 151
-Receive: 214


« Reply #11 on: September 29, 2016, 04:46:49 04:46 »

And if you only are looking for say extracting heart rate. AC coupling with corner frequency found in say sound cards does not matter

If I wasn't clear... that was kind of my point Cheesy
Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 972

Thank You
-Given: 230
-Receive: 959



« Reply #12 on: September 29, 2016, 10:33:52 10:33 »

If I wasn't clear... that was kind of my point Cheesy
By all means Wink, but maybe we should leave the scene to the original poster. He has been surprising absent recently
Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
GroundPlaneLoop
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 3
-Receive: 13


« Reply #13 on: September 14, 2017, 09:47:48 21:47 »

Maybe a little off topic, but the dspic runs really hot. It has some dsp instructions, a possibility to map a ram section to flash area, but mostly they are obscure architecture with 3byte wide instruction, strange addressing - data bus is 16 bit, instruction has 24bit, which makes problems with hex files, usually there is one extra zero byte to have a 32bit instruction....i wrote a python module for the disassembler ida, and it was pretty hard to understand the logic of this dspic30 series. To me it looks more like a normal MCU with some DSP instructions.

Regarding filters, there are tools which generate C include files with coefficients, or even the whole source code. I heard Matlab toolboxes can do it.
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC