Commit eb244876 authored by Jake Read's avatar Jake Read

router does power to rpi

parent 8d1b3f2e
......@@ -27,6 +27,33 @@ Keycode: **128**
- issues a software microcontroller reset
- if the microcontroller is already hung up, this will not work
# ATKRouter + RPI
We can run atk on a dedicated raspberry pi hooked up to a machine. This is nice, because we can keep machine local state at the machine, and provide a nice machine display / ui / development environment in one spot. Great.
To do so,
### Setup the Raspberry Pi
- [download raspbian](https://www.raspberrypi.org/documentation/installation/installing-images/README.md)
- [flash and boot, setup etc](https://www.raspberrypi.org/documentation/setup/)
### Install Node on the Raspberry Pi
- to install node, download the distro you want from nodejs.org
- extract the files, and hit these commands
navigate to the distribution
`` cd <distro> ``
copy that to local space on the pi
`` sudo cp -R * /usr/local/ ``
to check that node is installed, check the version using
`` node -v ``
which should return the version number of the distro you installed.
# Reproducing This Work
All automatakit works are open source, and while we cannot sell you boards, if you have an interesting application, get in touch to ask about collaborating.
......
......@@ -5,3 +5,33 @@
![routing](https://gitlab.cba.mit.edu/jakeread/atkrouter/raw/master/images/routed.png)
The circuit uses an ATxmega256A3U microcontroller and it's UART modules to chatter over 5 ports. It includes a CP2102n USB - UART bridge, acting as the 6th port, to receive serial messages from a computer.
# BOM
0.1uF
1uF
10uF
120R
470R
1k
Resonator
LED Y,G,B
PWRPAD
2x3 6PIN
RJ45
POGOPIN
USBCONN
RST BUTTON
XMEGA
CP2102
VREG-AP2112
RS-485-SN75C1168
# Notes
- want new rj45 conn: top tab
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -9,6 +9,7 @@ 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/comm.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/connector.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/fab.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/lights.lbr"
......@@ -19,20 +20,19 @@ UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/power.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/sensor.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries_jake/eagle/sparkfun/SparkFun-Connectors.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries_jake/eagle/jake/tag-connect-2050.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/comm.lbr"
[Win_1]
Type="Board Editor"
Number=3
File="atkrouter-v01.brd"
View="-45.5597 -9.04102 190.4 116.286"
WireWidths=" 0.0762 0.1016 0.127 0.15 0.2 0.2032 0.4064 0.6096 0.8128 1.27 2.54 0.3048 1.016 0.508 0.254 0.1524"
Type="Schematic Editor"
Number=1
File="atkrouter-v01.sch"
View="-379.937 -103.342 574.167 510.011"
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.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 1 0.35 0.55 0.45 0.65 0.3"
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 1.016 1.27 1.4224 1.6764 1.9304 2.54 3.81 5.08 6.4516 1.778 0.8128 2.1844"
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"
......@@ -41,14 +41,14 @@ 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=3
WireBendSet=0
WireBend=4
WireBendSet=31
WireCap=1
MiterStyle=0
PadShape=0
ViaShape=1
PolygonPour=0
PolygonRank=1
PolygonRank=0
PolygonThermals=1
PolygonOrphans=0
TextRatio=8
......@@ -63,20 +63,22 @@ SwapLevel=0
ArcDirection=0
AddLevel=2
PadsSameType=0
Layer=48
Layer=97
Views=" 1: -379.937 -103.342 574.167 510.011"
Sheet="1"
[Win_2]
Type="Schematic Editor"
Number=1
File="atkrouter-v01.sch"
View="-706.998 -338.59 437.925 397.44"
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"
Type="Library Editor"
Number=2
File="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/passives.lbr"
View="-4.68099 -2.71724 10.9823 4.6057"
WireWidths=" 0.0762 0.1016 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 0.127"
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"
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778 1.27"
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"
......@@ -86,9 +88,9 @@ 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
WireBendSet=0
WireCap=1
MiterStyle=0
MiterStyle=1
PadShape=0
ViaShape=1
PolygonPour=0
......@@ -107,11 +109,53 @@ SwapLevel=0
ArcDirection=0
AddLevel=2
PadsSameType=0
Layer=91
Views=" 1: -706.998 -338.59 437.925 397.44"
Sheet="1"
Layer=21
[Win_3]
Type="Board Editor"
Number=3
File="atkrouter-v01.brd"
View="-44.5931 -16.3595 238.559 134.032"
WireWidths=" 0.0762 0.1016 0.127 0.15 0.2 0.6096 0.8128 2.54 0.3048 0.508 0.4064 1.016 1.27 0.2032 0.254 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.5 0.55 0.65 0.7 0.75 0.8 0.85 0.9 1 0.6 0.45"
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.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 1 0.35 0.55 0.65 0.45 0.3"
HoleDrills=" 0.2 0.25 0.3 0.4 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35 0.45"
TextSizes=" 0.254 0.3048 0.4064 0.6096 1.016 1.27 1.4224 1.6764 1.9304 2.54 3.81 5.08 6.4516 1.778 0.8128 2.1844"
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_4]
Type="Control Panel"
Number=0
......@@ -120,3 +164,4 @@ Screen="3840 1080"
Window="Win_1"
Window="Win_2"
Window="Win_3"
Window="Win_4"
......@@ -120,7 +120,7 @@ LINKER_SCRIPT_DEP+=
./%.o: .././%.c
@echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : 5.4.0
$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -x c -funsigned-char -funsigned-bitfields -DDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\XMEGAA_DFP\1.1.68\include" -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atxmega256a3u -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\XMEGAA_DFP\1.1.68\gcc\dev\atxmega256a3u" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -x c -funsigned-char -funsigned-bitfields -DDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\XMEGAA_DFP\1.1.68\include" -O2 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atxmega256a3u -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\XMEGAA_DFP\1.1.68\gcc\dev\atxmega256a3u" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
@echo Finished building: $<
......
......@@ -12,7 +12,7 @@
#include "uartport.h"
#include "pin.h"
#define ATKPORT_NUM_STATIC_PACKETS 8
#define ATKPORT_NUM_STATIC_PACKETS 4
#define ATKPORT_NUM_PORTS 6
#define ATKPORT_OUTSIDE_PACKET 0
......
......@@ -98,41 +98,41 @@
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atxmega256a3u -B "%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\gcc\dev\atxmega256a3u"</avrgcc.common.Device>
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols>
<ListValues>
<Value>DEBUG</Value>
</ListValues>
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\include</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</avrgcc.linker.libraries.Libraries>
<avrgcc.assembler.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\include</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
</AvrGcc>
<avrgcc.common.Device>-mmcu=atxmega256a3u -B "%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\gcc\dev\atxmega256a3u"</avrgcc.common.Device>
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols>
<ListValues>
<Value>DEBUG</Value>
</ListValues>
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\include</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize more (-O2)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</avrgcc.linker.libraries.Libraries>
<avrgcc.assembler.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\include</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>
......
......@@ -18,7 +18,7 @@
// results in 0.75MBaud
#define SYSTEM_BAUDA 3
#define SYSTEM_BAUDB 0
#define SYSTEM_NUM_UPS 6
#define SYSTEM_NUM_UPS 7
#define PACKUSB_NUM_STATICPACKETS 6
......@@ -35,7 +35,7 @@ uartport_t upU;
pin_t upUrxled; // don't exist
pin_t upUtxled;
atkport_t atkp5;
atkport_t atkp6;
// UP0
......@@ -97,6 +97,19 @@ pin_t up4txled;
atkport_t atkp4;
// UP 5
ringbuffer_t up5rbrx;
ringbuffer_t up5rbtx;
uartport_t up5;
pin_t up5rxled;
pin_t up5txled;
atkport_t atkp5;
// UPS
uartport_t *ups[SYSTEM_NUM_UPS];
......
......@@ -87,58 +87,66 @@ void uarts_init(void){
// UP USB (UP5)
rb_init(&upUrbrx);
rb_init(&upUrbtx);
pin_init(&upUrxled, &PORTB, PIN4_bm, 4, 1);
pin_init(&upUtxled, &PORTB, PIN5_bm, 5, 1);
pin_init(&upUrxled, &PORTC, PIN0_bm, 0, 1);
pin_init(&upUtxled, &PORTC, PIN1_bm, 1, 1);
uart_init(&upU, &USARTC0, &PORTC, PIN2_bm, PIN3_bm, &upUrbrx, &upUrbtx, &upUrxled, &upUtxled);
uart_start(&upU, SYSTEM_BAUDA, SYSTEM_BAUDB);
// UP0
rb_init(&up0rbrx);
rb_init(&up0rbtx);
pin_init(&up0rxled, &PORTE, PIN4_bm, 4, 1);
pin_init(&up0txled, &PORTE, PIN5_bm, 5, 1);
uart_init(&up0, &USARTE1, &PORTE, PIN6_bm, PIN7_bm, &up0rbrx, &up0rbtx, &up0rxled, &up0txled);
//PORTE.PIN7CTRL = PORT_SRLEN_bm;
pin_init(&up0rxled, &PORTF, PIN0_bm, 0, 1);
pin_init(&up0txled, &PORTF, PIN1_bm, 1, 1);
uart_init(&up0, &USARTF0, &PORTF, PIN2_bm, PIN3_bm, &up0rbrx, &up0rbtx, &up0rxled, &up0txled);
uart_start(&up0, SYSTEM_BAUDA, SYSTEM_BAUDB);
// UP1
rb_init(&up1rbrx);
rb_init(&up1rbtx);
pin_init(&up1rxled, &PORTE, PIN0_bm, 0, 1);
pin_init(&up1txled, &PORTE, PIN1_bm, 1, 1);
uart_init(&up1, &USARTE0, &PORTE, PIN2_bm, PIN3_bm, &up1rbrx, &up1rbtx, &up1rxled, &up1txled);
pin_init(&up1rxled, &PORTE, PIN4_bm, 4, 1);
pin_init(&up1txled, &PORTE, PIN5_bm, 5, 1);
uart_init(&up1, &USARTE1, &PORTE, PIN6_bm, PIN7_bm, &up1rbrx, &up1rbtx, &up1rxled, &up1txled);
uart_start(&up1, SYSTEM_BAUDA, SYSTEM_BAUDB);
// UP2
rb_init(&up2rbrx);
rb_init(&up2rbtx);
pin_init(&up2rxled, &PORTD, PIN4_bm, 4, 1);
pin_init(&up2txled, &PORTD, PIN5_bm, 5, 1);
uart_init(&up2, &USARTD1, &PORTD, PIN6_bm, PIN7_bm, &up2rbrx, &up2rbtx, &up2rxled, &up2txled);
pin_init(&up2rxled, &PORTE, PIN0_bm, 0, 1);
pin_init(&up2txled, &PORTE, PIN1_bm, 1, 1);
uart_init(&up2, &USARTE0, &PORTE, PIN2_bm, PIN3_bm, &up2rbrx, &up2rbtx, &up2rxled, &up2txled);
uart_start(&up2, SYSTEM_BAUDA, SYSTEM_BAUDB);
// UP3
rb_init(&up3rbrx);
rb_init(&up3rbtx);
pin_init(&up3rxled, &PORTD, PIN0_bm, 0, 1);
pin_init(&up3txled, &PORTD, PIN1_bm, 1, 1);
uart_init(&up3, &USARTD0, &PORTD, PIN2_bm, PIN3_bm, &up3rbrx, &up3rbtx, &up3rxled, &up3txled);
pin_init(&up3rxled, &PORTD, PIN4_bm, 4, 1);
pin_init(&up3txled, &PORTD, PIN5_bm, 5, 1);
uart_init(&up3, &USARTD1, &PORTD, PIN6_bm, PIN7_bm, &up3rbrx, &up3rbtx, &up3rxled, &up3txled);
uart_start(&up3, SYSTEM_BAUDA, SYSTEM_BAUDB);
// UP4
rb_init(&up4rbrx);
rb_init(&up4rbtx);
pin_init(&up4rxled, &PORTC, PIN4_bm, 4, 1);
pin_init(&up4txled, &PORTC, PIN5_bm, 5, 1);
uart_init(&up4, &USARTC1, &PORTC, PIN6_bm, PIN7_bm, &up4rbrx, &up4rbtx, &up4rxled, &up4txled);
pin_init(&up4rxled, &PORTD, PIN0_bm, 0, 1);
pin_init(&up4txled, &PORTD, PIN1_bm, 1, 1);
uart_init(&up4, &USARTD0, &PORTD, PIN2_bm, PIN3_bm, &up4rbrx, &up4rbtx, &up4rxled, &up4txled);
uart_start(&up4, SYSTEM_BAUDA, SYSTEM_BAUDB);
// UP5
rb_init(&up5rbrx);
rb_init(&up5rbtx);
pin_init(&up5rxled, &PORTC, PIN4_bm, 4, 1);
pin_init(&up5txled, &PORTC, PIN5_bm, 5, 1);
uart_init(&up5, &USARTC1, &PORTC, PIN6_bm, PIN7_bm, &up5rbrx, &up5rbtx, &up5rxled, &up5txled);
uart_start(&up5, SYSTEM_BAUDA, SYSTEM_BAUDB);
ups[0] = &up0;
ups[1] = &up1;
ups[2] = &up2;
ups[3] = &up3;
ups[4] = &up4;
ups[5] = &upU;
ups[5] = &up5;
ups[6] = &upU;
}
void atkps_init(void){
......@@ -147,7 +155,8 @@ void atkps_init(void){
atkport_init(&atkp2, 2, &up2);
atkport_init(&atkp3, 3, &up3);
atkport_init(&atkp4, 4, &up4);
atkport_init(&atkp5, 5, &upU);
atkport_init(&atkp5, 5, &up5);
atkport_init(&atkp6, 6, &upU);
}
int main(void)
......@@ -176,6 +185,7 @@ int main(void)
atkport_scan(&atkp3, 2);
atkport_scan(&atkp4, 2);
atkport_scan(&atkp5, 2);
atkport_scan(&atkp6, 2);
tck++;
if(!fastModulo(tck, 4096)){
......@@ -192,42 +202,50 @@ ISR(USARTC0_DRE_vect){
uart_txhandler(&upU);
}
ISR(USARTE1_RXC_vect){
ISR(USARTF0_RXC_vect){
uart_rxhandler(&up0);
}
ISR(USARTE1_DRE_vect){
ISR(USARTF0_TXC_vect){
uart_txhandler(&up0);
}
ISR(USARTE0_RXC_vect){
ISR(USARTE1_RXC_vect){
uart_rxhandler(&up1);
}
ISR(USARTE0_DRE_vect){
ISR(USARTE1_DRE_vect){
uart_txhandler(&up1);
}
ISR(USARTD1_RXC_vect){
ISR(USARTE0_RXC_vect){
uart_rxhandler(&up2);
}
ISR(USARTD1_DRE_vect){
ISR(USARTE0_DRE_vect){
uart_txhandler(&up2);
}
ISR(USARTD0_RXC_vect){
ISR(USARTD1_RXC_vect){
uart_rxhandler(&up3);
}
ISR(USARTD0_DRE_vect){
ISR(USARTD1_DRE_vect){
uart_txhandler(&up3);
}
ISR(USARTC1_RXC_vect){
ISR(USARTD0_RXC_vect){
uart_rxhandler(&up4);
}
ISR(USARTC1_DRE_vect){
ISR(USARTD0_DRE_vect){
uart_txhandler(&up4);
}
ISR(USARTC1_RXC_vect){
uart_rxhandler(&up5);
}
ISR(USARTC1_DRE_vect){
uart_txhandler(&up5);
}
\ No newline at end of file
images/routed.png

341 KB | W: | H:

images/routed.png

644 KB | W: | H:

images/routed.png
images/routed.png
images/routed.png
images/routed.png
  • 2-up
  • Swipe
  • Onion skin
images/schematic.png

534 KB | W: | H:

images/schematic.png

396 KB | W: | H:

images/schematic.png
images/schematic.png
images/schematic.png
images/schematic.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
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