FabFTDI
FabFTDI Atmega16U2
Milling board: Make sure to export the images as 2000dpi.
Expermeinting: 14mil wide pads worked well. Now trying bigger pads. 15mil works in fab module and 16mil doesn’t work in fab module. I will just keep it at 14mil.
Add LED in one of the PWD pins to show Rx/Tx
In schematic and board change the value of the resonator once decided which one to use.
If the board doesn’t work check if my USB connection connector is right (I modified it).
Adding crystal to board: The one I orderd digikey# 535-10226-1-ND
Package: HC49 (use the one in adafruit library).
Adding LUFA in AVRStduio
https://delog.wordpress.com/2016/08/10/arduino-uno-r3-usb-serial-firmware-from-scratch/
Atmel Studio + LUFA
Installed LUFA extension through tools-extention manager. Each demo comes as classDriver and LowLevel. ClassDriver is easier to use than LowLevel.
File –new example project-“USB to serial port converter” This will open the project.
Copied this project folder to FabFTDI folder for edting. Changed the device to atmega16U2
OK so the USB mouse example works so that makes it clear that the connection and everything is right. However, the connection sucks. For now I will make another board USB-micro connector so that I can remove this uncertainity.
Keyboard code works to (don’t need to remoe the SPI connector it just workred after flashing memory)
Testing Board
(include jumper in inventory)
Use jumper to connect Rx and Tx.
Ubuntu
Detected as ttyUSBACM0
Mac
Detected as tty.usbmodem1421
Download term.py (provide link). Open terminal navigate to the location of term.py and run
Board improvement: need better USB connector.
(important to export with 2000 dpi)
Class_CDC1 also worked.
(there is an example for avrisp-mk2 clone which support ISP, PDI, and TPI))(
(attiny814 is better but not available at Digikey).
Compatible with ATTINY44 (recheck) but also has USART so can do better boud-rate.
Can use the USI available in Attiny45 to achieve half-duplex USART.
Ref - http://www.atmel.com/Images/doc4300.pdf
https://github.com/frank26080115/Arduino-UsiSerial-Library/blob/master/UsiSerial/USI_UART.c
Attiny102 is 8 pin microcontroller with USART in it. However, it uses TPI interface (require 3 pins) for programming. ATMEL-ICE supports TPI programing and can be used to program Attiny102.
TPI programming Resources:
http://www.atmel.com/images/doc8373.pdf
Possible Troubles
1. TPIDATA and TPICLK pins are shared with USB D+/D- which have zerner diode to limit it to 3.3V. This may create some problems.
TPI Connector Pin-diagram for ATMEL-ICE: http://www.atmel.com/webdoc/atmelice/atmelice.using_ocd_physical_tpi.html
Create a library with desired parts: Device for TPI connector, Device for USB micro
Notes about circuit:
For low speed device D- is pulled up with 15K ohm resistor and for full speed USB device D+_is pulled up with 15K resistor. Since FabFTDI uses V-USB which implement low-speed usb device, we pull-up D- (ref: http://www.beyondlogic.org/usbnutshell/usb2.shtml).
Check before connection: Make sure the orientation of zener dioes are right.
Update 10-01-2017
Today made the circuit and tried to program it. However, it failed. Then I removed the 49ohm resistor to disconnect USB line and was able to program the board. Therefore, the problem is with sharing the TPI pins with USB. (I swaped the USB pins and RX/TX pins but later realized that it can not be done as the Rx/Tx pins are fixed and should only be used for Rx/Tx.
I also realized that D- pin is pulled up using 15K resistor which was connected to TPICLK. Since the D- pin is pulled up and connected to TPICLK the microcontroller must be receiving any clock and therefore failed to go into the program mode. The solution is to use the D- pin for one of the remaining pin which is PB1 and D+ to TPIDATA.
D- is pulled up to indicate to the host that it is a low-speed device.
Setting-up GNU AVR toolchain
Either install AVRstudio seven which will install GNU toolchain at “C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain” or separately install toolchain by downloading it from “http://www.microchip.com/development-tools/atmel-studio-7/avr-and-arm-toolchains-(c-compilers)”.
In windows, edit the “PATH” environment variable with the location <install_dir>/bin (this directory have avr-gcc and other binutils required for compiling C-code_
Once added, type avr-gcc –version in the CMD prompt and you should see the current verison.
Now in the make file, make sure compiler is selected as avr-gcc.
The new version of avr-gcc can’t compile the V-USB library (some changes in vector names etc) so I am switching back to using old compiler (installing WinARV). However, Winever does not support tiny441.
This
file is an example configuration (with inline documentation) for the USB
driver.
It configures V-USB for USB D+ connected to Port D bit 2 (which is
also
hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may
wire the lines to any other port, as long
as D+ is also wired to INT0 (or any
other hardware interrupt, as long as it
is the highest level interrupt, see
section at the end of this file).
+
To create your own usbconfig.h file, copy this file to your project's
+
firmware source directory) and rename it to "usbconfig.h".
+ Then edit it
accordingly.\
In my case INT0 is also XTAL pin so I am not connectecting crstal.
Add compiler: http://fab.cba.mit.edu/classes/863.16/doc/projects/ftsmin/windows_avr.html
Editing Frimeare for Attiny441
First added new compiler. Declared const format is const PGMEM char name etc. Change SIG_INTERUPT to INT_<something>
In compiler file MCU-ATTINY441.
Edit usbconfig.h : Remove all uC except 441