Info

You are currently browsing the archives for the Programming Language category.

Calendar
May 2012
S M T W T F S
« Jan    
 12345
6789101112
13141516171819
20212223242526
2728293031  
Categories

Archive for the Programming Language Category

3 most important techniques to use in programming

From http://www.microchipc.com/PIC_tips/PIC_tips_2.php

I had a new user to PIC micros ask me what he should learn. This is what I told him, the 3 most important techniques that I use in all my programming.

Interrupts

Learn how to use interrupts - they are used in buffering. In my experience, usually the arrangement is a main() loop, with interrupts collecting data to be processed by main().

Ring Buffering

Any PIC micro must collect data, then analyze it or process it. Most of the time, theres not enough time to analyze the data as its collected.

Therefore, use ring buffering. Collect the data in the background, with interrupts, filling up a ring buffer with routines such as ring_buffer_put(). In the background, at the programs leisure, use ring_buffer_get() to get the data out, and process it.

State Machines

Most problems can be simplified using state machines. Learn them - trust me, it’ll save you time. Links

Search the web, using terms like ’state machine c’ or ‘ring buffer c’ on www.google.com. The following web will get you started:http://www.bknd.com/cc5x/multitasking.shtml.

B.Lo.C Language for PIC Micro

from http://pp06.sourceforge.net/bloc.html

Fast Development On - Time

BLOC

C like language

  • Fast to Write, fewer mistakes
  • Programs are readable, and comprehensible
  • Familiar to available programming staff
  • Code will be supportable by new or different staff into the future
  • Programs can be ported easily from algorithms developed in C,
  • Code can be ported to other processors

Designed for PIC architecture

  • No stack usage
  • No use of intermediate storage during expression evaluation
  • No “optimization” : code executes as written
  • BLOC was written for real time signal processing at 10kHz using the PIC 16C71 !

|