Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Mahmood Elnasser
03/22/06 00:44
Read: 1608 times

#112758 - MPLAB
Responding to: Prahlad J. Purohit's previous message
Prahlad J. Purohit said:
Dear Kalpak,

Since Mr Kalpak was addressed I didn't reply. I also wanted to wait till post was moved here to the chat forum.
This is the wrong forum, my previous post was about AD9835 noise which is applicable to 8051 also and not any single question about dsPIC. But since forum members requested schematics, it was clear I was using dsPIC.

1. Are these dsPIC ISP. how do you program them? I will prefer a low cost home made sort of programmer to start with are there any?

Yes they are ISP programmable, otherwise how would you program a 64 or 84 pin surface mount packages. For the old pics I used to ISP using a free bootloader program which I downloaded from the internet ages ago. But for these dsPICs I bought the microchip ICD2 from farnell which was not very expensive. This is similar to ICE but uses internal resources of the dsPIC for debugging purposes. So it is half way in between the simulator or the complete in circuit emulator.
You can download schematics of the Microchip ICD2 and build it yourself at home and start download programs to the chip using MPLAB itself. but beleive you me, it works out much cheaper if you buy the original microchip ICD2 for it saves you plenty of time and works first time rather than waste your time for something that might or might not work.
I also bought a very cheap dspic development board to stand on my feet very quickly, all hardware is built correctly and I only have to worry about software, once I became confident with dsPICs I started building my hardware myself.

2. What are the development tools available for example compiler / assembler?

the only development tools I know of are MPLAB which you can download from microchip web site, it has a free assembler, simulator and ICD2 interface for debugging and programming, you can download a 2 months trial of microchip C30 compiler which is intended for the dsPIC families of DSC. I didn't have any problems with this C compiler what so ever although plenty of problems with the free tools as I will mention later.

3. How do you satart any links to tutorials or books etc?
I tried visting microchip website for above but couldnt find really useful info.
Prahlad Purohit

I think dsPICs are very complicated for beginners, they have new assembly language to learn, different flag and registers names and you have to get used to the long numbers for arguments since it is 16 bit processors.
The way to learn for free is as follows:
1. Download the datasheet of the device and read it, it is very dry and you can hardly use it to understand how to program the device.
2. download the dspic 30f family reference manual, it explains more about the dspic and their perriferals, agian it is not enough to teach you how to program the device for real world application.
3. Download all the dspic application notes, once you read 1 and 2 above carefully, you start learning how to use the beast and start getting the fruit of your hard work!.
go to web seminars section of microchip, and enjoy watyching free lectures how to use the free tools available such as MPLAB, simulator and visual device initializer.
The visual device initializer is a very wonderfull toolwhen it works! it is good tool for lazy people like me, I use it to initialize the pic without actually reading the datasheet, I just drag and drop the peripherals I need and initialize them visually. It then adds them to your project automatically and you just have to call visualinitialization() at the start of your program. It helps me alot for selecting things that need alot of calculations for example I need timer 1 to interrupt every 1msec, I just fill the boxes and click on calculate, it calculates the values I have to initialize registers automatically and fills them in.
problems with MPLAB:
As Erik says, most free tools are rubbish, no fast support for them and no guarantee what so ever that they are bug free.
The biggest problem I face with visual initializer is that once I use it for a project, every 3 or 4 uses I lose my visual initialization blocks. although the initialization function was saved so I can't modify it, have to restart again and try to remember what I did before to reinitialize my dspic.
another problem is that the visual initializer makes my mplab terminate ubnormally and I lose all my work, looks like it has severe memory problems which windows xp can't tolerate.
I have MPLAB v7.30 and 7.31 installed on 3 computers some of them have fresh windows xp and I get same problems on same computers meaning that the bug is in mplab software and nothing else.
I guess I could go to microchip forums and all this crap, but I'm busy with projects these days that I learned to go around bugs like this:
I use the visual device initializer and generate the code, read the actuall code generated and not save it to the project, just fill in the registers values in my code manually and problem solved.
Also some problems with the mplab simulator, some times it works, some other times it refuses to work for no apparent reason, some other times it works but refuses to show variables in functions, it says variable out of scope. I wonder why.
I think the new MPLAB is the best thing since sliced bread in theory it has so many powerful functions and tools but as I showed above it has so many bugs that makes all the effort done by microchip employees worthless.
But to be honest I can't complain because I get all these tools for free, although it is great for hobby jobs, but professionals need real good tools to work with and not riff raff.

List of 12 messages in thread
dsPIC      Prahlad J. Purohit      03/21/06 04:01      
   oops posted in general forum.      Prahlad J. Purohit      03/21/06 04:02      
      Off-topic      Andy Neil      03/21/06 05:58      
   Maybe...      Kai Klaas      03/21/06 08:49      
   MPLAB      Mahmood Elnasser      03/22/06 00:44      
      you got that right      Erik Malund      03/22/06 06:47      
      Thanks Mahmood.      Prahlad J. Purohit      03/23/06 22:08      
         hi prahlad      Saif Ullah Khalid      03/24/06 07:54      
      IAR      Mahmood Elnasser      03/24/06 09:56      
         Sorry for the delay..      Kalpak Dabir      03/24/06 10:06      
            Thanks Kalpak      Prahlad J. Purohit      03/25/06 22:37      
   WinPIC.      Prahlad J. Purohit      03/25/06 22:43      

Back to Subject List