Showing posts with label development board. Show all posts
Showing posts with label development board. Show all posts

Monday, November 23, 2015

Getting Started with the Atmel Xplained Mini with the ATmega168PB MCU

In this video we give you an overview of the Atmel Xplained Mini which is a development board for the ATmega168PB microcontroller. In the video we cover how to load a simple "Blink" program onto the Xplained Mini with Atmel Studio and how the development board is compatible with Arduino Shields. The video is presented from the standpoint of an Arduino user. You can access the code from the video below.



//**************************Atmel Studio Code****************************
/*
 * ATmega168PB Example.c
 *
 * Created: 11/21/2015 4:59:24 PM
 * Author : ForceTronics
 */ 

#define F_CPU 16000000UL //Set the clock frequency
#include <avr/io.h> //call IO library
#include <util/delay.h> //call delay library

int main(void)
{
DDRB |= (1<<DDB5); //Set Port B 5 or PB5 or PCINT5 or pin 17 to output (1 is output and 0 is input)
while(1)
{
/*
PORTB |= (1<<PORTB5);    //Set PB5 to 1 which is high (LED on)
_delay_ms(1000);        //Delay for 1000ms or 1 sec
PORTB &= ~(1<<PORTB5);    //Set PB5 to 0 which is low (LED off)
_delay_ms(1000);        //Delay for 1000ms or 1 sec
*/
PINB |= (1<<PINB5);
_delay_ms(1000);        //Delay for 1000ms or 1 sec
}
}



Wednesday, June 17, 2015

Building Your Own AVR / Arduino Internet of Things (IoT) Development Board Part 2

This is part 2 in a 5 part series where we build our own AVR / Arduino Internet of Things (IoT) development board, yay! In this part we add the Arduino bootloader to our Atmega 328p as well as build and test a prototype of our design.



BLE Micro Shield Eagle Files 1.0 version (use at your own risk):
https://dl.dropboxusercontent.com/u/26591541/BLE%20Shield.zip


//*******************Arduino Code**********************************************
/*
  This sketch is part of a video tutorial on the ForceTronics YouTube Channel for Building Your AVR/Arduino IoT Development Board 
  which uses a Atmega 328p and a Bluetooth low energy module. 
  The bluetooth module is connected to an Arduino and the Arduino is connected to an LED. 

  This code is in the public domain.
 */

// Pin 13 has a LED connected to it
int led = 13;

// the setup routine runs once when you press reset:
void setup() {
  
  Serial.begin(115200);
  // initialize the digital pin as an output and set it low initially
  pinMode(led, OUTPUT);
  digitalWrite(led, LOW);
}

// the loop routine runs over and over again forever:
void loop() {
  delay(30);
  String t; //create an empty string to store messages from Android
  while(Serial.available()) { //keep reading bytes while they are still more in the buffer
    t += (char)Serial.read(); //read byte, convert to char, and append it to string
  }
  
  if(t.length()) { //if string is not empty do the following
    if(t == "on") { //if the string is equal to "on" then turn LED on
      digitalWrite(led, HIGH); //Set digital pin to high to turn LED on
      Serial.write("LED is on"); //Tell the Android app that the LED was turned on
    }
    else if (t == "off") { 
      digitalWrite(led, LOW);  
      Serial.write("LED is off");
    } // turn the LED off by making the voltage LOW
  }
}

Tuesday, June 2, 2015

Building Your Own AVR / Arduino Internet of Things (IoT) Development Board Part 1

In this 5 part video series we will build our own AVR / Arduino Internet of Things (IoT) development board. We will go from a design concept to prototyping our design to PCB layout of our design all the way to a tested and finished development board.


Example parts order for this project (please note that this does not include all the parts)