All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Programmer's Corner

Notices

Programmer's Corner Discussion forum for all aspects of programming and software engineering. Any software programming language welcome: C, C++, C#, Fortran, Java, Matlab, etc.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 07-28-2010, 04:04 PM
thakid87 thakid87 is offline
Senior Member
 
Join Date: May 2009
Location: Miami
Posts: 122
Default Best/Easiest code to learn first?

Just curious what the recommendations are.
Reply With Quote
  #2  
Old 07-28-2010, 04:13 PM
t06afre's Avatar
t06afre t06afre is offline
Senior Member
 
Join Date: May 2009
Posts: 5,834
Default

On my travel suitcase I use 000 for the lock, very easy to learn Joking aside, can you tell more about which aplication segment/environment you plan to do your coding in.
Reply With Quote
  #3  
Old 07-28-2010, 04:14 PM
thakid87 thakid87 is offline
Senior Member
 
Join Date: May 2009
Location: Miami
Posts: 122
Default

Haha, nice one. I'm looking for "simple" programs that I can then learn to load into microcontrollers in the future.

I quote simple because I really don't know how easy/difficult it would be to learn.

THANKS!
Reply With Quote
  #4  
Old 07-28-2010, 04:30 PM
jpanhalt jpanhalt is offline
E-book Developer
 
Join Date: Jan 2008
Location: Ohio, USA(GMT-5)
Posts: 3,619
Default

Code for what?

If you are starting with PIC's, I started with and still use Assembly. My prior coding experience was a Ti99/4 and some MS Basic 20 years previously. My reasons were simply: 1) MPLab completely formats the code for you, so all I needed to do was concentrate on the instructions -- I didn't have to worry about the formatting of something like C; 2) A lot of the code for what I wanted to do was available in Assembly, as were many tutorials; and 3) I liked understanding what was going on in the MCU. I also felt that since I was completely new to microcontrollers, why try to learn both a language like C and microcontrollers at the the same time. Assembly just seemed intuitive to me, once I had read the limited instruction set (e.g., for the 16F628A).

John
Reply With Quote
  #5  
Old 07-28-2010, 04:41 PM
retched's Avatar
retched retched is offline
Senior Member
 
Join Date: Dec 2009
Location: Baltimore, MD
Posts: 5,198
Blog Entries: 14
Default

Look over some tutorials and see which programming language seems to make the most sense to you.

A big problem with many languages is you often have to "forget" what you learned in one language about coding when learning another.

So all things aside, if you learn assembler, you will be able to control every aspect of every chip in short order. PICs often have only 33 to 35 commands. That isn't many.

33 commands control every aspect of the uC. That is a list you can have printed out and sitting beside you while you code..on ONE PAGE..

When it comes to C, or even BASIC, there are dozens or a hundred or more commands and often cryptic ways of using each command. This can be VERY daunting to some.. Or it can make perfect sense to you.

Here is a site with tutorials. Each tutorial has ASM(assembler) and C code. You can see the difference in the languages and what is required to do what. See which language seems to make sense to you and go from there.
http://www.gooligum.com.au/tutorials.html

Then check out BASIC. SwordfishBASIC and PICBASICPro are two to google. Also MIKROBasic. Here is a link to C, PASCAL, and BASIC compilers:
http://www.mikroe.com/eng/categories/view/2/compilers/

give em a look.
__________________
-rm-
Reply With Quote
  #6  
Old 07-29-2010, 11:22 AM
big5824 big5824 is offline
New Member
 
Join Date: Jul 2010
Posts: 9
Default

Id say start with C. Its more or less pushed java out of the market now, and assembler is becoming less and less appropiate as devices become more complex, so basically everything seems to be moving towards C (or a varient of)
Reply With Quote
  #7  
Old 07-29-2010, 03:37 PM
nsaspook's Avatar
nsaspook nsaspook is online now
Senior Member
 
Join Date: Aug 2009
Location: Fairview, Oregon
Posts: 938
Blog Entries: 1
Default

Quote:
Originally Posted by thakid87 View Post
Just curious what the recommendations are.
Just don't start with BASIC. If you plan to develop complex device software "C" in the long run is the better language because it keeps the code at a higher level logic and data flow but still allows you to easily toggle things at the bit level efficiently.

Something being easy is overrated.
__________________
We need a Check Up from the Neck Up.
Reply With Quote
  #8  
Old 07-29-2010, 04:20 PM
Aule Mar's Avatar
Aule Mar Aule Mar is offline
New Member
 
Join Date: Jul 2010
Location: USA, Maryland
Posts: 4
Default

I've programed in Basic, C, C+, Fortran, Lisp etc.
But when working with microcontrollers and logic circuts, there nothing like assembly, you actualy know exactly where the Bits are going, and If/when you upgrade to C for doing something complicated, you still get an assembly listing, and will know how to read that to debug your complicated code.
Aule
Reply With Quote
  #9  
Old 07-29-2010, 05:37 PM
nsaspook's Avatar
nsaspook nsaspook is online now
Senior Member
 
Join Date: Aug 2009
Location: Fairview, Oregon
Posts: 938
Blog Entries: 1
Default

Quote:
Originally Posted by Aule Mar View Post
I've programed in Basic, C, C+, Fortran, Lisp etc.
But when working with microcontrollers and logic circuts, there nothing like assembly, you actualy know exactly where the Bits are going, and If/when you upgrade to C for doing something complicated, you still get an assembly listing, and will know how to read that to debug your complicated code.
Aule
Very true, but you know how many times I've has to look at the ASM code to find a C coding error? Zero, and it's not because I haven't made some bonehead mistakes but because the compiler does so many optimizations it's almost a waste of time looking at it unless your tracing a compiler bug with a test case program to find it.

Knowing where all the bits are is NOT overrated but sometimes you have to be free from the chip level mentality while building a product.
__________________
We need a Check Up from the Neck Up.
Reply With Quote
  #10  
Old 07-29-2010, 08:07 PM
tom66 tom66 is offline
Senior Member
 
Join Date: May 2009
Location: Basingstoke, UK
Posts: 2,613
Default

Python .

But it's not usually run on microcontrollers, so Assembly.

Or C, because that works on pretty much everything.
__________________
"Pray that there's intelligent life somewhere in outer space 'cause there's bugger all here on planet earth!"
Reply With Quote
Reply   Post New Thread

Tags
, ,


Related Site Pages
Section Title
Worksheet Memory devices
Textbook Computational circuits : Practical Analog Semiconductor Circuits
Video Lecture Representative System (Part 3) - Executing a Program - Microprocessors
Textbook Fundamentals of SPICE programming : Using The spice Circuit Simulation Program
Textbook SPICE models : Diodes And Rectifiers


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generate Morse Code by Mplab. Need Help! morgan Homework Help 1 07-25-2010 12:08 AM
Debuggers are evil someonesdad Programmer's Corner 5 04-21-2010 10:45 PM
HEX code TO assembly code pic16f84a servo motor code longcrystal Embedded Systems and Microcontrollers 4 04-10-2010 06:15 PM
16f84 or 16f628 IR Code Redirect capelu Embedded Systems and Microcontrollers 0 08-29-2009 02:07 PM
PICStep/Linistepper/AVRSTMD Code in C or BASIC joprinz General Electronics Chat 1 03-29-2009 01:03 AM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:29 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.