electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
microchip compiler and other issues
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [25 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sat Oct 04, 2008 3:07 pm    Post subject: microchip compiler and other issues Reply with quote  Mark this post and the followings unread

Holy Jebus, you mean the Microchip C compiler costs $$$$? Aww, man, that really throws a kink in the works of my project. Can you program in assembler on the dsPICs? I really want to use a dsPIC, and I don't mind bit-banging the dang thing if I have to.


[this was split off by Blue Hell from http://electro-music.com/forum/post-208815.html]

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sat Oct 04, 2008 3:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

Sure you can program in assembly, that's what the C compiler does as well Wink
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sat Oct 04, 2008 3:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

II meant, can you program in assembly for free. Sheesh, I'm a wreck. I just got out of the hospital. Again. Heart problems. Man...
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
okvern



Joined: Feb 05, 2008
Posts: 78
Location: Seattle, Washington
Audio files: 5

PostPosted: Sat Oct 04, 2008 3:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Inventor,

I think the answer is...it depends. You can get some of the C compilers for free, for limited periods of time. Other seem to be free with certain development/evaluation boards. My experience is that whichever version for whichever chip/family I'm currently interested in is not the one I currently have available--and that to get the one I need, I have to shell out several hundred dollars. This might be my fault--when I look at the pages that are supposed to tell me which compiler I need, the words "labyrinthine," "Byzantine," and "downright confusing" come to mind.

Next, the IDEs are not without their problems, even in Windows XP (the Windows version they currently claim to support). Yesterday, I tried to install the modules for the dsPIC evaluation board I bought, and the installer fsck3d my system so badly I had to use System Restore to get back to something like sanity. And, of course, they're not cross-platform.

It's not quite as bad as the CNC machine vendors who expect you to run in MS-DOS (hello? 21st Century?), but it's not far from it.

On the other hand, when you do find the version you need, and you do manage to get it to install, it seems to work pretty well. My experience wth the PICKit 2 was painless.

Thanks,

Ole
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sat Oct 04, 2008 3:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

Oh, and there is a "student version" of course, and that one is free but limiteds. Assembly level programming is free as well.

Sorry to hear about your heart trouble, is it angina or don't they know yet?

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sat Oct 04, 2008 3:24 pm    Post subject: Reply with quote  Mark this post and the followings unread

Indeed the IDE is not flawless, I posted some pretty pissed ticket messages last week, but this was related to the ICE 4000 .. that thing sucks.
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sat Oct 04, 2008 3:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
Oh, and there is a "student version" of course, and that one is free but limiteds. Assembly level programming is free as well.

Sorry to hear about your heart trouble, is it angina or don't they know yet?


I've had atrial fibrillation for some time, meaning that my ticker goes tock-tickity-tick-tock instead of tick-tock-tick-tock, which is not too bad. But now they found congestive heart failure, or CHF, which means that one side doesn't pump as hard as the other side. Now I've got to quit my sins and lose weight or else. Can't even have a dang cup of coffee. Sheesh, the party's over man. The good news is you can recover from it with lifestyle changes.

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sat Oct 04, 2008 3:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks, okvern, that was um confusing. lol. Do you have trouble with the assembly utilities? Do the linux tools support dsPICs?
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
okvern



Joined: Feb 05, 2008
Posts: 78
Location: Seattle, Washington
Audio files: 5

PostPosted: Sat Oct 04, 2008 3:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Inventor,

As Blue Hell says, assembler is free. I've had no problems with it, but the extent of my involvment is downloading other people's code. I haven't tried any Linux tools for either AVR or PIC.

Sorry my note was confusing, but...it's a confusing topic!

I'm also interested in the dsPIC, and I'll let you know what I find as soon as I'm brave/stupid enough to try installing the IDE and examples again.Smile

Thanks,

Ole
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sat Oct 04, 2008 4:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

OK okvern, maybe we can compare notes on dsPICs. Right now I'm a bit of a mess but I'm trying to make sense of the I/O of the thing so I can make a PCB CAD symbol for one of them and then put it on a little circuit board.

It needs a 3.3 volt supply so I have to provide that and it has a reference voltage input, presumably for the ADC. I want to use all six analog inputs and all of the PWM outputs.

This is going to take some time and i have to calm down from my hospital adventure before I can even concentrate, but I will get it done. Anyway, let me know how the software side goes and I'll keep you posted on the hardware side, K?

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
okvern



Joined: Feb 05, 2008
Posts: 78
Location: Seattle, Washington
Audio files: 5

PostPosted: Sat Oct 04, 2008 5:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Inventor,

By all means take it easy! I'm sorry to hear about your troubles. Hang in there--you're clearly brilliant, and we need as many of you as we can get.Smile

You can find Eagle CAD libraries for most of the dsPIC line at the Eagle site. Even if they don't have exactly the chip you want, it'll probably be easier to modify an existing symbol/package than making a new one from scratch (note that this is not always true!).

Thanks,

Ole
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sat Oct 04, 2008 5:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ole, I tried to load the dspic library as well as microchip-2.lbr thru microchip-5.lbr. They don't load or use or anything. When I double-click on one of the files, a blank library shows up. Are these libraries incompatible with version 5?
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
okvern



Joined: Feb 05, 2008
Posts: 78
Location: Seattle, Washington
Audio files: 5

PostPosted: Sat Oct 04, 2008 6:42 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Inventor,

No idea about compatibility with v. 5 of Eagle--I'm still on 4.11.

But libraries usually need to be put in the folder with the other libraries and then opened from within the Eagle main screen. I'm not sure I've ever just opened a library with File>Open.

Eagle is weird, there's no way around it. But I've found that its power/flexibility/ubiquity is worth putting up with the weirdness.

Thanks,

Ole
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sat Oct 04, 2008 7:52 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ole,

I put the libraries in the library folder and used Library/Use and Liibrary/Open as well as double clicking on them to no avail. Must be an incompatibility with version 5. That's OK, I need to figure out how to make parts anyway. I still have to read up some more before doing that though. This dsPIPC part has funky stuff like an external voltage reference and an on-chip core logic 2.5V regulator that needs an external low-esr cap, so it's not quite so stand-alone as earlier PICs.

Les

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
okvern



Joined: Feb 05, 2008
Posts: 78
Location: Seattle, Washington
Audio files: 5

PostPosted: Sun Oct 05, 2008 12:24 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi Les/Inventor,

I'd still look around for Eagle info about converting libraries from previous versions. They usually provides scripts for this sort of thing. I guess I'll have to face it eventually--but, for now, 4.11 is working just fine for me.

Thanks,

Ole
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sun Oct 05, 2008 9:15 am    Post subject: Reply with quote  Mark this post and the followings unread

OK friends, here's the latest deal. I'm making a single-dsPIC board and I've figured out that I need a 5V to 3.3V regulator for the power and a tantalum 4.7 uF cap for the on-chip 2.5V core regulator. Great.

Now I need to add In-Circuit Programming, which I gather also functions as In-Circuit Debugging. It's a five-pin interface but I cannot figure out the pinout of the header and if the header is keyed. I have downloaded the PIC datasheet and the Flash programming guilde and the other Flash guide, all three, but none of them sports a header pinout!

Also, I can't find anywhere in the docs a mention of what voltage the ADC Vref should be? is it 1.2V?

Thanks in advance.

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sun Oct 05, 2008 10:19 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
It's a five-pin interface but I cannot figure out the pinout of the header and if the header is keyed.


wI think this is unspecified ... When you want to be compatible with something, like the ICD2 or the real ICE ... those use an RJ12 connector (see 51331C.pdf), but that's kind of large on a small PCB ... so I'd just go for a 5 pin pin header ... when you want to know more about this lookup the real ice and icd2 development tools at the MicroChip site.


Quote:
Also, I can't find anywhere in the docs a mention of what voltage the ADC Vref should be? is it 1.2V?


Vref should be not higher than AVss and not lower than AVdd, AVdd and AVss should be the same value as Vdd and Vss. Just pick a reference voltage within that range as you see suitable. Maybe use a 2.048 V reference thingie, or you can leave it out altogether when you don't need the precision - VRef+ can be set to AVss by software and VRef- likewise to AVdd.

For voltage references see : http://focus.ti.com/docs/prod/folders/print/lm4040a20.html for instance.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sun Oct 05, 2008 1:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

Jan! You are da man, always a great answer from you! Now puzzle me this one:

The analog inputs are clamped to Vdd and Vss with 0.3V diodes on this part. By the way on this 18 pin part, there are no separate AVdd and AVss pins, they must be tied together internally. K, so my system can have larger signals than 0V to 3.3V, in fact they are AC coupled from opamps with 5V supplies and there is always the possibility that +/-12V will one day be added to the system.

So, to protect the input clamping diodes, I'm putting 10 kOhm resistors in series with the inputs and to bias the inputs, I'm putting 1M Ohm divider resistors from Vdd to ground. Should I clamp with Schottky's or 3.3V Zeners? ?The Zener clamping is unorthodox and backward but would work. The Schottky's I'm embarrased to say I forget if they will clamp to 0.3V or not. What would you do?

Thank you and all who are answering my various questions about this project around the forum, together we are making it happen! Coolness.

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sun Oct 05, 2008 2:07 pm    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
So, to protect the input clamping diodes, I'm putting 10 kOhm resistors in series with the inputs and to bias the inputs, I'm putting 1M Ohm divider resistors from Vdd to ground. Should I clamp with Schottky's or 3.3V Zeners? ?The Zener clamping is unorthodox and backward but would work. The Schottky's I'm embarrased to say I forget if they will clamp to 0.3V or not. What would you do?


Schottky clamps at around 0.3 V, might be a bit less for low power types and more for high power types.

Be careful with series resistance for the analog inputs as these inputs need to charge an internal capacitor, I think that for full speed you should not make the resistor larger than 2k5 (it's mentioned in the data sheets, probably in the ADC section). Larger resistors are possible but you'd need longer charging times and so will end up with slower conversions. It might be a good idea to add some buffering before the analog ins to be able to go into the controller with low impedance.

Re. 3v3 zeners, low voltage zeners tend to be soft, be sure to look up the V/I curve of those before putting 'm in.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sun Oct 05, 2008 2:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

OK, Jan, I'll use 1k Ohm resistors and Schotky diodes! Thanks!
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sun Oct 05, 2008 3:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

I found the document that describes the 5 pin header, it is: 30277d.pdf, In-Circuit Serial Programming (ICSP) Guide. Figure 1 on page 13 shows the pinout and get this... it needs a little RC and diode action to make it work right. I was just going to hook up the pins and hope for the best. It's good that I'm going slow and doing this step by step. Hoooooyaaa....
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sun Oct 05, 2008 4:42 pm    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
... it needs a little RC and diode action to make it work right. I was just going to hook up the pins and hope for the best. It's good that I'm going slow and doing this step by step. Hoooooyaaa....


Cross check it with the actual device data sheet ... Especially when you want to combine ICSP and normal I/O on the ICSP pins things can be tricky. Reset can have issues as well as some devices want a programming voltage above Vcc, maybe not the dsPIC though, not sure, they're all different there. Anyway, I've had ICSP trouble a couple of times ... the scope is your friend then ... when you didn't fry the part Wink (PICs generally are pretty robust and forgiving BTW).

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sun Oct 05, 2008 5:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

OK Jan, I will triple check it all. Below is a schematic of the current design. It has four analog ins and for digital outs. I'd appreciate comments and corrections, don't worry I won't be insulted if you make me look like a doofus! Haha, all I want is for this thing to werk properly!


PIC_1_sch.jpg
 Description:
First EChucK dsPIC board!
 Filesize:  73.14 KB
 Viewed:  357 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

PIC_1_sch.jpg



_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sun Oct 05, 2008 6:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

Can't really read the diagram's processor pin functions, some thoughts anyway ...

- why AC coupling, this would be interesting for DC/control rate processing maybe even more than for audio rate.

- DC / control rate processing would like a good Vref probably

- Audio rate processing would need a good time base, but you use no XTAL.

- maybe a port would be nice to be able to do run time parameter changes, but it would complicate the software of course.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Sun Oct 05, 2008 6:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
Can't really read the diagram's processor pin functions, some thoughts anyway ...

- why AC coupling, this would be interesting for DC/control rate processing maybe even more than for audio rate.

- DC / control rate processing would like a good Vref probably

- Audio rate processing would need a good time base, but you use no XTAL.

- maybe a port would be nice to be able to do run time parameter changes, but it would complicate the software of course.


Jan, you're brilliant! Why AC couple things at all? I will get rid of all the caps.

I can add Vref, would lose two inputs for that though.

Those two unused pins are the clk pins, so I'll add an xtal.

A digital port will happen later, for now it just wants to be a sinosc or a multiplier or whatever.

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [25 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
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
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use