Goblinz Posted September 24, 2007 Report Share Posted September 24, 2007 I'm wanting to learn about PIC programming. I have no coding experience other than a bit of SAS and a little bit of basic (started to learn as a kid in the early 90's). Can anyone suggest any online resources which are easy to learn from, there seem to be quite a few out there and I'm sure that some are better than others. What language would be best to start learning with? G Quote Link to comment Share on other sites More sharing options...
nILS Posted September 24, 2007 Report Share Posted September 24, 2007 I assume learning asm or C would be best suited for PIC programming. C is nice to know, since it is widely used and you might put your newly acquired knowledge to good use in a lot of other projects as well. ASM would be good, since it only has a really tiny number of commands to choose from, it's can pretty annoying since you get punished for every tiny mistake you make =)I'd probably start with a high-level language like C, C++ or ObjectPascal (Delphi IDE) or Java if I were you. There are great IDEs for all of these, they're fairly easy to learn (ObjectPascal probably even more than the others). And if you're familiar with one of them, learning another one is really not that big a deal, since they're all alike =)Just my opinion though. And now - don't stone me please, you ASM and C gurus - I like Delphi more than any other language :D Quote Link to comment Share on other sites More sharing options...
Rio Posted September 24, 2007 Report Share Posted September 24, 2007 you can start programming C for PIC too...First search in "MIOS programming" Subforum here... look after Threads about start programming or C Tutorial.. There you will find some hints/links about C Programming.For installing:If you work with Windows, best you install CodeBlocks (with install options described by stryd_one (look into Wiki and search after article codeblocks).Then you have to copy the c skeleton from TK. After that take a look in Menu ->MIOS->Functions (it's a describtion about functions of MIOS, which you can use in your code).PS: please post in e.g. MIOS programming next Quote Link to comment Share on other sites More sharing options...
stryd_one Posted September 24, 2007 Report Share Posted September 24, 2007 Whoops, we are now IN that subforum ;)Goblinz if you do decide to use Code::Blocks, give me a shout, and I will update the documentation first :) Some things have changed.... Nothing major, but enough to maybe throw you out on the first try... Quote Link to comment Share on other sites More sharing options...
bugfight Posted September 24, 2007 Report Share Posted September 24, 2007 I'd probably start with a high-level language like C, C++ or ObjectPascal (Delphi IDE) or Java if I were you. akkk! forget object pascal for pic (or any object oriented language for that matter)in pic land, there's little benefit to objects and nowhere near enough program space...java?! you have to be joking!c is what you want.btw, delphi used to be my favorite for windows programming, but now i'll take visualstudio first.(hmmm look who's running the ms c# team...) Quote Link to comment Share on other sites More sharing options...
DavidBanner Posted September 24, 2007 Report Share Posted September 24, 2007 c is what you seek!it's easy to pick up, especially as there are so many C apps to cut, paste and hack Quote Link to comment Share on other sites More sharing options...
Goblinz Posted September 25, 2007 Author Report Share Posted September 25, 2007 I'll look at C then. Is it a case of just learning C or do you need to learn C for the PIC, Just trying to get my head round it all at them moment. Untill discovering ucapps I thought that PICs had to be programmed in their own special programming language! TBH i'm not looking at learning it for midibox purposes to begin with as I feel that will be a long way off, I'm wanting to start on something very simple and then maybe I'll be able to consider working with MIOS stuff in the future. Stryd_one. I'm not even sure what code blocks are, I'm a complete newbie to this! I will be using windows so will probably be using codeblocks as asvised by Rio. No rush on updating the documentation as I've still got a long way to go, I think my first step will be building the PIC programmer as I need this for my midibox anyway. Thanks for the advice. G Quote Link to comment Share on other sites More sharing options...
stryd_one Posted September 25, 2007 Report Share Posted September 25, 2007 Well when you compile your C application, it generates code in PIC ASM - which is that special language you spoke of ;) Theoretically, C is the same for all platforms, although there are exceptions, and SDCC is one, although the basic syntax is the same, so if you learn C for your PC the knowledge will transfer to MIOS, no worries.Code::Blocks is an IDE, which is basically a text editor on steroids. It will do things like syntax highlighting and autocompletion to help you write the code, and will interact with GDB to help with debugging your application. Don't worry about what these things all are, you'll soon find out when they are helping you :) Quote Link to comment Share on other sites More sharing options...
Rio Posted September 26, 2007 Report Share Posted September 26, 2007 native C Code will be written on all plattforms in same way...so learn C with several c_tutorials in internet or books first...CodeBlocks IDE ( like Stryd_one mentioned ) can manage your projects, can administer your files and run the SDCC (Small Device C Compiler) to compile your sources to binaries (hex, bin), which you can upload on PIC later...To upload/run an application on your PIC, you will need a complete Core Modul, A LCD will be recommended.. and a MIDI-IN Port (MIDI-OUT for check) + a MIDI<->PC device to transfer data with programs like MIDI-OX or MIOS Studio from PC.Before you upload an programm, you need to upload MIOS first.Best Regards, Rio. Quote Link to comment Share on other sites More sharing options...
stryd_one Posted September 27, 2007 Report Share Posted September 27, 2007 run the SDCC (Small Device C Compiler) to compile your sources to binaries (hex, bin), which you can upload on PIC later...Just to avoid confusion... or maybe create it (doh) that's not completely true... You write your code (*.c) and then it is complied by SDCC to output PIC assembly (*.asm)Then the PIC ASM is assembled into object (*.o) files by GPASMThen the .o files are linked using GPLink to make HEX files. These have the exact data that will be burned into the PICs program memory.The the HEX files are converted to MIDIbox compatible SysEx (*.SYX). You only need this step if you are uploading by normal midi, most of the time these days we use the hex files with MIOS Studio, which converts them on the fly and also has the 'smart mode' to make uploading less error-prone.This whole process is automated for you, you just need to run make.bat and it takes care of the rest.If you use codeblocks, you can hit a button or keyboard shortcut, and it will run the make.bat for you. It also monitors the output of that script, so if SDCC finds an error in your code at line 99 column 10, it will automatically jump to the relevant file, and highlight the line with the error and tell you what's wrong with it (in a cryptic kind of way). As I say, don't worry too much about all this, you'll undoubtedly 'get it' as soon as you try it :) Quote Link to comment Share on other sites More sharing options...
Rio Posted September 27, 2007 Report Share Posted September 27, 2007 ;) Quote Link to comment Share on other sites More sharing options...
nILS Posted September 27, 2007 Report Share Posted September 27, 2007 I just started fiddling around with my arpeggiator app, and I have to say, if you have a running mbSID or any other mb with a big CS it's really nice for testing you app =) Quote Link to comment Share on other sites More sharing options...
cavey Posted September 28, 2007 Report Share Posted September 28, 2007 Get the C programmer's bible:http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)that will definately get you started with the C language :) Quote Link to comment Share on other sites More sharing options...
stryd_one Posted September 28, 2007 Report Share Posted September 28, 2007 The C Programming Language (sometimes referred to as K&R) is a well-known computer science book written by Brian Kernighan and Dennis Ritchie,Sometimes? I've never heard anyone not call it K&R ;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.