Code for the book Making Things Talk is available online :
http://www.makershed.com/ProductDetails.asp?ProductCode=0596510519
Now, code for the example on Pg 59 is in the file called sensor_reader.
Set Realterm to ASCII to see a presentable display. I used just resistors (no flex) and moved the probe (analog Pin 0 or 1) around VDD and GND to see that max code is 1023 and min is 0. Tells you it's a 10 bit ADC - neat. The last character appears weird it must be said.
With a 1k to 5V and 10k to GND divider, I see codes ranging from 931 to 929 - 2 LSB's of p2p noise. About 10 mV of noise there p2p. That's within the ADC bandwidth. And what is that? Need to check the datasheet there. Gives an idea of the KT/C noise and the active device noise of the ADC? p2p noise is about 6x the rms noise?
Thursday, June 4, 2009
Arduino Serial Success
The big tip - screw what Igoe says - don't even look at Putty. Putty was busy with I don't know what when I clicked "Open" - not even a peep.
Go straight for Realterm - probably the best serial comm tool ever written.
Goes without saying - you can't have Realterm looking at your port and use the same port to write to the arduino simultaneously. You'll have to close the port in Realterm first - just press the button.
Go straight for Realterm - probably the best serial comm tool ever written.
Goes without saying - you can't have Realterm looking at your port and use the same port to write to the arduino simultaneously. You'll have to close the port in Realterm first - just press the button.
Wednesday, June 3, 2009
Arduino Interrupt Handling
This stuff worked very cleanly in MSP430. Problem is that people are doing a lot more basic stuff with Arduino at the moment so interrupts don't seem to have caught on just yet.
Anyhow, here's what I was trying to do :
Push the button and get the uC to play the Melody. Didn't work, so then I say just blink the LED. That also doesn't work.
This much I see :
(stuff you have to know is that every program in Arduino has a "setup()" and a "loop()")
I light up the pin 13 LED within loop.
Then, I set the ISR to clear the LED, delay and the light it up again.
Doesn't work - all I see is it clears the LED. Come on, this is really simple.
Then, Lefty tells me that you can't use delay within your ISR.
WTH!!
The goal, BTW, is to get through Igoe's book. Great guy - saw him at Maker Faire. Seems to have done everything I want to do. Now, while the economy's got me down is the time.
Anyhow, 11:35 at night, nailed the interrupt thing - can play Melody at the press of a buton. Now, to try out one serial example from Igoe's book and call it a day.
Anyhow, here's what I was trying to do :
Push the button and get the uC to play the Melody. Didn't work, so then I say just blink the LED. That also doesn't work.
This much I see :
(stuff you have to know is that every program in Arduino has a "setup()" and a "loop()")
I light up the pin 13 LED within loop.
Then, I set the ISR to clear the LED, delay and the light it up again.
Doesn't work - all I see is it clears the LED. Come on, this is really simple.
Then, Lefty tells me that you can't use delay within your ISR.
WTH!!
The goal, BTW, is to get through Igoe's book. Great guy - saw him at Maker Faire. Seems to have done everything I want to do. Now, while the economy's got me down is the time.
Anyhow, 11:35 at night, nailed the interrupt thing - can play Melody at the press of a buton. Now, to try out one serial example from Igoe's book and call it a day.
Arduino Here I Come
Okay, MSP430 sucks, Atmel rules. Yesterday was day one. BTW, Atmel and Arduino rule the Maker Faire (no one mentions Atmel of course). I asked on Dallas guy at the MF if he's considered MSP430 and he said no. No way.
Anyhow, we put Arduino on a Compaq running XP yesterday and the performance was pretty crappy. You click the Tool menu and wait about half a minute.
At some point, we're going to get some smart CS people from Eastern Europe to fix this. Italy doesn't seem to cut it yet.
Anyhow, we put Arduino on a Compaq running XP yesterday and the performance was pretty crappy. You click the Tool menu and wait about half a minute.
At some point, we're going to get some smart CS people from Eastern Europe to fix this. Italy doesn't seem to cut it yet.
Wednesday, March 11, 2009
User Guide
Thanks, that helps. One thought - is there a compiler feature that can tell the user what clocks will be active with the program he has written and what current consumption he can expect? Users, like me, who are novices are more interested in creating apps than in optimizing them. Later, when we start thinking about optimization, we would want to know where the ducks are to shoot. Such a feature in the compiler might make the MSP430 more marketable. It might already exist.
Replying to:
Execution will suspend immediately. Code execution will pickup immediately after the device is awakened. So the lines of code will execute after the device wakes back up. The operating modes are described in Chapter 2 of the Family User s Guide. You can download this from the following link:
http://focus.ti.com/mcu/docs/mcuprodtechdoc.tsp?sectionId=95&tabId=1201&familyId=342&techDoc=6&documentCategoryId=6
Please let me know if you need further assistance.
Regards,
If you have further questions please reply to this email. And see the MCU Knowledge Base located at http://www-k.ext.ti.com/sc/technical-support/mcu-kbase
-----Original Message-----
Sent: 3/9/2009 05:45:43 PM
To: support@ti.com
Subject: eZ430-RF2500 demo app question
I am using this product from TI. My question is about the MSP430. What happens when the following line is encountered by the execution unit?
__bis_SR_register(LPM3_bits+GIE); // LPM3 with interrupts enabled
does it suspend operation immediately and go into a low power mode or does it finish execution of the current program before going into LPM3?
If it suspends execution immediately, how does it make sense to suspend execution during a program containing :
SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_SLEEP, "" );
__bis_SR_register(LPM3_bits+GIE); // LPM3 with interrupts enabled
SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_AWAKE, "" );
or even :
while (SMPL_SUCCESS != SMPL_Link(&linkID1))
{
__bis_SR_register(LPM3_bits + GIE); // LPM3 with interrupts enabled
BSP_TOGGLE_LED1();
BSP_TOGGLE_LED2();
}
In these examples, we say go into LPM3 and then we ask it to do other things. Does execution of the program pick up where it left off? Is there an online location I can find answers to such questions?
Replying to:
Execution will suspend immediately. Code execution will pickup immediately after the device is awakened. So the lines of code will execute after the device wakes back up. The operating modes are described in Chapter 2 of the Family User s Guide. You can download this from the following link:
http://focus.ti.com/mcu/docs/mcuprodtechdoc.tsp?sectionId=95&tabId=1201&familyId=342&techDoc=6&documentCategoryId=6
Please let me know if you need further assistance.
Regards,
If you have further questions please reply to this email. And see the MCU Knowledge Base located at http://www-k.ext.ti.com/sc/technical-support/mcu-kbase
-----Original Message-----
Sent: 3/9/2009 05:45:43 PM
To: support@ti.com
Subject: eZ430-RF2500 demo app question
I am using this product from TI. My question is about the MSP430. What happens when the following line is encountered by the execution unit?
__bis_SR_register(LPM3_bits+GIE); // LPM3 with interrupts enabled
does it suspend operation immediately and go into a low power mode or does it finish execution of the current program before going into LPM3?
If it suspends execution immediately, how does it make sense to suspend execution during a program containing :
SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_SLEEP, "" );
__bis_SR_register(LPM3_bits+GIE); // LPM3 with interrupts enabled
SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_AWAKE, "" );
or even :
while (SMPL_SUCCESS != SMPL_Link(&linkID1))
{
__bis_SR_register(LPM3_bits + GIE); // LPM3 with interrupts enabled
BSP_TOGGLE_LED1();
BSP_TOGGLE_LED2();
}
In these examples, we say go into LPM3 and then we ask it to do other things. Does execution of the program pick up where it left off? Is there an online location I can find answers to such questions?
Monday, March 9, 2009
Surprise! P1DIR and Port_1 ISR
You can't use the push button on P1.2 of the eZ430-RF2500 to generate an interrupt if you have bit 2 of P1DIR set. Nice.
And, BSP_init() - though supposedly a utility, will mess this up. So watch out.
And, BSP_init() - though supposedly a utility, will mess this up. So watch out.
Sunday, March 1, 2009
Stage 3 - Day 2 ATR
Okay, the documentation is horrendous, but, still, kudos to the TI team for atleast putting something together that works. I think they have what it takes to send TXN soaring. But, it'll have to be a team effort.
In the demo app for the eZ430-RF2500, they're using a timer interrupt to wake the chip up and run the join-network, etc. Okay, figured that part out. Also, there's a lot of undocumented stuff scattered around like
__bis_SR_register(LPM3_bits + GIE); // LPM3 with interrupts enabled
without it being really easy to find out what the effect of this will be. Now, if they had a PDF of the source code with hyperlinks... ummm.
In the demo app for the eZ430-RF2500, they're using a timer interrupt to wake the chip up and run the join-network, etc. Okay, figured that part out. Also, there's a lot of undocumented stuff scattered around like
__bis_SR_register(LPM3_bits + GIE); // LPM3 with interrupts enabled
without it being really easy to find out what the effect of this will be. Now, if they had a PDF of the source code with hyperlinks... ummm.
Subscribe to:
Posts (Atom)