![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Hey, I would really like to move up in the micro department... I'd like to start using a higher level language now that I feel comfortable with assembly. Assembly is great; however, I feel it to be too tedious for larger projects. I would also like to start using a more recent line of PICs... So, 1) Can you recommend which PIC 18F chips I should try? 2) Can you recommend a higher level language for these new chips? (and provide EZ beginner tutorials) Thanks and CHEERS
__________________ "Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post 9vDC Guitar Pedal PSU PIC16F84a Game Module | |
| |
| | (permalink) |
| Hi Peter, I'd suggest the 18F2550 USB capable PIC... with a bootloader running you can download code via a USB cable to the PC. MPLAB's C18 compiler is well and truly good enough for learning purposes. I'd also suggest looking at the UBW here: http://greta.dhs.org/UBW as it has both a bootloader and firmware for experimenting that you can use as a skeleton for your own application. Sparkfun: www.sparkfun.com also sell the kit and pre-built forms of the UBW. P. | |
| |
| | (permalink) |
| Peter, since you're in Toronto you might want to drop by Creatron and pick up one of my Junebug kits Its got a USB programmer / debugger and a 18F1320 for learning (lights buttons etc...) | |
| |
| | (permalink) | |
| Quote:
After browsing about, I think I will stay with the 16F's for a little while longer... for my purposes they are fine! However, I cannot believe how great C programming is!!!! I tried out Proton Lite *TY Gramo*... and was amazed by the simplicity! (although it is more basic than C) Since I am a student, i am naturally broke... so buying a $100 dollar copy isnt going to happen... I then downloaded Hi-Tide and MikroC... I like both, but have choosen MikroC... its great! Although I am proficent in java and C# the syntax in C is tricky to adapt to! Please share some opinions if you'd like
__________________ "Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post 9vDC Guitar Pedal PSU PIC16F84a Game Module | ||
| |
| | (permalink) |
| The Microchip C compiler works with the 18F series PICs. The free version has some code optimizations missing which won't affect the hobbyist much.
__________________ --- The days of the digital watch are numbered. --- | |
| |
| | (permalink) |
| I'll have to second the Microchip C18 is the way to go. The 18F chips are really nice and not much more than an old 16F PIC. | |
| |
| | (permalink) |
| I would concur, if you're wanting to use C, move to the 18F series and use the free compiler. | |
| |
| | (permalink) |
| Good programming is more about style and technique then the language you choose to use. Several books have been written on writing good code. Arguably the most important thing to keep in mind is readability. It used to be "the thing" to write C code that was as compact as possible. Anything that made the code shorter was used. Although terse coding can be fun it should not be used on a regular basis. When it is the code needs to well documented. If straightforward C is not good enough it is far better to use a few lines of well documented in-line assembler. Avoid attempts to optimize your C code when doing so will make it difficult to understand. When you are learning the language or new to a compiler leave the optimization to the compiler. What seems more optimized in C source may not result in shorter compiled code. | |
| |
| | (permalink) |
| I see, I guess I will just learn the basics with MikroC for now... I will begin using C18 with the 18F's when I get some... Can you guys give a list of good begineer 18F chips? What would you consider the 877a or 18F? or the 628a? Also... I was just wondering what happens when you make variables in C? ... is an INT just 4 seperate bytes ... a decimal 16 bytes? Also.. can you point me to a good place to find the correct syntax for C? In C#... for loops are created as follows... for (int i = 0; i < 100; i++) { \\do something } This doesnt work in C... What about IF statements? Select Cases? These are all things I cant seem to find on Google.
__________________ "Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post 9vDC Guitar Pedal PSU PIC16F84a Game Module | |
| |
| | (permalink) | ||
| Quote:
Code: PORTB.f0 = 1; // mikroC RB0 = 1; // Hi-Tech PIC C PORTBbits.RB0 = 1; // C18 Quote:
Last edited by eng1; 17th November 2007 at 11:37 PM. | |||
| |
| | (permalink) |
| Small 18F the 18F1320, medium 18F2525 and big the 18F4620. I'm learning C18 myself | |
| |
| | (permalink) | |
| Quote:
You can, however, write equally bad code in both :-) P. | ||
| |
| | (permalink) |
| Ok, The help file for mikroC has everything I was looking for. Yes, it seems as though the machine code produced by mikroC is VERY wasteful in terms of memory!! Just to make an lcd output a couple sentences ate all my 628As ROM!... or RAM... Can you guys explain the difference between ROM and RAM for micros?? Isn't ROM for storing the actual code that is written? and RAM is...? Also, why are the 18Fs better suited for C? I have read a bit on the RISC (Reduced Instruction Set Computer) design.
__________________ "Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post 9vDC Guitar Pedal PSU PIC16F84a Game Module | |
| |
| | (permalink) | |||
| Quote:
Quote:
Quote:
| ||||
| |
| | (permalink) |
| In general the 18F series has a lot more RAM and ROM too... and as Nigel says, the instruction set is better suited to C than the 16 series. Finally, the 18F costs just $US3-7 in one-off quantities... seems ridiculously cheap for such ease of use. P. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Using Oscilloscopes | mechie | Electronic Theory | 9 | 29th November 2007 10:49 PM |
| USB Time Delay Fan Control | Karaethon | Micro Controllers | 53 | 14th March 2006 10:36 PM |
| With limited time, what ways to increase qualifications? | sram | Chit-Chat | 1 | 8th January 2006 09:18 PM |
| Drawing Waveforms or how to draw waveforms | walters | General Electronics Chat | 105 | 11th December 2005 12:24 PM |
| to set accurate time on laptop for visual satallite tracking | John walker | Electronic Projects Design/Ideas/Reviews | 4 | 12th October 2005 05:30 PM |