smckown [Wed, 5 Aug 2009 02:57:10 +0000 (02:57 +0000)]
tmirws sets outputs going to cp2103 to low (zero) by default.
If any of these drive a high value toward the cp2103, the cp2103 is not
connected to USB power, and VIO is disconnected from Vuc, then funky things
happen that can cause GPIO_3, tied to !UC_RST, to sink current and cause the
uC to go into reset. Similar bad behavior can happen with !USB_SUSPEND.
smckown [Wed, 5 Aug 2009 02:57:08 +0000 (02:57 +0000)]
Reorganize scp1000 driver code.
The Scp1000P module now only uses GeneralIO and is not tied to anything msp430
specific. The msp430 specific bits are in the platform dependent file
Scp1000PinsP.
smckown [Wed, 5 Aug 2009 02:57:07 +0000 (02:57 +0000)]
Move weather instrument sensors code out of TOSDIR/chips, as they aren't.
For now, we'll place them in TOSDIR/platforms/tmirws/sensors. Also, renamed
are the OwwSpeed files, to Anemometer, and OwwVane files to WindVane, as these
names better reflect the fact that the code isn't all that OWW or Davis
specific.
smckown [Sun, 10 May 2009 00:00:32 +0000 (00:00 +0000)]
This change is required to remove async warnings in the phase2 app.
Need to look into this closer. This doesn't make sense, as the sporian0010_02
platform, which uses the usart SPI peripheral, doesn't generate these errors
and that peripheral's SpiPacket.sendDone() doesn't specifically signal
atomically.
smckown [Fri, 8 May 2009 22:27:16 +0000 (22:27 +0000)]
Return a real error code and actual bytes written in SpiPacket.sendDone.
Be careful with this one. The usart SPI peripheral always returned the length
it was given and an error of SUCCESS, so this could create some regressions.
smckown [Fri, 8 May 2009 22:27:14 +0000 (22:27 +0000)]
Implement chip select query for SPI peripheral.
If the SPI peripheral is in slave mode, a transaction could be halted at any
time by the host unasserting (high) the chip select line. This code implements
a check on chip select to allow SPI slaves to see the early abort and act
accordingly.
This reverts commit 50fa36081d963e9da0c4544d753e77c53c1b0ac8 (svn r152). With
PxREN manipulation in usci/Msp430SpiP, the phase2 app does not send packets to
the gateway.
Per the TI datasheet, PxREN bits shouldn't be set at the same time as the
corresponding PxSEL (module function) bits as unintended current consumption
could be triggered.
smckown [Sun, 12 Oct 2008 22:05:44 +0000 (22:05 +0000)]
Start a davis anemometer 'chip' directory from the one for oww. These two
components actually share a good deal of information, especially the
interfaces.
Don't leave the iopin attached to the sht1x SCK pin floating when the
controlling Resource is released. Also, set the DATA pin in a manner
consistent with the fact that it is a pulled-up line by default, either
via an external resistor or one internal to the uC.
sht11 support for tmirws. Currently uses an open drain adapter that relies
on the msp430's internal pull up/down resistors. Some cleanup may be required.
Turn on TimerA. This is done for all other msp430 platforms, so we want to
be consistent for now. A better solution is resource management to decide
when the timers need to run so they can be off when not needed to safe
power.
Clean up pin configuration for peripheral code. Here's the best practice
for platforms. MotePlatformC defines pins, using also the new PxREN feature,
such that the peripheral pins are inputs with pull up/down's, or outputs, as
required to meet the electrical characteristics when the peripheral is not on.
In the peripheral's implementation of ResourceConfigure, it sets module
function on configure() and sets back to IO funtion on unconfigure(), but
only if the pin was set to IO mode when configure() was called. This latter
condition allows a MotePlatformC to set peripheral mode on for pins that will
always be used for peripheral function, and the modes won't switch around.
Msp430ClockC must pull in Msp430TimerC to attach the default Timer.overflow()
for both Timers A and B. This was inadvertently removed recently not realizing
its importance.
For tmicore platform, remove unused pin defs in hardware.h and add PxREN
initialization to MotePlatformC. Set unused pins to be input with pull-up.
This should be far safer in terms of possible short events that setting
unused pins to outputs, since tmicore has an expansion header.
The AT25DF part is not compatible with the AT45DB nor the STM25P, apparently.
It is quite close to the STM25P, but mapping the chip to that code failed to
get good results using the tests/storage/Block application. However, the
part does work correctly with a test application written directly to its SPI
API.
Added SPI support. Now working using the loopback feature (UCLISTEN bit).
Also fixed a relocation error problem due to packed structures and placement
of instantiations in text page via "const static ...". No change to text
or data page sizes at compilation. Since msp430_usci_xxx_t will never be on
the stack, removal of the packed attribute was the way to work around what
appears to be a compiler problem.
Move the clock components back into msp430/timer. It appears that supporting
the new basic clock module+ is so straightforward we don't need to separate it
out. Moving things back reduces change to the main tree, making it more likely
for the changes to be accepted.
Make Msp430ClockC a generic so that the target DCO clock and the ACLK can be
passed in as instantiation variables. This provides a more TinyOS savvy
mechanism to set desired clocks as opposed to the prior method which involved
overriding macros defined in Msp430DcoSpec.h. This and other enhancements to
the clock initialization has also slightly reduced executable sizes. Below
is the Blink application from TinyOS 2.1.0, compiled with the plain vanilla
2.1.0 and with the clock init modifications for all msp430 platforms in the
standard distribution:
Proper support for the new basic_clock+ peripheral. Default UART baud rate is
115200, 8 data bits, no parity, 1 stop bit. tmicore overrides the default MCLK
setting of 4MHz (binary) in favor of 8MHz (binary). The updated clock init
code ensures SMCLK is 1MHz (binary) when DCOCLK is 1MHz, 2MHz, 4MHz or 8MHz.
The msp430 now has two basic clock peripherals. Add tos/chips/msp430/clock and
move basic clock and clock configuration files from timer to clock directories.
Update .platform files accordingly.
Let's let the compiler type system work for us. Instead of having a single
msp430_usci_config_t that is a union of the types for each mode, instead we
now have separate types.
Replace the special-purpose Msp430UsciConfigure interface with the
parameterized AsyncConfigure interface. Too bad that this interface doesn't
exist in standard TOS.
Update the tmicore platform's clock initialization. If DCO constants are in
INFOA, it uses them. If not, is uses the standard mecthod of calibrating the
DCO off of ACLK. For tmicore, DCOCLK = MCLK = 8MHz. We add additional code to
set SMCLK = 1MHz. If the constants are used, the 1MHz = 10^6HZ. If the
internal cal routines are used, 1MHz = 2^20Hz.
Add getOut() and getOutRaw() methods. get() and getRaw() work off PORTxIN.
But there are times when PORTxIN and PORTx (PxOUT) may be different, such as
is the case when using pull-up or pull-down resistors via PORTxREN (PxREN)
available on newer msp430's.
New msp430 features: (1) support pull-up/pull-down resistors on newer parts
via an enhancement to Msp430HplGeneralIOC. (2) use newer mspgcc definitions
for a more generic ifdef'ed inclusion of interfaces in Msp430HplGeneralIOC.
Initial definition support in Msp430HplGeneralIOC for USCI peripherals.