Friday, March 31, 2017

Arduino (ATmega328) Direct Register Manipulation for Custom PWM Output (ex: 1us HIGH followed by 99us LOW --> 1% Duty Cycle at 10kHz)


Subscribe by Email!
Here's a quick example of how to make a hardware-based 1us HIGH pulse followed by a 99us LOW pulse (ie: 100us period, or 10kHz, PWM with a 1% duty cycle), via direct timer register manipulation. I've left ample comments for you to read and follow. This example below is therefore quite easy to follow and learn from, but just as it took me dozens of hours originally to learn how to do all this stuff from scratch--and to learn about all the different PWM modes possible as described in the datasheet and elsewhere, expect to spend at least a few hours if you are truly going to read the references and dig into it enough to understand it yourself. Good luck and have fun!

References to Study:
  1. Secrets of Arduino PWM, by Ken Shirriff
  2. ATmega328 Datasheet (660 pg version from 11/2015)
  3. ATmega168/328-Arduino Pin Mapping

Here's some oscilloscope screenshots of the output on Pin 3 produced by an Arduino Nano running the code below.

Rising edge to rising edge: Δx = 100us


***Subscribe by Email!***

Tuesday, January 10, 2017

Custom Firmware/Software Development/Electronics Engineering Work (Hire Me)


Subscribe by Email!
Page Written: 10 Jan 2017
Last Updated: 24 July 2018

UPDATE 24 JULY 2018: I'M TOO BUSY TO DEDICATE THE TIME REQUIRED TO ANY NEW PROJECTS. I'M NO LONGER TAKING NEW PROJECTS AT THIS TIME. SORRY FOR THE INCONVENIENCE.

Hi! My name is Gabriel Staples. I work in the embedded software and robotics industry.

Occasionally I take on side projects outside of my day job. For instance, I added custom 2.4GHz wireless control to the Cinemoves Powerslider at a time when off-the-shelf commercial solutions for wireless control of the Powerslider did not exist. This feature I provided enabled them to do special shots in the filming of Mission Impossible 5 and other Hollywood movies. 

I also built a fire drone for ABC's Battlebots show in 2016. 

Cinemoves Powerslider mounted on the side
of a Hollywood stunt car
If you’d like to hire me for custom work, begin by sending me an email. Make the subject line "Custom embedded work--name of project". Not sure if I can handle it? ASK! The worst I'll say is I don't have time, we're not a good fit, or it's out of my area of expertise. See below for details.

  Gabriel Staples
  Electric RC Aircraft Guy, LLC
  (Phone number available upon request by email)
  PLEASE ONLY USE THE BELOW EMAIL FOR PAID PROJECT REQUESTS.
   - If you are looking for free advice instead see here.



Related Links:
Hire Me:

If you're looking for some custom firmware/embedded software development and electronics-related engineering work, you've come to the right place.

Bluetooth-enabled touch lamp.
I am a custom electronics and embedded systems software developer. I design and build custom digital circuits, write code, and use micro-controllers to meet your electronics needs.

If you are using an Arduino for your project, and want your engineers to be able to do the same, I am a perfect fit for the job, as this is my go-to tool of choice.

  • From building an Unmanned Aerial System (UAS) “drone” (fire-shooting 10-lb hexacopter) that appeared on ABC’s BattleBots in 2016, and designing and producing a camera controller wireless interface board used in the filming of Mission Impossible 5 and other Hollywood movies, to writing my own quadcopter navigation/path planning algorithm from scratch (demo video 1 / demo video 2 / simulation), I have clearly and consistently demonstrated my passion and enthusiasm for solving tough engineering problems. 
  • My intense self-motivation is what sets me apart. I do not limit myself to just what I have been taught, I teach myself when necessary, then I use this knowledge to solve problems others can't. When you hire me, I share my knowledge with you and your engineers and work with you to make your life easier. When I don't know how to do something, I do extensive research, ask questions and figure it out.

Hollywood camera wireless control board
--helped film Mission Impossible 5 and
other Hollywood films, as well as the
2014 Emmy Awards.
  • If we're not a good fit, I'll say so. 100% satisfaction guaranteed or your money back (details below). 
  • Career supported by a Master of Science degree and vast real-world expertise, with a B.S. in Aeronautical Engineering, graduating Summa Cum Laude from a top university.
  • 5 yrs. full-time R&D experience + 2.5 yrs. part-time, including 3 yrs. full-time UAV/UAS experience + 4.5 yrs. part-time.
  • In my day job I write embedded systems software for self-driving semi trucks at a top San Francisco-based company.
Other projects I have completed are listed below.


***Subscribe by Email!***

Monday, November 21, 2016

MAX5481 10-bit Digital Potentiometer Arduino Code


Subscribe by Email!
By Gabriel Staples
Written: 21 Nov 2016
Last Updated: 21 Nov 2016

Here is a sample code I wrote a couple years ago to command and control a MAX5481 digital potentiometer using SPI commands, including storing commands in the chip's on-board EEPROM (to save the last value written), or not.

In this example you have to type commands into the Arduino Serial Monitor to set the digital potentiometer. I then interpret your serial command you typed, then I send it to the MAX5481 via its defined serial SPI API.

The circuit and hookup is described in full in my comments at the top of my code. If you have any questions please post a comment below and I'll be sure to try and get back to you.

Enjoy.


***Subscribe by Email!***

Tuesday, November 8, 2016

Eagle PCB CAD - How to copy a part from one schematic to another


Subscribe by Email!
Gabriel Staples
8 Nov 2016

Learning EagleCAD? Here's how to copy a part from one schematic or board layout to another.
  1. Open up an Eagle Control Panel, and the board and schematic you are working on.
  2. Open up a *second* Eagle Control Panel, and the board and schematic you want to copy from.
  3. Use the group tool to make a selection of a part to copy.
  4. Click the copy tool, then ctrl + right click to copy the *grouped* selection to the clipboard. Press Esc now to not paste it anywhere in this project. 
    1. Note that you *must* use the group tool followed by ctrl + right click even if only copying a single object, since that's the only way to get it to your PC's clipboard.
  5. Go back to the schematic you'd like to paste into, and click the "paste" tool. Left-click anywhere to paste what's in the clipboard. 

Done!

Helpful References:
...among many others.





***Subscribe by Email!***

Monday, October 24, 2016

Learning More About Power Electronics


Subscribe by Email!
By Gabriel Staples
Written: 24 Oct. 2016
Last Updated: 24 Oct. 2016

Other Articles:
So, recently I was introduced to www.PowerElectronicsNews.com by SixtySecondTech, a website which aims to become somewhat of a "website directory that lists quality websites they find valuable and resourceful for the Technology community" (source). As SixtySecondTech grows their database, I hope they can become a good resource to the electronics, maker, Arduino, Raspberry Pi, and other communities.

PowerElectronicsNews is a brand new company who offers "electrical engineering news focused on power and power solutions," including highlighting "solutions and products featuring the latest innovations" in power design.  As I continue to grow my skills I hope to be able to apply some of the background knowledge I glean from their articles, so I can use it in real, hands-on projects I can then share and apply instead of just reading a high-level description of it. A few interesting-looking articles of theirs include the following. I have marked with asterisks the articles that particularly interest me. The more asterisks, the better.

***Subscribe by Email!***