Posts | Comments

Planet Arduino

Archive for the ‘ATMEGA2560’ Category

Debugging with printf is something [StorePeter] has always found super handy, and as a result he’s always been interested in tweaking the process for improvements. This kind of debugging usually has microcontrollers sending messages over a serial port, but in embedded development there isn’t always a hardware UART, or it might already be in use. His preferred method of avoiding those problems is to use a USB to Serial adapter and bit-bang the serial on the microcontroller side. It was during this process that it occurred to [StorePeter] that there was a lot of streamlining he could be doing, and thanks to serial terminal programs that support arbitrary baud rates, he’s reliably sending debug messages over serial at 5.3 Mbit/sec, or 5333333 Baud. His code is available for download from his site, and works perfectly in the Arduino IDE.

The whole thing consists of some simple, easily ported code to implement a bare minimum bit-banged serial communication. This is output only, no feedback, and timing consists of just sending bits as quickly as the CPU can handle, leaving it up to the USB Serial adapter and rest of the world to handle whatever that speed turns out to be. On a 16 MHz AVR, transmitting one bit can be done in three instructions, which comes out to about 5333333 baud or roughly 5.3 Mbit/sec. Set a terminal program to 5333333 baud, and you can get a “Hello world” in about 20 microseconds compared to 1 millisecond at 115200 baud.

He’s got additional tips on using serial print debugging as a process, and he’s done a followup where he stress-tests the reliability of a 5.3 MBit/sec serial stream from an ATMega2560 at 16 MHz in his 3D printer, and found no missed packets. That certainly covers using printf as a debugger, so how about a method of using the debugger as printf?

Dic
01

Using The Second Microcontroller On An Arduino

arduino hacks, ATmega, atmega16u2, ATMEGA2560, ATmega328, bootloader, cdc, dfu, Firmware Commenti disabilitati su Using The Second Microcontroller On An Arduino 

While newer Arduinos and Arduino compatibles (including the Hackaday.io Trinket Pro. Superliminal Advertising!) either have a chip capable of USB or rely on a V-USB implementation, the old fogies of the Arduino world, the Uno and Mega, actually have two chips. An ATMega16u2 takes care of the USB connection, while the standard ‘328 or ‘2560 takes care of all ~duino tasks. Wouldn’t it be great is you could also use the ’16u2 on the Uno or Mega for some additional functionality to your Arduino sketch? That’s now a reality. [Nico] has been working on the HoodLoader2 for a while now, and the current version give you the option of reprogramming the ’16u2 with custom sketches, and use seven I/O pins on this previously overlooked chip.

Unlike the previous HoodLoader, this version is a real bootloader for the ’16u2 that replaces the DFU bootloader with a CDC bootloader and USB serial function. This allows for new USB functions like HID keyboard, mouse, media keys, and a gamepad, the addition of extra sensors or LEDs, and anything else you can do with a normal ‘duino.

Setup is simple enough, only requiring a connection between the ‘328 ISP header and the pins on the ’16u2 header. There are already a few samples of what this new firmware for the ’16u2 can do over on [Nico]’s blog, but we’ll expect the number of example projects using this new bootloader to explode over the coming months. If you’re ever in an Arduino Demoscene contest with an Arduino and you’re looking for more pins and code space, now you know where to look.


Filed under: Arduino Hacks
Nov
21

Phoenard: World’s 1st Arduino-compatible Prototyping Gadget

arduino, ATMEGA2560, AVR, kickstarter, prototype Commenti disabilitati su Phoenard: World’s 1st Arduino-compatible Prototyping Gadget 

a938ea6cb4b3475cce88c4306bdce57a_large

The ultimate combination of an Arduino-compatible board and your day-to-day Gadget in one handheld Device.

Phoenard is an All-in-one Arduino-compatible prototyping Gadget powered by an 8-bit AVR ATMEGA2560, identical to the one you find in Arduino Mega. It is essentially a pocket-sized prototyping platform which you can use as the ‘brain’ in your projects, similar to using an Arduino. BUT, it has a lot more features built into a single case developed in such a way that you can use it as your day-to-day Gadget.

Phoenard: World’s 1st Arduino-compatible Prototyping Gadget - [Link]

Mag
22

DIY Temperature & Humidity & Smoke Detector

arduino, ATMEGA2560, DHT11, Gas, Humidity, MQ-2, Sensor, smoke, temperature Commenti disabilitati su DIY Temperature & Humidity & Smoke Detector 

FPTBQC4HV72CMNV.MEDIUM

ICStation @ instructables.com writes:

ICStation team introduce you how to DIY this temperature & humidity & smoke alarm system based on ICStation Mega 2560 compatible with Arduino.The working voltage of this system is DC5V.It can measure the current temperature, humidity and smoke. It can display real-time data by the 1602 LCD and can realize the sound and light alarm when in the dangerous temperature and humidity. It is a simply and easily to operate monitoring alarm system about temperature humidity and smoke.

DIY Temperature & Humidity & Smoke Detector - [Link]

Mag
03

Controlling an Arduino through a Rapsberry Pi webserver

arduino, ATMEGA2560, i2c, Rapsberry Pi, Server, webserver Commenti disabilitati su Controlling an Arduino through a Rapsberry Pi webserver 

by bajdi.com:

I’ve been looking for ways to control my Service droid robot, my Service droid robot has an ATmega2560 (with Arduino bootloader) and a Raspberry Pi. My goal is to control it over wifi. But I wanted to start with some more simpler things first. I’ve recently found some python code on letsmakerobots.com that lets me sent data over I2C from a Raspberry Pi to a micro controller.

Before getting this to work you need to configure I2C on the Raspberry Pi. Adafruit has written a nice guide how to do this. I also installed the python-SMBus package: sudo apt-get install python-smbus.

Controlling an Arduino through a Rapsberry Pi webserver - [Link]



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook