Skip to content

devel0/iot-atmega-bare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

iot-atmega-bare

atmega barebone

features

  • simple atmega8/328 holder
  • ICSP connector
  • micro usb connector with ams1117-3.3 voltage regulator
  • missing reset button ( can easily replaced for testing purpose by a F-F dupont cable attached to U4 GND that touch reset PC6 when needed )
  • JP5 ( VCC voltage selector between 3V3 or 5VUSB )
  • power out GND-3V3 GND-5V addictionals
  • J2 SPI addictional (MOSI, MISO, SCK)
  • atmega can programmed by usbasp through ICSP connector while for example an enc28j60 or W5500 connected to PB2,PB3,PB4,PB5 and another device like an SD card can be attached through J2 addictional SPI.

prerequisites

build it

  • atmega barebone schematics and pcb can be etched using this procedure on a copper 70x49mm
    • pcb and labels ready to print
    • use flux to ease soldering
    • 0.8mm drill bit for C1 electrolitic ; 1.0mm for other holes
  • plastic case can be built using 3d printer and this parametric
    • part : box
    • wt : 2
    • lss : [2, 2, 2]
    • is : 71.5, 50.5, 10
    • oc : 1
    • lh = rh = bh : []
    • fh = [ [ 18, 12, 60.5, false, wt + lss[2] ] ]

debugging

  • connect an usbasp programmer to ICSP connector
  • barebone icsp connector doesn't have VCC connected to avoid voltage source mixture
  • use an usb/ttl converter connecting GND, RX to atmega GND, RX ( PD1 )
  • start code . from sketch folder ( atmega-bare )
  • hit ctrl+shift+p to upload using usbasp programmer ( troubleshoot usbasp not found and permission pb )
  • open serial port to monitor it

SPI

Each SPI device must honor MISO (MasterInputSlaveOutput) detaching when its CS (ChipSelect) goes high or this can create communication problems; to be able to do that device must use a TriState buffer (eg. SN74LVC125A). A good explain here. Recently I bought an SD card breakout board that mount LVC125A chipset and at the end I found out a thread that explain why it was not working as expected: there was pin13 4OE (driving MOSI) connected to GND permanently where it need to be connected to pin8 3Y (CS signal) to enable/disable MOSI correctly. I ended up fixing it as described by this saver. Hopefully exists a new version but not the one I had recently.

vscode + platformio

see here