electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
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 
Live streaming at radio.electro-music.com

  host / artist show at your time
  Rob Adventures in Sound
Please visit the chat
 Forum index » DIY Hardware and Software » Thomas Henry designs
PICs Anyone?
Post new topic   Reply to topic Moderators: Scott Stites
Page 1 of 2 [28 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 129
Location: N. Mankato, MN

PostPosted: Fri Nov 02, 2012 4:52 pm    Post subject: PICs Anyone?
Subject description: Powerful Compiled Basic at Your Disposal
Reply with quote  Mark this post and the followings unread

Hi gang,

If you've ever wanted to program PIC microcontrollers easily and without breaking the bank, then be sure to see my new article in the November issue of Nuts & Volts. In it I show you how to set up a compiled Basic system which is not only inexpensive (free if you avoid the ethics) but extremely powerful.

This is a lead-in for a whole new series of PIC based projects for music, should you wish to get a head start now.

Thomas Henry
Back to top
View user's profile Send private message
Dan Lavin



Joined: Nov 09, 2006
Posts: 620
Location: Spring Lake, Mi, USA
Audio files: 21

PostPosted: Fri Nov 02, 2012 4:59 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thomas, yeah I got my issue earlier this week. Fortunately my work pays for me to read it! Looking forward to more PIC projects!
_________________
Synth DIY since 1977!
Back to top
View user's profile Send private message
fonik



Joined: Jun 07, 2006
Posts: 3759
Location: Germany
Audio files: 23

PostPosted: Sat Nov 03, 2012 3:53 pm    Post subject: Reply with quote  Mark this post and the followings unread

hey, i just subscribed for 20USD/year with full access to all backissues!? that's awsome. should have done it earlier...

now going to read your new article, thomas.

_________________
Posted Image, might have been reduced in size. Click Image to view fullscreen.
cheers,
matthias
____________
fonitronik at
FlickR (pix) / SoundCloud (sounds) / YouTube (vids) / Vimeo (vids) / facebook (news)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DES



Joined: Feb 28, 2003
Posts: 682
Location: New Jersey
Audio files: 6

PostPosted: Sun Nov 04, 2012 11:26 am    Post subject: Reply with quote  Mark this post and the followings unread

Me too! Good deal...looking forward to catching up. I haven't read NV in quite a while.
_________________
Dave
www.davesneed.com
www.myspace.com/desneed
Back to top
View user's profile Send private message Visit poster's website
State Machine
Janitor
Janitor


Joined: Apr 17, 2006
Posts: 2747
Location: New York
Audio files: 24

PostPosted: Tue Nov 06, 2012 5:42 am    Post subject: Reply with quote  Mark this post and the followings unread

Just got my issue yesterday !! Looks great and very complete. Good alternative to paying lots of cash for Pic Basic OR Pic Basic Pro from ME Labs. Before I put my foot in my mouth, will have to read and decide. Wink

Bill
Back to top
View user's profile Send private message Send e-mail
fonik



Joined: Jun 07, 2006
Posts: 3759
Location: Germany
Audio files: 23

PostPosted: Wed Nov 07, 2012 3:26 am    Post subject: Reply with quote  Mark this post and the followings unread

i am really looking forward to see what thomas makes out of it. i would have thought that Basic is not that effective for PIC, since it would create more code than Assembler or even C - and the memory of a PIC is limited!?
_________________
Posted Image, might have been reduced in size. Click Image to view fullscreen.
cheers,
matthias
____________
fonitronik at
FlickR (pix) / SoundCloud (sounds) / YouTube (vids) / Vimeo (vids) / facebook (news)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4759
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Wed Nov 07, 2012 3:59 am    Post subject: Reply with quote  Mark this post and the followings unread

Yeah, but the PIC stuff I've done used compiled basic, which means you had to bounce it through two conversion programs, and then it was written as assembly to the PIC. Of course you could edit it as HEX just before it got sent down the serial port to be flashed, if you were into that sort of thing. Most HEX that I've edited, I didn't understand. Not that I couldn't, just that my attention span was never great.
I've only got an old 16F84, and some very specific programmer, but I'm sure there are heaps better everything now. (My PIC experience is way back in 2004! Almost a decade is an eternity with this stuff! Rolling Eyes )
Still, it would be nice to create a strange noise with anything these days. Laughing (does that sound a bit desperate?!? Laughing )
I'll be watching very closely, and getting itchy fingers no doubt. Twisted Evil

Maybe I could pull out that old PIC and get it to do something! It's got two analogue In/Outs and about 8 digital. You can program the analogues to be digital if you want. Cool
I can say right now that I've got a big job with the Nexus 1 on the slab at the moment, and Frankie is vying for attention too, so this is probably just a pipe dream. Embarassed

_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
fonik



Joined: Jun 07, 2006
Posts: 3759
Location: Germany
Audio files: 23

PostPosted: Wed Nov 07, 2012 4:22 am    Post subject: Reply with quote  Mark this post and the followings unread

can someone help me getting the syntax files? the link in the article directs me to nuts&volts main page. there i am lost... Embarassed
_________________
Posted Image, might have been reduced in size. Click Image to view fullscreen.
cheers,
matthias
____________
fonitronik at
FlickR (pix) / SoundCloud (sounds) / YouTube (vids) / Vimeo (vids) / facebook (news)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
elmegil



Joined: Mar 20, 2012
Posts: 1504
Location: Chicago
Audio files: 14

PostPosted: Wed Nov 07, 2012 7:16 am    Post subject: Reply with quote  Mark this post and the followings unread

If you go to downloads for the current month (Magazine -> Downloads from the main menu) it has a link to a zip file there, and the syntax and other files are in it.
Back to top
View user's profile Send private message
fonik



Joined: Jun 07, 2006
Posts: 3759
Location: Germany
Audio files: 23

PostPosted: Wed Nov 07, 2012 7:33 am    Post subject: Reply with quote  Mark this post and the followings unread

thanks.
i thought i would have to log into the digital publication Rolling Eyes

_________________
Posted Image, might have been reduced in size. Click Image to view fullscreen.
cheers,
matthias
____________
fonitronik at
FlickR (pix) / SoundCloud (sounds) / YouTube (vids) / Vimeo (vids) / facebook (news)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Thomas_Henry



Joined: Jul 24, 2009
Posts: 129
Location: N. Mankato, MN

PostPosted: Wed Nov 07, 2012 11:48 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi all,

I just got done with a huge project and had no trouble with memory. In fact, I was left with 300 words of program space and some 200 bytes of RAM unused.

The truth of the matter is that GC Basic does a very good job of compiling the code. I always take a look at the compiled code before assembling it and marvel at how efficiently the compiler has arranged things. It uses very sophisticated algorithms to rearrange the code in memory.

May I recommend the PIC16F88? There's hardly a thing that can't be done with it and I'd be very surprised if memory was ever an issue.

By the way, my big project included MIDI, and was a hybrid analog/digital design. The code was 900 lines of source and 3800 bytes compiled and assembled. There was more than enough room for some 20 LCD menus. The article describing it has just gone to Nuts & Volts; I'm waiting to hear if it was accepted.

So anyway, GC Basic is actually a very good language, I think.

Thomas Henry
Back to top
View user's profile Send private message
mrmrshoes



Joined: Feb 19, 2011
Posts: 73
Location: Newcastle Upon Tyne
Audio files: 4

PostPosted: Wed Nov 07, 2012 1:57 pm    Post subject: Reply with quote  Mark this post and the followings unread

This stuff sounds really promising and is defos something i want to get into.
Can't wait to see what projects you come up with in the further.

One thing that is holding me up is figuring out what programmer to buy.

Can anyone recommend or talk about a cheap and reliable USB (windows 7) type.

thanks alot

shoes
Back to top
View user's profile Send private message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 129
Location: N. Mankato, MN

PostPosted: Wed Nov 07, 2012 5:10 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi Shoes,

My first programmer was very expensive (the school paid for it though) since it was actually a very complete trainer in addition. My next one was cheaper, but very slow.

But just last week I finally got the one I love:

http://www.sureelectronics.net/goods.php?id=1141

Here's the deal. This will program any PIC, and also comes with a universal ZIF socket. It really works great for me and is extremely fast. Note that this currently is on sale with free shipping from Hong Kong. It took about two weeks to arrive.

So, that's the one I'll be using from now on.

Thomas Henry
Back to top
View user's profile Send private message
wmonk



Joined: Sep 15, 2008
Posts: 489
Location: Enschede, the Netherlands
Audio files: 13

PostPosted: Thu Nov 08, 2012 4:13 am    Post subject: Reply with quote  Mark this post and the followings unread

That's a great deal. I've been using the original PicKit 2 for a while now, and while it works fine, I had some troubles setting it up with the newer PICs. And it works from Linux too, which can be an issue to some Wink

I like the 16F88 too, not many PICs that cheap with those ADCs.

How's setting up a project with the BASIC? For Assembly and C it can be quite a PITA, getting all configuration words the way they need to be.

_________________
Weblog!
Back to top
View user's profile Send private message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 129
Location: N. Mankato, MN

PostPosted: Thu Nov 08, 2012 4:55 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi everyone,

Yeah, this unit is a hellacious bargain. There are several easy mods you can render to make it perfect.

First, the three layers of plexiglass are really beautiful, but too tight for larger fingers to navigate. I disassembled the layers and reassembled to two layers only with no protruding standoffs. This won't make sense until you actually get the unit, but only takes a minute to do. Attached is a photo showing the result.

Next, it's easy to forget the orientation of the PIC, so I put little white "ones" on the ZIFs showing where pin 1 is in all cases. You can see them in the photo if you look carefully.

The instructions don't mention it, but the unit has been wired to work with 8, 14, 18, 20, 28 and 40 pin PICs, not just the three sizes shown. You just have to know how to plug the chips in. I made a decal showing the placement, and attached it to the bottom of the unit. The second photo shows that. I've also included my artwork for the decal, below.

With regard to setting config bits, it's completely painless in Great Cow Basic. First, the compiler is very sophisticated in that it examines your code and tries to anticipate which bits should be set. It's almost always correct! But you do have the option of overriding this if needed, and don't have to learn any weird syntax. Trust me, you'll never give it a second thought. As an example, here's a program to flash all 8 LEDs on Port B. Notice how quick the setup is:

Code:
;A program to blink eight LEDs on Port B once a second,
;this time with a 4 MHz clock.

#chip 16F88, 4          ;PIC16F88 running at 4 MHz
#config mclr=off        ;reset handled internally
#config osc=int         ;use internal clock

;************************ Constants ************************
#define LEDs PortB      ;LEDs are on all 8 Port B pins

;************************  Program *************************
pgm:
  dir LEDs 0b00000000   ;make all Port B outputs
 
  main:
    LEDs = 0b11111111   ;turn LEDs on for 1/2 second
    wait 500 ms

    LEDs = 0b00000000   ;then off for 1/2 second
    wait 500 ms
  goto main             ;repeat in perpetuity
end


I'm telling you, this compiler is great!

Oh, almost forgot, I also glued some rubber feet to the unit.

Thomas Henry


IMG_1398.JPG
 Description:
Bottom side
 Filesize:  174.4 KB
 Viewed:  4389 Time(s)

IMG_1398.JPG



IMG_1397.JPG
 Description:
Top side
 Filesize:  319.74 KB
 Viewed:  58 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

IMG_1397.JPG



Decal.pdf
 Description:
Decal

Download
 Filename:  Decal.pdf
 Filesize:  37.42 KB
 Downloaded:  56 Time(s)

Back to top
View user's profile Send private message
bubzy



Joined: Oct 27, 2010
Posts: 555
Location: United Kingdom
Audio files: 62

PostPosted: Fri Nov 09, 2012 12:33 am    Post subject: Reply with quote  Mark this post and the followings unread

a word of warning to anyone who clicks without reading....
make sure you click the preferred subsciber button if you want access to back issues. i neglected to do this and didnt have access, thankfully, the people at nuts and volts are very helpful and amended this for me, so its not 100% critical, but it might save some days of headscratching. (maybe i should just read before i click?)
but $19.99 a year?! ... awesome

_________________
_Richard_ Smile
Back to top
View user's profile Send private message
mrmrshoes



Joined: Feb 19, 2011
Posts: 73
Location: Newcastle Upon Tyne
Audio files: 4

PostPosted: Fri Nov 09, 2012 4:36 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks alot TH

That's a great find. Awesome deal to boot. I'll have to order one this weekend.

By the way, thank you for all your help, circuits, books and articles. Wink


shoes
Back to top
View user's profile Send private message
Thomas_Henry



Joined: Jul 24, 2009
Posts: 129
Location: N. Mankato, MN

PostPosted: Fri Nov 09, 2012 2:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi all,

Would anyone do me a favor, please? If you successfully set up the IDE described in the article, would you leave a note here indicating so? Thanks. A reader contacted N & V saying that some files were missing and he couldn't accomplish the task. I checked again, and everything seems to be there. I'd simply like a different set of eyes to confirm the article and files are complete.

Thanks for your help,

Thomas Henry
Back to top
View user's profile Send private message
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4759
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Fri Nov 09, 2012 5:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thomas_Henry wrote:

May I recommend the PIC16F88? There's hardly a thing that can't be done with it and I'd be very surprised if memory was ever an issue.
Thomas Henry


So far I've found out that the 16F88 is an enhanced version of the 16F84A. Still 8bit, still 18pin. (The 16F88 is actually 65cents cheaper) Depending on how it is enhanced, at the very least, if I got the old programmer up and running, I'm sure I could knock something up, and the coding would have to be very similar, no? So I could probably still try out the same sort of stuff. Maybe shift to the 16F88 once I've used this lonely old 84A. Cool
Playing around with both could only add to the fun I s'pose! Laughing

_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
Thomas_Henry



Joined: Jul 24, 2009
Posts: 129
Location: N. Mankato, MN

PostPosted: Sat Nov 10, 2012 2:51 am    Post subject: Reply with quote  Mark this post and the followings unread

Hello Uncle Krunkus,

If memory serves me, the only difference between the 84 and the 88 is the lack of the built-in USART; everything else should be the same.

So, apart from MIDI, you ought to be able to do every thing else.

Great Cow should treat it the same, apart from the USART. So, start some experiments...It's fun...

Thomas Henry
Back to top
View user's profile Send private message
fonik



Joined: Jun 07, 2006
Posts: 3759
Location: Germany
Audio files: 23

PostPosted: Sun Nov 11, 2012 7:10 am    Post subject: Reply with quote  Mark this post and the followings unread

Thomas_Henry wrote:
Hi all,

Would anyone do me a favor, please? If you successfully set up the IDE described in the article, would you leave a note here indicating so? Thanks. A reader contacted N & V saying that some files were missing and he couldn't accomplish the task. I checked again, and everything seems to be there. I'd simply like a different set of eyes to confirm the article and files are complete.

Thanks for your help,

Thomas Henry

today i tried to set up everything.

the first thing i recognizes was that the GCBASIC.bat and the MPASM.bat files have the .txt extension in the NV download. i bet the renaming is due to security issues!?
then, i cannot rename Gcbasic to GC Basic Compiler in the Configure/Preferences/Tools sub-menu. There is no renaming command (i.e. via right mouse button). I am running TextPad 6.3 on a 64bit system.
i cannot read the text in the screenshots 3 to 5 very well., it is very blurry:
/o:$BaseName.asm /k:a /np $file in screenshot 3?

otherwise it seems to work quite fine. i did not install the pickit, though.

_________________
Posted Image, might have been reduced in size. Click Image to view fullscreen.
cheers,
matthias
____________
fonitronik at
FlickR (pix) / SoundCloud (sounds) / YouTube (vids) / Vimeo (vids) / facebook (news)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Thomas_Henry



Joined: Jul 24, 2009
Posts: 129
Location: N. Mankato, MN

PostPosted: Sun Nov 11, 2012 10:10 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi again,

To rename the tool in the menu you mentioned above, click once and then click again. (Don't do a fast-double click, though).

Here are the parameters:

/o:$BaseName.asm /k:a /np $File

The help file in TextPad is very good about explaining these.

Thomas Henry
Back to top
View user's profile Send private message
fonik



Joined: Jun 07, 2006
Posts: 3759
Location: Germany
Audio files: 23

PostPosted: Sun Dec 02, 2012 12:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

i still get an error message from textpad when trying to start MPASM. i installed the current MPASM version X (mpasmx) on my 64bit system...

alas, i don't have much time these days, so i can try things only now and then...

anyways, thomas, i sent you PM Very Happy

_________________
Posted Image, might have been reduced in size. Click Image to view fullscreen.
cheers,
matthias
____________
fonitronik at
FlickR (pix) / SoundCloud (sounds) / YouTube (vids) / Vimeo (vids) / facebook (news)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Thomas_Henry



Joined: Jul 24, 2009
Posts: 129
Location: N. Mankato, MN

PostPosted: Mon Dec 03, 2012 9:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hello Fonik,

Unless you really need MPLab X for more advanced PICs, you probably ought to avoid it. Version 8 gets much more favorable reviews for speed, stability and ease of use. Anyway, I assure you, TextPad can easily use the assembler.

And, I haven't received any PM's.

Thomas Henry
Back to top
View user's profile Send private message
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20615
Location: The Netherlands, Enschede
Audio files: 148
G2 patch files: 318

PostPosted: Tue Dec 04, 2012 4:22 am    Post subject: Reply with quote  Mark this post and the followings unread

Thomas_Henry wrote:
Unless you really need MPLab X for more advanced PICs, you probably ought to avoid it. Version 8 gets much more favorable reviews for speed, stability and ease of use.


Or more in general, once you have a working MPLab, do not "upgrade" unless absolutely needed, Microchip manages to break at least something with every new release. I've ended up making a lot of workarounds for that over the years (one of them was making my own macro pre-processor).

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Scott Stites
Page 1 of 2 [28 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Thomas Henry designs
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
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


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