Skip to content

velechit/timelapse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Timelapse Timer

Photography Timer based on Atmega8 controller, OLED display and button controls.

Specialities:

  • USB Based boot loader (based on baerwolf's code)
  • Minimalsitic SSD1306 driver
  • SoftSwitch power on

This project contains Circuit Schematic, PCB Layout, bootloader (Customized), Main Application

This project demonstrates using linker scripts to place code bases at specific location and re-using them across different codes

  • Bootloader also implements a minimalistic SSD1306 driver. As the bootloader space in ATMEGA8 is limited to 2k (start address 0x1800), the driver is placed at 0x1600 which can be accessed through absolute addressing
  • The application program (the actual timelapse code) makes use of this SSD1306 driver through absolute addressing

Progress so far

  • Bootloader
  • SSD1306 Driver
  • Integrate SSD1306 Driver with bootloader, and display a USB icon when in boot load mode
  • Update Makefile for bootloader to generate liner script for display driver entry points to be accessed by application program
  • Design the PCB
  • Get PCB Fabricated
  • Framework for the application
  • Main application program

UPDATE 1: Added power off code in bootloader

UPDATE 2: Initial dummy firmware implemented which is simple counter

UPDATE 3: got the fabricated PCB, assembled, and uploaded the bootloader & the dummy firmware... till now all working

UPDATE 4: Framework for main application ready


I thought of fabricating the board myself. Due to insufficient time, I have ordered from online fab. I had two options for shipment either too expencive and fast delivery or too slow with easy on pockets. I have chosen the latter, waiting for the board to arrive

IMPORTANT Update : I found a issue with the power on circuitory that the internal IO driver transistor is too leakey and is permanently turning on the PMOS power gate. Hence I have added additional NMOS (2n7002) to ground externally

Toolchain needed

The bootloader and firmware are developed using barebone avr-gcc and avr-libc

Install avr-gcc and avr-libc. Under Windows you may chose to use WinAVR.

Under linux (Ubuntu epsecially)

sudo apt install gcc-avr avr-libc

You will also need gmake (generally part of the installation). If not, install using

sudo apt install make

Compile using make

Fuse Settings

The board is designed with external oscillator module. Hence the below fuse settings are used for Atmega8

lfuse: 1 1 0 0 0 0 0 0 = 0xC0
       | | | | | | | |
       | | | | | | | +- CKSEL0   - External Clock
       | | | | | | +--- CKSEL1
       | | | | | +----- CKSEL2
       | | | | +------- CKSEL3
       | | | +--------- SUT0     - Startup Time 0ms
       | | +----------- SUT1
       | +------------- BODEN    - Brown-out detection disabled
       +--------------- BODLEVEL - Brown-out detection level (N/A)


hfuse: 1 1 0 0 1 0 0 0 = 0xC8
       | | | | | | | |
       | | | | | | | +- BOOTRST  - Reset boots to boot loader
       | | | | | | +--- BOOTSZ0  - Boot section size 2k
       | | | | | +----- BOOTSZ1
       | | | | +------- EESAVE   - No EEPROM save on program
       | | | +--------- CKOPT    - Full Swing Clock
       | | +----------- SPIEN    - Serial programming enabled
       | +------------- WTDON    - Watchdog Timer disabled
       +--------------- RSTDISBL - Reset not disabled

Program the above fuses using:

avrdude -p atmega8 -P usb -c usbasp -U lfuse:w:0xC0:m -U hfuse:w:0xC8:m

Uploading the bootloader

The bootloader and the fuse settings have to be uploaded using any other method of loading (Using Arduino as ISP or USBAsp programmer). Once programmed, the controller can be soldered to the application board and the programmed bootloader be used to upload the main firmware.

3D models

Board Side
3D Model of display side of the board

Component Side
3D Model of component side of the board

Post Fabrication

Board Side
Display side of the board

Component Side
Component side of the board

Full documentation can be found here

PCB is designed using

Download KiCad project files here

Schematic can be found here

email: [email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published