Atmel SAM Approach » History » Version 8
laforge, 01/13/2020 11:30 AM
1 | 1 | laforge | h1. Atmel SAM Approach |
---|---|---|---|
2 | |||
3 | This page describes a proposed approach of implementing the E1 adapter using [[osmo-e1-xcvr]] and an Atmel SAMx microcontroller, suhc as a SAM3S or SAM4S. |
||
4 | |||
5 | 3 | laforge | * "SAM3S Manual":http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6500-32-bit-Cortex-M3-Microcontroller-SAM3S4-SAM3S2-SAM3S1_Datasheet.pdf (64 MHz Cortex-M3) |
6 | 2 | laforge | * "SAM4S Manual":http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11100-32-bit%20Cortex-M4-Microcontroller-SAM4S_Datasheet.pdf (120 MHz Cortex-M4) |
7 | |||
8 | 1 | laforge | h2. Overview |
9 | |||
10 | 8 | laforge | {{graphviz_link() |
11 | digraph G { |
||
12 | rankdir = LR; |
||
13 | uC [label="SAM4S uC"]; |
||
14 | XFMR [label="Magnetics"]; |
||
15 | BTS -> XFMR [label="E1"]; |
||
16 | subgraph cluster_A { |
||
17 | label = "Software Defined E1 Adapter"; |
||
18 | XFMR -> LIU [label="E1 (HDB3)"]; |
||
19 | LIU -> uC [label="E1 (Serial Bits)"]; |
||
20 | } |
||
21 | uC -> Linux [label="Frame-aligned raw\nbits over USB"]; |
||
22 | } |
||
23 | }} |
||
24 | |||
25 | 1 | laforge | * the SAM controls the LIU via SPI |
26 | * the SAM attaches to the host via USB |
||
27 | * The SAM *SSC Peripheral* is used to interface to the receive + transmit bit-streams of the LIU |
||
28 | * The SAM3 *TC Peripheral* is used for Rx frame alignment |
||
29 | |||
30 | h2. Serializing/Deserializing |
||
31 | |||
32 | * SSC can receive/transmit synchronous serial bit streams with external or internal clock |
||
33 | * SSC supports DMA operation between the (de)serializer and RAM using PDC (peripheral DMA controller) |
||
34 | * SSC can run either |
||
35 | ** continously (frame alignment done in software [possibly using bit-banding], as no octet alignment of frames), or |
||
36 | ** triggered by RF input, which we supply from SSC (see below) with hardware-assisted frame alignment |
||
37 | |||
38 | h2. Frame Alignment using TC (Timer/Counter) |
||
39 | |||
40 | The idea is to use one of the TC units to perform hardware-assisted frame alignment and this way prevent us from having to do tons of bit-shifting in software in order to align the start of the 256 bit E1 frame with an octet boundary. |
||
41 | |||
42 | * received clock is fed into TCLKx |
||
43 | * internal 16-bit counter is set to count up to 256 (one frame duration) |
||
44 | * TC is operated in WAVEFORM mode |
||
45 | * TIOA or TIOB are operated as output routed to the SSC RF (receive frame) input |
||
46 | * Ra/Rb/Rc registers are used to shift the rising and falling edge of the TIOA/TIOB signal within the 256bit frame |
||
47 | 4 | laforge | |
48 | h2. Transmit side |
||
49 | |||
50 | The transmit side is rather simple: |
||
51 | * use either recovered Rx clock or locally-generated clock (from GPS-DO) |
||
52 | * serialize the bits with no particular alignment requirements, as it's entirely up to the receiver to align to the frames we send |
||
53 | 5 | laforge | |
54 | h2. Eval boards |
||
55 | |||
56 | 6 | laforge | For initial development and evaluation of this approach, we used SAM4S evaluation boards connected to the [[osmo-e1-xcvr]] board. |
57 | |||
58 | 5 | laforge | We need access to PA16 (TK), PA17 (TD), PA18 (RD), PA19 (RK). |
59 | |||
60 | * "SAM4S-XPRO":http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42075-SAM4S-Xplained-Pro_User-Guide.pdf |
||
61 | ** exposes SSC I/O (stated above) signals on external headers |
||
62 | ** contains built-in JTAG/SWD debugger for development + flashing |
||
63 | ** exposes SPI on external header (control of [[osmo-e1-xcvr]]) |
||
64 | 6 | laforge | |
65 | 7 | laforge | This is a picture from a development prototype using the [[osmo-e1-xcvr]] connected to a SAM4-XPRO: |
66 | |||
67 | !{width:50%}e1-xcvr-xpro.jpg! |
||
68 | |||
69 | 6 | laforge | h2. Circuit board design |
70 | |||
71 | @vogelchr has done a circuit board design, it can be found at https://github.com/vogelchr/e1_sam4_usb |
||
72 | 7 | laforge | |
73 | !{width:50%}usb-e1-interface.jpg! |
||
74 | 6 | laforge | |
75 | h2. Firmware |
||
76 | |||
77 | @vogelchr has done firmware development at https://github.com/vogelchr/e1_sam4_usb_fw, while @laforge has also done similar developments at http://git.osmocom.org/atmel-asf-projects/ |
||
78 | |||
79 | h2. Status |
||
80 | |||
81 | Both the evalboard and the @e1_sam4_usb@ circuit board design have been validated. The firmware has been validated with some PRBS tests. |