Commit 2c732236 authored by Jake Read's avatar Jake Read
Browse files

add circuit, datasheets

parent 137aa61c
Pipeline #2628 passed with stage
in 4 seconds
......@@ -132,7 +132,9 @@ If you have errors, make sure your pinouts are correct, your board has power, an
#### Including Example Code
I've build a few 'libraries' for all of these chips. Each is a .c and .h file. To include them in your project, follow these steps.
I've build a few 'libraries' for all of these chips. Each is a .c and .h file. They are located in this repo, [here](xmega-atk-libs), but I recommend you only use them for reference. To see how they come together in applications, you can poke around in endpoints [for the automatakit project](https://gitlab.cba.mit.edu/jakeread/automatakit).
To include external files in your project, follow these steps.
In the Atmel Studio 'Solution Explorer' (might not be open, go to View -> Solution Explorer), right-click on the Solution (mkembedded-example in this case) and do Add -> Existing Item
......@@ -152,4 +154,10 @@ Now we should be ready to build the example:
## Example Circuitry
In in [this subdirectory](circuit) you'll find an example eagle schematic and
\ No newline at end of file
In in [this subdirectory](circuit) you'll find an example eagle schematic and board for a minimum breadboard-xmega that uses the XMEGA A4U Series.
![board](circuit/bbxmega/board.png)
![sch](circuit/bbxmega/schematic.png)
Make one, modify one, etc.
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
[Eagle]
Version="08 03 02"
Platform="Windows"
Globals="Globals"
Desktop="Desktop"
[Globals]
AutoSaveProject=1
UsedLibraryUrn="urn:adsk.eagle:library:217"
UsedLibraryUrn="urn:adsk.eagle:library:325"
UsedLibraryUrn="urn:adsk.eagle:library:371"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/fab.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries_jake/eagle/jake/tag-connect-2030.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries_jake/eagle/jake/tag-connect-2050.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries_jake/eagle/sparkfun/SparkFun-Connectors.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/Comparators.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/Digital.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/FilterProducts.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/Misc.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/Opamps.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/Optos.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/PAsystem.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/PowerProducts.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/References.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/SpecialFunctions.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/capmeter.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/diode.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/lt-spice-simulation.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/lt-supply.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/rload.lbr"
UsedLibrary="C:/EAGLE 8.3.2/lbr/ltspice/sym.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries_jake/eagle/marekr/borkedlabs-passives.lbr"
[Win_1]
Type="Schematic Editor"
Loc="0 0 1919 1016"
State=1
Number=2
File="bbxmega.sch"
View="-13.5313 5.97904 167.1 132.776"
WireWidths=" 0.0762 0.1016 0.127 0.15 0.2 0.2032 0.254 0.3048 0.4064 0.508 0.6096 0.8128 1.016 1.27 2.54 0.1524"
PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
PadDrills=" 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.65 0.7 0.75 0.8 0.85 0.9 1 0.6"
ViaDiameters=" 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 1.1 1.15 1.2 1.3 0"
ViaDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
HoleDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
DimensionWidths=" 0 0.127 0.254 0.1 0.26 0.13"
DimensionExtWidths=" 0.127 0.254 0.1 0.13 0.26 0"
DimensionExtLengths=" 1.27 2.54 1 2 3 0"
DimensionExtOffsets=" 1.27 2.54 1 2 3 0"
SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
WireBend=0
WireBendSet=31
WireCap=1
MiterStyle=0
PadShape=0
ViaShape=1
PolygonPour=0
PolygonRank=0
PolygonThermals=1
PolygonOrphans=0
TextRatio=8
DimensionUnit=1
DimensionPrecision=2
DimensionShowUnit=0
PinDirection=3
PinFunction=0
PinLength=2
PinVisible=3
SwapLevel=0
ArcDirection=0
AddLevel=2
PadsSameType=0
Layer=91
Views=" 1: -13.5313 5.97904 167.1 132.776"
Sheet="1"
[Win_2]
Type="Board Editor"
Loc="0 0 1919 1016"
State=1
Number=1
File="bbxmega.brd"
View="-1.29872 8.23325 42.8321 44.005"
WireWidths=" 0.0762 0.1016 0.127 0.15 0.2 0.2032 0.254 0.3048 0.4064 0.508 0.6096 0.8128 1.016 1.27 2.54 0.1524"
PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
PadDrills=" 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.65 0.7 0.75 0.8 0.85 0.9 1 0.6"
ViaDiameters=" 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 1.1 1.15 1.2 1.3 0"
ViaDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
HoleDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
DimensionWidths=" 0 0.127 0.254 0.1 0.26 0.13"
DimensionExtWidths=" 0.127 0.254 0.1 0.13 0.26 0"
DimensionExtLengths=" 1.27 2.54 1 2 3 0"
DimensionExtOffsets=" 1.27 2.54 1 2 3 0"
SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
WireBend=1
WireBendSet=0
WireCap=1
MiterStyle=0
PadShape=0
ViaShape=1
PolygonPour=0
PolygonRank=1
PolygonThermals=1
PolygonOrphans=0
TextRatio=8
DimensionUnit=1
DimensionPrecision=2
DimensionShowUnit=0
PinDirection=3
PinFunction=0
PinLength=2
PinVisible=3
SwapLevel=0
ArcDirection=0
AddLevel=2
PadsSameType=0
Layer=1
[Win_3]
Type="Control Panel"
Loc="0 0 1919 1039"
State=1
Number=0
[Desktop]
Screen="3840 1080"
Window="Win_1"
Window="Win_2"
Window="Win_3"
/*
* fastmath.c
*
* Created: 6/20/2018 12:38:38 PM
* Author: Jake
*/
int fastModulo(int dividend, int divisor){
// divisor must be a power of 2!
return dividend & (divisor - 1);
}
\ No newline at end of file
/*
* fastmath.h
*
* Created: 6/20/2018 12:35:50 PM
* Author: Jake
*/
#ifndef FASTMATH_H_
#define FASTMATH_H_
int fastModulo(int dividend, int divisor);
#endif /* FASTMATH_H_ */
\ No newline at end of file
/*
* pin.c
*
* Created: 6/18/2018 12:22:50 PM
* Author: Jake
*/
#include "pin.h"
void pin_init(pin_t *pin, PORT_t *port, uint8_t pin_bm, uint8_t pin_pos, uint8_t inout){
pin->port = port;
pin->pin_bm = pin_bm;
pin->pin_pos = pin_pos;
if(inout){
pin_output(pin);
} else {
pin_input(pin);
}
}
void pin_output(pin_t *pin){
pin->port->DIRSET = pin->pin_bm;
}
void pin_set(pin_t *pin){
pin->port->OUTSET = pin->pin_bm;
}
void pin_clear(pin_t *pin){
pin->port->OUTCLR = pin->pin_bm;
}
void pin_toggle(pin_t *pin){
pin->port->OUTTGL = pin->pin_bm;
}
void pin_input(pin_t *pin){
pin->port->DIRCLR = pin->pin_bm;
}
void pin_pullup(pin_t *pin){
// ? how to access PIN0CTRL, etc?
}
void pin_pulldown(pin_t *pin){
//
}
uint8_t pin_read(pin_t *pin){
return (pin->port->IN & pin->pin_bm);
}
\ No newline at end of file
/*
* pin.h
*
* Created: 6/18/2018 12:22:58 PM
* Author: Jake
*/
#ifndef PIN_H_
#define PIN_H_
#include "avr/io.h"
typedef struct {
PORT_t *port;
uint8_t pin_bm;
uint8_t pin_pos;
}pin_t;
void pin_init(pin_t *pin, PORT_t *port, uint8_t pin_bm, uint8_t pin_pos, uint8_t inout);
void pin_output(pin_t *pin);
void pin_set(pin_t *pin);
void pin_clear(pin_t *pin);
void pin_toggle(pin_t *pin);
void pin_input(pin_t *pin);
void pin_pullup(pin_t *pin);
void pin_pulldown(pin_t *pin);
uint8_t pin_read(pin_t *pin);
#endif /* PIN_H_ */
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment