• Home
  • CHIPINO.cc
    • Getting Started
    • Simple C>
      • Sample Code
    • PBP3>
      • Sample Code
    • FAQ
    • Downloads
  • BASIC CHIPINO
  • CHIPAXE
    • 8-pin
    • 14-pin
    • 18-pin
    • 20-pin
    • 28-pin
    • LED Module
    • Switches Module
    • Relay Module
    • Voltage Regulator
    • RS232 Module
    • EEPROM Module
  • CHIPKIT
  • Getting Started
    • Forum
    • Videos>
      • BASIC CHIPINO
      • CHIPINO with Simple C
      • CHIPAXE
      • CHIPkit
      • Miscellaneous
  • Store

CHIPINO - Simple C Library

Getting Started | Simple C | PBP3 | FAQ | Downloads

SimpleC is a library of easy to use functions that make programming in C much easier. It was developed by Chuck Hellebuyck for his book series Beginner's Guide to Embedded C Programming. He introduced it in the 3rd volume of the series. We liked it so much we agreed to make it the official compiler tool for the CHIPINO since its based on the free HI-TECH compiler that automatically installs when you install the Microchip MPLAB IDE. The CHIPINO can be programmed with a PICkit 2/PICKit 3 and works directly from MPLAB. These tools along with Simple C create a great programming platform for the beginner and even experienced CHIPINO user. 

For more info on Chuck's books click below:  
"Beginner's Guide to Embedded C Programming Volumes 1 thru 3 "

SimpleC Quick Reference

SimpleC programs can be divided in three main parts: structure , values (variables and constants), and functions. SimpleC is an add on library to the HI-TECH Compiler. It builds on the features already in the HI-TECH compiler. 

Structures

  • main( )

Control Structures

  • if
  • if...else
  • for
  • switch case
  • while
  • do... while
  • break
  • continue
  • return

Further Syntax

  • ; (semicolon)
  • {} (curly braces)
  • // (single line comment)
  • /* */ (multi-line comment)

Arithmetic Operators

  • = (assignment)
  • + (addition)
  • - (subtraction)
  • * (multiplication)
  • / (division)
  • % (modulo)

Comparison Operators

  • == (test for equal)
  • != (not equal to)
  • < (less than)
  • > (greater than)
  • <= (less than or equal to)
  • >= (greater than or equal to)

Boolean Operators

  • && (and)
  • || (or)
  • ! (not)

Compound Operators

  • ++ (increment)
  • -- (decrement)
  • += (compound addition)
  • -= (compound subtraction)
  • *= (compound multiplication)
  • /= (compound division)

Variables

Constants

  • #define

Data Types

  • bit
  • char
  • byte
  • int
  • unsigned int
  • long
  • unsigned long
  • float
  • double
  • string
  • array
  • void

Functions

Digital I/O

  • high(pin no.)
  • low(pin no.)
  • var = input(pin no.)

Analog I/O

  • adcin(pin no.)
  • pulseout(pin no., period)

Delay (val = 1 to 65535)

  • pause (val) 
  • pauseus (val) 

Hardware PWM (1khz to 32khz)

  • pwmout1(duty cycle,freq)
  • pwmout2(duty cycle,freq)

Hardware SPI

  • spi_init( )
  • spi_out(byte)
  • wr_byte(address,data)
  • var = rd_byte(address)
  • wr_MCP23S08(register,data)
  • var = rd_MCP23S08

Hardware I2C

  • i2c_init( )
  • i2c_start( )
  • i2c_repstart( )
  • i2c_stop( )
  • var = i2c_read( )
  • i2c_waitforidle( )
  • i2c_write(data)
  • i2c_eeout(address,data)
  • var = i2c_eein(address)

Hardware USART
(2400 or 9600 baud)

  • init_serial(baud)
  • putch(char)
  • var = getch( )

LCD (2x16)

  • lcd_init( )
  • lcd_clear( )
  • lcd_goto(position)
  • lcd_text("characters")
  • lcd_symbol(char)
  • lcd_number(3digit int)




Powered by Create your own unique website with customizable templates.