All Projects → diegoherranz → Sdcc Examples

diegoherranz / Sdcc Examples

Licence: gpl-2.0
Code examples for microcontrollers ready to compile with SDCC

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Sdcc Examples

Blog
A set of various projects based on ESP8266, ESP32, ATtiny13, ATtiny85, ATtiny2313, ATmega8, ATmega328, ATmega32, STM32 and more.
Stars: ✭ 198 (+288.24%)
Mutual labels:  microcontroller, examples
Omg Counters
😍 Increment decrement counters using various frontend frameworks.
Stars: ✭ 44 (-13.73%)
Mutual labels:  examples
Plz
Say the magic word 😸
Stars: ✭ 31 (-39.22%)
Mutual labels:  examples
Real World Rails
Real World Rails applications and their open source codebases for developers to learn from
Stars: ✭ 982 (+1825.49%)
Mutual labels:  examples
Examples
OBSOLETE. This repo was for Caddy v1. For v2 and newer, see our forum's wiki category.
Stars: ✭ 963 (+1788.24%)
Mutual labels:  examples
Shell Examples
Little Bash shell scripting examples
Stars: ✭ 41 (-19.61%)
Mutual labels:  examples
Terrarium Templates
Template and example projects for Fastly Labs Terrarium https://wasm.fastlylabs.com
Stars: ✭ 21 (-58.82%)
Mutual labels:  examples
Cmsis Header Stm32
CMSIS device headers for all STM32 devices
Stars: ✭ 47 (-7.84%)
Mutual labels:  microcontroller
Drake External Examples
Examples of how to use Drake in your own project.
Stars: ✭ 43 (-15.69%)
Mutual labels:  examples
Nexmo Node Code Snippets
NodeJS code examples for using Nexmo
Stars: ✭ 36 (-29.41%)
Mutual labels:  examples
Bluepilldemo
A collection of small example projects tailored for the Blue Pill board created in STM32CubeIDE
Stars: ✭ 36 (-29.41%)
Mutual labels:  examples
Purescript Halogen Storybook
A library to assemble examples or develop components separately.
Stars: ✭ 33 (-35.29%)
Mutual labels:  examples
Tinygo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
Stars: ✭ 9,068 (+17680.39%)
Mutual labels:  microcontroller
Git To Solr
Index git history into a Solr repository
Stars: ✭ 31 (-39.22%)
Mutual labels:  examples
Examples
Demo applications and code examples for Confluent Platform and Apache Kafka
Stars: ✭ 571 (+1019.61%)
Mutual labels:  examples
Tldr
📚 Collaborative cheatsheets for console commands
Stars: ✭ 36,408 (+71288.24%)
Mutual labels:  examples
Attinycore
Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8
Stars: ✭ 974 (+1809.8%)
Mutual labels:  microcontroller
Module Federation Examples
Implementation examples of module federation , by the creators of module federation
Stars: ✭ 979 (+1819.61%)
Mutual labels:  examples
Spec Examples
Some examples on using clojure.spec!
Stars: ✭ 48 (-5.88%)
Mutual labels:  examples
Rf1101se Teensy
Driving one of those cheap RF1101SE boards with a Arduino or Teensy
Stars: ✭ 45 (-11.76%)
Mutual labels:  microcontroller

SDCC examples

Build Status

This repository includes code examples to use with SDCC, an open source compiler for 8-bit microcontrollers. These examples can help beginners to get started and to solve problems like which headers to include, which parameters to use when compiling, etc.

Structure

The examples are structured by microcontroller architecture. For a particular architecture, the examples can be followed in order as a tutorial. The basic concepts explained on the first examples are not explained again on more advanced ones.

On each example folder there is a Makefile so you can compile the example by simply running make. The actual compiler command will be shown so you can learn about the options passed to the compiler.

There are README files on each example with explanations of the code and indications on the hardware required to test it.

The architectures included are:

  • pic14/: PIC16F microcontrollers which have a 14-bit instruction bus, hence pic14. Examples for PIC16F886, but small modifications needed to use other PICs. As of this writing, the pic14 port of SDCC is unstable and could even be considered as broken (be warned!).
  • pic16/: PIC18F microcontrollers which have a 16-bit instruction bus, hence pic16. Examples for PIC18F2550, but small modifications needed to use other PICs. As of this writing, the pic16 port of SDCC is unstable but it can be used carefully.

Requirements

To compile these examples SDCC is required. gputils is also required for PIC ports.

Installation on Linux

There are packages of both SDCC and gputils on repositories of distributions like Debian and Ubuntu. Despite being an easy way to install them, the packages are usually outdated and installing the latest stable versions is strongly recommended. These instructions are for Ubuntu 12.04 LTS, 14.04 LTS and 16.04 LTS, but the process should be very similar for other distros, hopefully just changing the dependencies installation.

Installing dependencies

Before intalling gputils and SDCC, these dependencies are needed: $ sudo apt-get install bison flex g++ libboost-dev texinfo (probably similar packages for other distros)

gputils installation

gputils needs to be compiled before installing. Needs to be installed before SDCC.

  • Go to gputils source files page
  • Download the latest stable version and extract it. Be careful not to download Release Candidate (RC) files.
  • Inside gputils-x.x.x folder, run ./configure && make && sudo make install.
  • If everything went fine, check that gpasm -v works and returns the version number you expect.

SDCC installation

Up to SDCC 3.4.0, the precompiled version of SDCC worked fine on Ubuntu 12.04 LTS and 14.04 LTS, but from 3.5.0 on, SDCC needs to be compiled because the precompiled files depend on GLIBCXX_3.4.20 which is not available on those Ubuntu versions.

  • Go to SCCC source files page.
  • Download the latest stable version and extract it. Be careful not to download Release Candidate (RC) files.
  • Inside sdcc-x.x.x folder, run ./configure && make && sudo make install.
  • If everything went fine, check that sdcc -v works and returns the version number you expect.

Installation on Windows

gputils installation

  • Go to gputils files page
  • Download the latest stable version. Be careful not to download Release Candidate (RC) files.
  • Just execute the exe file and follow the installer.
  • If everything went fine, check that gpasm -v works and returns the version number you expect.

SDCC installation

  • Go to SCCC source files page: 32-bit or 64-bit.
  • Download the latest stable version. Be careful not to download Release Candidate (RC) files.
  • Just execute the exe file and follow the installer.
  • If everything went fine, check that sdcc -v works and returns the version number you expect.

Continuous Integration (automatic tests)

This repository is tested automatically on Travis-CI using the latest 3 SDCC and latest 2 gputils releases to make sure that every example is built without errors on those SDCC and gputils combinations (SDCC and gputils are downloaded and installed on the Travis instance automatically). The generated code is not tested (e.g. simulator), but at least this makes sure that the examples can be compiled.

Other tutorials

On the SDCC Wiki you can find other tutorials that can help you.

Collaboration

Any kind of collaboration like more examples, more architectures, corrections, comments, etc. are very welcome. Feel free to open an issue or fork and pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].