Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 16th November 2007, 08:41 AM   (permalink)
Default Time for MICRO-CHANGE!

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
Peter_wadley is offline  
Old 16th November 2007, 09:32 AM   (permalink)
Default

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.
aussiepoof is offline  
Old 16th November 2007, 07:04 PM   (permalink)
Default

Peter, since you're in Toronto you might want to drop by Creatron and pick up one of my Junebug kits shameless plug.
Its got a USB programmer / debugger and a 18F1320 for learning (lights buttons etc...)
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Old 17th November 2007, 06:38 AM   (permalink)
Default

Quote:
Originally Posted by blueroomelectronics
Peter, since you're in Toronto you might want to drop by Creatron and pick up one of my Junebug kits shameless plug.
Its got a USB programmer / debugger and a 18F1320 for learning (lights buttons etc...)
Nice site and store blueroom! I will definately swing by sometime! (In Waterloo right now)

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
Peter_wadley is offline  
Old 17th November 2007, 06:53 AM   (permalink)
Default

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. ---
kchriste is offline  
Old 17th November 2007, 07:15 AM   (permalink)
Default

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.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Old 17th November 2007, 10:14 AM   (permalink)
Default

I would concur, if you're wanting to use C, move to the 18F series and use the free compiler.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 17th November 2007, 01:44 PM   (permalink)
Default

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.
3v0 is offline  
Old 17th November 2007, 10:53 PM   (permalink)
Default

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
Peter_wadley is offline  
Old 17th November 2007, 11:18 PM   (permalink)
Default

Quote:
Originally Posted by Peter_wadley
I guess I will just learn the basics with MikroC for now...
Check the manual of the compiler you're going to use. The syntax is compiler specific. For example, all the following instructions set RB0:
Code:
PORTB.f0 = 1;           // mikroC
RB0 = 1;                // Hi-Tech PIC C
PORTBbits.RB0 = 1;      // C18
Quote:
Originally Posted by Peter_wadley
In C#... for loops are created as follows...
for (int i = 0; i < 100; i++)
{
\\do something
}

This doesnt work in C...
This syntax will work with PICs too.

Last edited by eng1; 17th November 2007 at 11:37 PM.
eng1 is offline  
Old 17th November 2007, 11:19 PM   (permalink)
Default

Small 18F the 18F1320, medium 18F2525 and big the 18F4620.

I'm learning C18 myself
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Old 18th November 2007, 05:08 AM   (permalink)
Default

Quote:
Originally Posted by 3v0
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.
Agree totally here. The *main* advantage of C over PIC assembler is in productivity... you simply cannot write as much code as quickly in assembler.

You can, however, write equally bad code in both :-)

P.
aussiepoof is offline  
Old 18th November 2007, 05:55 PM   (permalink)
Default

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
Peter_wadley is offline  
Old 18th November 2007, 06:03 PM   (permalink)
Default

Quote:
Originally Posted by Peter_wadley
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...
Depends what libraries it loads?, but it will always be pretty wasteful, particularly for a small program. You also should avoid floating point, this requires a large library to be loaded, and is slow and inaccurate (even on a PC) - and is only rarely required.

Quote:

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...?
Neither term really applies to a PIC, it's been misused, but 'ROM' would be the program memory, and 'RAM' the GPR's.

Quote:

Also, why are the 18Fs better suited for C? I have read a bit on the RISC (Reduced Instruction Set Computer) design.
Because the increased instruction set is designed to be 'friendly' to a C compiler, so it produces much more efficient code - and as the 18F has a free fully featured C compiler it makes sense to use the 18F series.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 19th November 2007, 04:34 AM   (permalink)
Default

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.
aussiepoof is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
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



All times are GMT. The time now is 09:18 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker