-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minimal Z1 commit, MSP430 support x1 and x2 processors.
Collapse duplicate Z1 MSP430 files. Add support for new TI_HEADERS. Simple tests done with old 3.2.3 Z1 toolchain and new mspgcc4 (4.4.5) with TI_HEADERS.
- Loading branch information
Showing
80 changed files
with
6,764 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.[oa] | ||
*~ | ||
build | ||
#*# | ||
.#* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
|
||
* fix copyrights | ||
|
||
* apps/IPBaseStation: defines a reset in a particularily ugly way. Needs to be | ||
fixed and mad part of the platform/cpu definition. | ||
fixed and made part of the platform/cpu definition. | ||
|
||
* What is the purpose of msp430regtypes.h? Is there a easier way to deal with this? | ||
|
||
* There are multiple copies of msp430hardware.h. Is that reasonable? | ||
|
||
* i2c for msp430 isn't done yet. needs to be cleaned up and made less ugly. Interface | ||
needs to be finished. | ||
|
||
* CC2420 modules use LocalIeeeEui64C to obtain an ipv6 link-local address. Z1 needs to | ||
provide. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
|
||
This directory contains interface files for the TI msp430 family of CPUs. | ||
The TI architecture is rather scattered and the cpu interface to major | ||
pieces reflects this. The main problem areas include: peripheral registers, | ||
interrupts, and interrupt vectors. | ||
|
||
Care should be taken to minimize duplicates while maintaining the minimum implementation | ||
that reflects the cpus currently supported by TinyOS. This should be done in a way | ||
that minimizes impact on existing implementations (be backward compatible). See the | ||
file 01_Dependencies for what CPUs are supported and the cpu dependencies. | ||
|
||
Where reasonable, conflicting areas are kept in a flat file and differences are | ||
#ifdef'd. When this becomes too cumbersome, different interface definitions and | ||
implementations are placed into cpu family directories and the interface to | ||
the reset of the tinyos os is shadowed. The correct directory needs to be | ||
specified in the .platform file. | ||
|
||
Most of the cpu definitions are obtained automatically via the toolchain, ie. the -mmcu | ||
specification automatically included the appropriate cpu header file. ie. -mmcu=msp430x2618 | ||
causes the msp430f2618.h include file to be invoked. | ||
|
||
The TI MSP430 family has many variants. There is a main cpu core and various integrated peripherals on | ||
chip. What a given chip includes is spelled out by the included chip definition file automatically | ||
included via the -mmcu mechanism. | ||
|
||
The tinyos interface is spit into several sections: | ||
|
||
msp430hardware.h and msp430regtypes.h define various other attributes that interface the cpu | ||
to the tinyos environment. These files coupled with the chip definition file define the cpu | ||
and other capabilities available. | ||
|
||
The original architecture, the MSP430, provides 16 bit addresses. A subsequent revision denoted | ||
MSP430X modifies the cpu and addressing to provide 20 bit addresses. Backward compatibilty to the | ||
MSP430 was considered. A further modification is denoted the MSP430XV2 but it is unclear exactly | ||
what this modified. | ||
|
||
Several directories are available that provide the drivers for the specified peripheral. Presence | ||
of the peripheral can be detected by checking appropriate values in the chip definition file. These | ||
directories are: | ||
|
||
adc12: Most MSP430 chips include a 12 bit analog to digital converter. | ||
|
||
dma: 3 or 8 independent dma channels are provided. MSP430X cpus can address 20 bits via the DMA | ||
engines. 20 bits increases the overhead significantly and should only be used if really | ||
needed. ie. Most cpus only provide RAM in the lower 64K so there really isn't much need | ||
for 20 bit addresses, unless one is DMAing out of high memory (ROM). | ||
|
||
Currently, only a 16 bit dma interface is provided. In the future a dma32 interface could | ||
be defined to provide access to the full 20 bits of addressing. | ||
|
||
pins: interface to digital I/O. | ||
|
||
sensors: interfaces to on chip internal temperature and voltage sensors. | ||
|
||
timer: interface to on chip timing mechanisms. Timers and Alarms. | ||
|
||
usart: interface to original UART/SPI/I2C on MSP430 parts. (1st generation). | ||
|
||
usci: interface to USCI modules UART/SPI/I2C on MSP430X and later parts. | ||
|
||
|
||
|
||
CPU Families: | ||
|
||
When it is too cumbersome to maintain a flat file that includes #ifdef'd difference for each of | ||
the different variants, it is useful to seperate common interfaces into cpu family dependent family | ||
files that provide various TinyOS interfaces. | ||
|
||
The following families and what cpus are supported are listed below. When a new cpu is added to TinyOS | ||
support, it can first be isolated and supported independently. When commonalities are understood, any | ||
duplication can be removed and subsumed into a flat file via #ifdef's as appropriate. Any remaining | ||
interfaces that are too cumbersome, can be supported by an existing cpu family interface or a new family | ||
can be defined as appropriate. The intent is to provide a mechanism that allows gradual refactorization as | ||
new cpus are brought into the fold. | ||
|
||
The following families currently exist. Included are what cpus have been verified. Only add cpus that | ||
have actually been instantiated. | ||
|
||
x1xxx: msp430f1611, msp430f149 | ||
telos{a,b}, epic, eyesIFXv1, eyesIFXv2, shimmer{,2,2r}, span, tinynode | ||
|
||
x2xxx: msp430f2617, msp430f2618, msp430f2619 | ||
Z1, MM4 (mam-mark mote) | ||
|
||
x5xxx: cc430f5137, msp430f5438{,a} | ||
surf, ev430, mm5 (mam-mark mote) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
|
||
CPU families: | ||
|
||
We currently define 3 cpu families that group similar TI msp430 chips together. Two chips | ||
can be grouped together if for that module or interface the behaviour is the same. | ||
|
||
The main family is simply "msp430" and whenever possible we endevour to put everything we can into the | ||
generic msp430 directory. This is the top level. However when it becomes too cumbersome to make | ||
this fit for a given functionality, it may be necessary to split a new cpu out into one of the family | ||
directories. These are subdirectories off msp430, ie. msp430/x1xxx and are selected by the .platform | ||
file for a platform. | ||
|
||
Currently what differentiates the different family directories is interrupt behaviour, peripheral | ||
register mapping, low power behaviour. | ||
|
||
|
||
CPUs supported: | ||
|
||
x1xxx: msp430f149, msp430f1611 | ||
x2xxx: msp430f261{6,7,8,9} | ||
x5xxx: cc430f513{7,8,8a} | ||
|
||
|
||
Interrupt Vectors: | ||
|
||
x1xxx vectors: (149, 1611) x2xxx vectors: (msp430f261{6,7,8,9}) | ||
|
||
14 DAC12_VECTOR | ||
15 DMA_VECTOR | ||
0xFFE0 0 DACDMA_VECTOR (1611 only) 16 USCIAB1TX_VECTOR | ||
0xFFE2 1 PORT2_VECTOR 17 USCIAB1RX_VECTOR | ||
0xFFE4 2 USART1TX_VECTOR 18 PORT1_VECTOR | ||
0xFFE6 3 USART1RX_VECTOR 19 PORT2_VECTOR | ||
0xFFE8 4 PORT1_VECTOR 20 RESERVED20_VECTOR | ||
0xFFEA 5 TIMERA1_VECTOR Timer A CC1-2 21 ADC12_VECTOR | ||
0xFFEC 6 TIMERA0_VECTOR Timer A CC0 22 USCIAB0TX_VECTOR | ||
0xFFEE 7 ADC12_VECTOR 23 USCIAB0RX_VECTOR | ||
0xFFF0 8 USART0TX_VECTOR 24 TIMERA1_VECTOR Timer A CC1-2 | ||
0xFFF2 9 USART0RX_VECTOR 25 TIMERA0_VECTOR Timer A CC0 | ||
0xFFF4 1 WDT_VECTOR 26 WDT_VECTOR | ||
0xFFF6 1 COMPARATORA_VECTOR 27 COMPARATORA_VECTOR | ||
0xFFF8 1 TIMERB1_VECTOR Timer B CC1-6 28 TIMERB1_VECTOR Timer B CC1-6 | ||
0xFFFA 1 TIMERB0_VECTOR Timer B CC0 29 TIMERB0_VECTOR Timer B CC0 | ||
0xFFFC 1 NMI_VECTOR 30 NMI_VECTOR | ||
0xFFFE 15 RESET_VECTOR 31 RESET_VECTOR | ||
|
||
|
||
x5xxx vectors: (msp430f543{5,6,7,8}{,a}, cc430f5137) | ||
|
||
543{5,6,7,8}{,a} cc430f5137 | ||
0xFFD2 41 RTC_VECTOR | ||
0xFFD4 42 PORT2_VECTOR | ||
0xFFD6 43 USCI_B3_VECTOR | ||
0xFFD8 44 USCI_A3_VECTOR | ||
0xFFDA 45 USCI_B1_VECTOR 45 AES_VECTOR | ||
0xFFDC 46 USCI_A1_VECTOR 46 RTC_VECTOR | ||
0xFFDE 47 PORT1_VECTOR | ||
0xFFE0 48 TIMER1_A1_VECTOR Timer1_A3, CC1-2 48 PORT2_VECTOR | ||
0xFFE2 49 TIMER1_A0_VECTOR Timer1_A3, CC0 49 PORT1_VECTOR | ||
0xFFE4 50 DMA_VECTOR 50 TIMER1_A1_VECTOR Timer1_A3 CC1-2 | ||
0xFFE6 51 USCI_B2_VECTOR 51 TIMER1_A0_VECTOR Timer1_A3 CC0 | ||
0xFFE8 52 USCI_A2_VECTOR 52 DMA_VECTOR | ||
0xFFEA 53 TIMER0_A1_VECTOR Timer0_A5 CC1-4 53 CC1101_VECTOR | ||
0xFFEC 54 TIMER0_A0_VECTOR Timer0_A5 CC0 54 TIMER0_A1_VECTOR Timer0_A5 CC1-4 | ||
0xFFEE 55 ADC12_VECTOR 55 TIMER0_A0_VECTOR Timer0_A5 CC0 | ||
0xFFF0 56 USCI_B0_VECTOR 56 ADC12_VECTOR | ||
0xFFF2 57 USCI_A0_VECTOR 57 USCI_B0_VECTOR | ||
0xFFF4 58 WDT_VECTOR 58 USCI_A0_VECTOR | ||
0xFFF6 59 TIMER0_B1_VECTOR Timer0_B7 CC1-6 59 WDT_VECTOR | ||
0xFFF8 60 TIMER0_B0_VECTOR Timer0_B7 CC0 60 COMP_B_VECTOR | ||
0xFFFA 61 UNMI_VECTOR 61 UNMI_VECTOR | ||
0xFFFC 62 SYSNMI_VECTOR 62 SYSNMI_VECTOR | ||
0xFFFE 63 RESET_VECTOR 63 RESET_VECTOR | ||
|
||
|
||
1) Vectors move to various addresses dependent on what cpu you are using. (This is taken care of by | ||
proper usage of the cpu header files. | ||
|
||
2) Depending on family, vectors are shared across function. This complicates things and is ugly. | ||
|
||
ie. x1xxx vector 0 is DACDMA (shared with DAC and DMA) but on the x2xxx and x5xxx families DMA | ||
has its own vector and no DAC vector (no DAC). | ||
|
||
Worse yet is the sharing of vectors for the USCI on the x2xxx parts. A vector is provided for | ||
USCIAB0TX_VECTOR which is shared across both the A side and B side of the USCI which typically | ||
can be operated in very different modes. This has been cleaned up in the x5xxx series parts. | ||
|
||
|
||
Addressing: | ||
|
||
The x1xxx family supports 16 bit addressing, x2xxx and x5xxx support 20 bit addresses. | ||
|
||
x2xxx family parts define __MSP430_HAS_MSP430X_CPU__ | ||
x5xxx family parts define __MSP430_HAS_MSP430XV2_CPU__ | ||
|
||
Either __MSP430_HAS_MSP430X_CPU__ or __MSP430_HAS_MSP430XV2_CPU__ indicates the potential | ||
for 20 bit addresses. Whether 20 bit addresses are being used depends on what switches | ||
are passed to the toolchain. | ||
|
||
|
||
ADC12: | ||
|
||
The adc12 module is supported on x1xxx, x2xxx, and x5xxx parts. ADC12_VECTOR is defined and | ||
the module behaves the same for all supported families. No special support needs to be | ||
provided. | ||
|
||
|
||
DMA: | ||
|
||
1) Addressing. The x1xxx family only supports 16 bit addresses. The x2xxx and x5xxx support | ||
20 bit addresses. | ||
|
||
x1xxx family parts define __MSP430_HAS_DMA_3__ (16 bit addresses, 3 channels). | ||
x2xxx, x5xxx family parts define __MSP430_HAS_DMAX_3__ (20 bit addresses, 3 channels). | ||
|
||
DMAX modules provide 2 16-bit address objects for each DMA address needed. (20 bit defined) | ||
The lower 16 bit object is equivilent to a DMA address on a non-DMAX module. When this lower | ||
object is written the upper is automatically zeroed. This provides backward compatibility | ||
for drivers written for non-DMAX modules. These drivers will work fine with DMAX modules | ||
when accessing the lower 64K of memory. | ||
|
||
2) DMA Transfer select. Transfer select fields determine what a DMA engine (channel) should | ||
use to initiate a transfer cycle. These fields maybe 4 or 5 bits wide and the driver needs | ||
to know how to construct an appropriate control word when interacting with the h/w. | ||
|
||
|
||
3) Interrupt vector: | ||
|
||
On the x1xxx family, the vector is named DACDMA_VECTOR and other families use DMA_VECTOR. | ||
|
||
The driver uses either DACDMA_VECTOR or DMA_VECTOR if defined. Otherwise complains about lack of | ||
support. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,4 +98,3 @@ implementation { | |
Dma2.Interrupt -> HplMsp430DmaP; | ||
|
||
} | ||
|
Oops, something went wrong.