Electronics > Beginners
Gooligum? Advice for a PIC novice
Buriedcode:
I'm unsure why others are talking about assembly. The instruction set for low to mid-range PICS is probably the easiest to learn of all micros, plus it makes a fair bit of sense. But I think learning assembly would probably be a waste of your time - go straight to C.
I coded in assembly for a few years (over a decade ago) whilst most had moved on to C, and yes, in some ways assembly produces small, and faster code, but there isn't much of a difference and it only matters when you are doing extremely fast things (in which case there are faster and cheaper micro's to use) or running out of program space (in which case there are cheaper micro's.. with more flash!).
I mean, assembly is still "programming" and probably a bit more intimate with the hardware but I don't think it will 'help' you in any way. Although those tutorials look as good as any other, I found the best way to learn a micro is to think of several projects, ones I don't know how to do, and get started. Especially something useful and cool - something you can actually use! Something with inputs and outputs etc..
Ian.M:
The Read-Modify-Write effect is still a problem for any PIC that doesn't have accessible LATx registers (Baseline 12 bit core, and original Midrange 14 bit core). XC8 and most other C compilers don't do anything to mitigate the effect - coding shadow registers is almost invariably left to the user. See RMW and solutions for it
If you cant code in assembler, you have no way of determining the cause of unexpected failure of your C code. You can test the algorithm on another platform, and when it works there but not on a PIC, you will be at a dead loss. If you understand assembler, you can inspect the listing file or the disassembly to determine what code is being generated for a particular line of C and why it is misbehaving. Either you will discover the unjustified assumption you have made or you may find you have run into a limitation of the compiler or hardware. Very rarely you may discover a hardware fault or compiler bug and once in a blue moon, it will be a new reproducible silicon or compiler bug that you should report.
You don't have to be fluent in assembler, but you should know the instruction set welll enough to be able to sight-read a listing without having to look up individual instruction behaviour, and familiar enough with common techniques that you don't have to puzzlew them out with pencil and paper to understand them. The easiest way of developing the required competence is to work your way through the Gooligum assembler tutorials and code some small projects of your own. Then for %DEITY%'s sake switch to C - its a much more profitable use of your time . . . .
jpanhalt:
--- Quote from: jamie297 on June 01, 2017, 08:09:36 am ---Short version:
- How do you rate Gooligum dev board and tutorials?
--- End quote ---
They are good. The only reservation I have is he switches to Relocatable code rather early on. Many Assembly programs use Absolute for most everything. (Let's not add that discussion to well worn C vs. Assembly discussion.)
--- Quote from: jamie297 ---- Are there any alternatives I should consider for a similar budget?
--- End quote ---
These are the two I used when I started:
http://www.amqrp.org/elmer160/lessons/
http://winpicprog.co.uk/pic_tutorial.htm
I particularly liked Elmer160. My only criticism of Nigel's tutorial is that he introduced a character (namely "$") without defining it first. A nit pick for sure. But, it does take time to find out what it means, if you are a complete novice.
Some advice: Don't try to follow multiple tutorials at the start hoping to get the best of each. Pick one and go with it, until you get blinking LED's and start writing your own project.
--- Quote ---- Should I hold off and learn basic C programming before getting the Gooligum stuff?
--- End quote ---
No comment. That argument is like solving the Gordian knot.
John
picandmix:
--- Quote from: jamie297 on June 01, 2017, 08:09:36 am ---
- How do you rate Gooligum dev board and tutorials?
- Are there any alternatives I should consider for a similar budget?
- Should I hold off and learn basic C programming before getting the Gooligum stuff?
Thanks for your wisdom :-+
--- End quote ---
Think I would suggest you start with Assembly code , it may seem complicated to look at now, but it is not difficult once you get started and the understanding of the micro system it gives you will always be useful for C or any other micro system/language.
Gooligum tutorials used to be free, but seems many are now chargeable, so as said, perhaps worthwhile looking for other free ones.
The dev board seems expensive, but if thats your thing, then also look at the MikroE boards.
You do not mention how you are with hardware ? can you solder, build circuits etc etc ? if so building your own basic dev board, either wired or pcb is possible.
Also no indication if you have any particular interest towards specific areas for applying a micro, like robotics, RF , comms, control etc.
Everyones different, but I usually find its easier to learn a new system if you have a project in mind.
Its surprising how much you can do on a breadboard with just a pic chip and a few components and wired to a 16x2 lcd.
Paul Price:
Learning assembly is a waster of time to learn C-language..it isn't C-language and much harder to decipher any code you write past the most simple of intention. Assembly is also specific to the device family and mfg. of the mcu your are working with and is thus learning so much is learning nothing if it is not-portable to another device.
You shouldn't waste a dime paying for a C-course, there are many free C courses available online that are excellent, you can also learn a lot just from Youtube vids.
If you wanted to learn how to ride a bicycle, I wouldn't ask you to first take a course in designing bicycle chains.
Get a solderless breadboard and a DIP PICC chip, something like a PIC16876A or PIC16F886 in a DIP socket you can plug into a breadbroad. This chip doesn't require you to learn complicated code to turn on and off a pin, no LAT required, when you turn a port pin on it only requires one instruction.
These two chips are very popular and their is much code published in C on the web and much more even to be found on Microchips forum, and if you need help, it is easy to get help and learn from others on many forums regarding these two popular chips.
The best way teacher is experience, and when you write some code in C to do something, like even detect a switch, debounce it and toggle the light of a LED, you can study the C-language, write the code, then compile and burn it to your chip and then is it so easy to check to see if your code is correct on a solderless breadboard in seconds.
Direct feedback between theory and practice is the most enjoyable way to learn.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version