
Terenceang
-
Content Count
30 -
Joined
-
Last visited
Reputation Activity
-
-
Terenceang got a reaction from Jigar4Electronics in newbie question! how do I use UARTprintf with floats?
wow!!!
-
Terenceang got a reaction from timotet in Stellaris LaunchPad IMU.
Hi Tim,
add an event counter in the breakpoint window and set breakpoint between the instructions you want to count, enable and disable the counter to reset.
you can find the instructions in the FPU lab segment in the Stellaris tutorial,
Cheers,
Terence.
-
Terenceang got a reaction from bluehash in Stellaris LaunchPad IMU.
the IMU is working and pretty stable.
but the motion seem to have some dampening effect at the end, if you bank 45 degrees, it will go to 40 degree then slowly go to 45... have to study more to figure out why.. maybe the sampleing rate or some time related maths.
code is updated!!
-
Terenceang reacted to jon1426459908 in Stellaris LaunchPad IMU.
Is it stable before the Euler conversion?
http://www.diydrones.com/forum/topics/madgwick-imu-ahrs-and-fast-inverse-square-root
http://stackoverflow.com/questions/5577334/strange-behavior-with-android-orientation-sensor/5578867#5578867
-
Terenceang got a reaction from chicken in Stellaris LaunchPad IMU.
This is a project for me to learn programming on the Stellaris, with tons of materials, support from TI, this and other forums, I managed to get a working port going for this project.
I ported part of the FreeIMU library to the Stellaris Launchpad, just enough to support the GY-80 that I have in my "gadget box".
GY-80 consist of 4 sensors, L3G4200D (Gryo), ADXL345 (Acc), HMC5883L (Mag) and BMP085 (Baro). This is a cheap sensor board that is readily available on ebay or your favourite Chinese online store.
What is working?
Reading and writing to the sensors by i2c bus (thanks to the code from "aBUGSworstnightmare").
calibration routine works but it is not saved to EEPROM.
Basically it display the Roll, Pitch, Yaw, compass heading and all sensor's Raw data thru the Uart Console (I am using BT on UART1, change it to UART0 for ICDI port.)
Overall it is still buggy and I still cannot reset the Roll setting.
Todo.
1. save calibration data to EEPROM.
2. host software for graphical representation of data.
3. fix bugs.
As I am a RC fan, it will be thrilling to see the Stellaris on a Quadcopter, if this goes well, I will go on develop it further, with newer gens of sensors.
I dont know if I can pull it off or not, hopefully someone else can either help or work on it.
The project is up on google code, anyone interested to work on it, please let me know.
https://code.google.com/p/stellaris-lp-imu/
-
Terenceang got a reaction from Fred in Stellaris LaunchPad IMU.
This is a project for me to learn programming on the Stellaris, with tons of materials, support from TI, this and other forums, I managed to get a working port going for this project.
I ported part of the FreeIMU library to the Stellaris Launchpad, just enough to support the GY-80 that I have in my "gadget box".
GY-80 consist of 4 sensors, L3G4200D (Gryo), ADXL345 (Acc), HMC5883L (Mag) and BMP085 (Baro). This is a cheap sensor board that is readily available on ebay or your favourite Chinese online store.
What is working?
Reading and writing to the sensors by i2c bus (thanks to the code from "aBUGSworstnightmare").
calibration routine works but it is not saved to EEPROM.
Basically it display the Roll, Pitch, Yaw, compass heading and all sensor's Raw data thru the Uart Console (I am using BT on UART1, change it to UART0 for ICDI port.)
Overall it is still buggy and I still cannot reset the Roll setting.
Todo.
1. save calibration data to EEPROM.
2. host software for graphical representation of data.
3. fix bugs.
As I am a RC fan, it will be thrilling to see the Stellaris on a Quadcopter, if this goes well, I will go on develop it further, with newer gens of sensors.
I dont know if I can pull it off or not, hopefully someone else can either help or work on it.
The project is up on google code, anyone interested to work on it, please let me know.
https://code.google.com/p/stellaris-lp-imu/
-
Terenceang got a reaction from bluehash in Stellaris LaunchPad IMU.
First test.. at 5:52am.. got get some Zzzz.. Church and lessons to cover till 3pm.. arghh!
-
Terenceang got a reaction from tsh in Simple uart example for Launchpad
It is actually very simple. I am a few days old to the Stellaris hopes this helps. Matching pins for MSP430LP.
// // Enable GPIO port A which is used for UART0 pins. // TODO: change this to whichever GPIO port you are using. // ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); // // Configure the pin muxing for UART1 functions on port PB0 and PB1. // This step is not necessary if your part does not support pin muxing. // TODO: change this to select the port/pin you are using. // ROM_GPIOPinConfigure(GPIO_PB0_U1RX); ROM_GPIOPinConfigure(GPIO_PB1_U1TX); // // Select the alternate (UART) function for these pins. // TODO: change this to select the port/pin you are using. // ROM_GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1); // // Initialize the UART for console I/O. // UARTStdioInitExpClk(1, 38400); -
Terenceang got a reaction from gwdeveloper in Stellaris LaunchPad IMU.
This is a project for me to learn programming on the Stellaris, with tons of materials, support from TI, this and other forums, I managed to get a working port going for this project.
I ported part of the FreeIMU library to the Stellaris Launchpad, just enough to support the GY-80 that I have in my "gadget box".
GY-80 consist of 4 sensors, L3G4200D (Gryo), ADXL345 (Acc), HMC5883L (Mag) and BMP085 (Baro). This is a cheap sensor board that is readily available on ebay or your favourite Chinese online store.
What is working?
Reading and writing to the sensors by i2c bus (thanks to the code from "aBUGSworstnightmare").
calibration routine works but it is not saved to EEPROM.
Basically it display the Roll, Pitch, Yaw, compass heading and all sensor's Raw data thru the Uart Console (I am using BT on UART1, change it to UART0 for ICDI port.)
Overall it is still buggy and I still cannot reset the Roll setting.
Todo.
1. save calibration data to EEPROM.
2. host software for graphical representation of data.
3. fix bugs.
As I am a RC fan, it will be thrilling to see the Stellaris on a Quadcopter, if this goes well, I will go on develop it further, with newer gens of sensors.
I dont know if I can pull it off or not, hopefully someone else can either help or work on it.
The project is up on google code, anyone interested to work on it, please let me know.
https://code.google.com/p/stellaris-lp-imu/
-
Terenceang got a reaction from PTB in Thank you To all the Engineers,Programmers, hobbyist and many more.
To all the Engineers / Programmers, hobbyist and many more,
I want to thank all of you that made this hobby so enjoyable.
The massive amount of info that you guys put out in this and other forums is amazing.
Sometime, I ask very stupid and elementary questions, I am a hobbyist, so I can only invest little time to research and learn on the things that I am tinkering on.
Every project is a learning experience, I pick things that interest me to learn, to many of us, it is just fun, you guys are just like a mentor or teacher, I just dont have the brains or time to learn but guys are patient and always offer more than what is needed.
Many like me don't have engineering background but love to tinker with stuff since young. You might not realise it, but the little code snippet that you put out might just tip me over from giving up to successful project.
Once again THANK YOU!!
-
Terenceang got a reaction from bluehash in simple but useful Launchpad Macros and snippets.
Since I am learning to program the Stellaris Launchpad, I tot is is good to share some useful marcos.
Please feel free to correct and improve them and share your macros.
Here is 1 for the 3 LaunchPad LEDs.
#define RED GPIO_PIN_1 #define GREEN GPIO_PIN_2 #define BLUE GPIO_PIN_3 #define on 1 #define off 0 #define LED_INIT() { ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, RED | GREEN | BLUE);} #define LED(color,sw) {HWREG(GPIO_PORTF_BASE + (GPIO_O_DATA +(color << 2))) = (((color >> 01) << sw) & color);} #define LED_TOGGLE(color) {HWREG(GPIO_PORTF_BASE + (GPIO_O_DATA +(color << 2))) ^= color;} Usage LED_INIT(); LED(RED,1); LED(GREEN,on); LED(BLUE,off); LED(RED,0); LED_TOGGLE(RED); LED_TOGGLE(GREEN); LED_TOGGLE(BLUE); -
Terenceang got a reaction from cubeberg in Thank you To all the Engineers,Programmers, hobbyist and many more.
To all the Engineers / Programmers, hobbyist and many more,
I want to thank all of you that made this hobby so enjoyable.
The massive amount of info that you guys put out in this and other forums is amazing.
Sometime, I ask very stupid and elementary questions, I am a hobbyist, so I can only invest little time to research and learn on the things that I am tinkering on.
Every project is a learning experience, I pick things that interest me to learn, to many of us, it is just fun, you guys are just like a mentor or teacher, I just dont have the brains or time to learn but guys are patient and always offer more than what is needed.
Many like me don't have engineering background but love to tinker with stuff since young. You might not realise it, but the little code snippet that you put out might just tip me over from giving up to successful project.
Once again THANK YOU!!
-
Terenceang got a reaction from bluehash in Thank you To all the Engineers,Programmers, hobbyist and many more.
To all the Engineers / Programmers, hobbyist and many more,
I want to thank all of you that made this hobby so enjoyable.
The massive amount of info that you guys put out in this and other forums is amazing.
Sometime, I ask very stupid and elementary questions, I am a hobbyist, so I can only invest little time to research and learn on the things that I am tinkering on.
Every project is a learning experience, I pick things that interest me to learn, to many of us, it is just fun, you guys are just like a mentor or teacher, I just dont have the brains or time to learn but guys are patient and always offer more than what is needed.
Many like me don't have engineering background but love to tinker with stuff since young. You might not realise it, but the little code snippet that you put out might just tip me over from giving up to successful project.
Once again THANK YOU!!
-
Terenceang reacted to aBUGSworstnightmare in newbie question! how do I use UARTprintf with floats?
Hi,
or do it like this and stay with UARTprintf only.
aBUGSworstnightmare
//***************************************************************************** // //! \brief Float to ASCII //! //! Converts a floating point number to ASCII. Note that buf must be //! large enough to hold //! //! \param f is the floating point number. //! \param buf is the buffer in which the resulting string is placed. //! \return None. //! //! \par Example: //! ftoa(3.14) returns "3.14" //! // //***************************************************************************** void ftoa(float f,char *buf) { int pos=0,ix,dp,num; if (f<0) { buf[pos++]='-'; f = -f; } dp=0; while (f>=10.0) { f=f/10.0; dp++; } for (ix=1;ix<8;ix++) { num = (int)f; f=f-num; if (num>9) buf[pos++]='#'; else buf[pos++]='0'+num; if (dp==0) buf[pos++]='.'; f=f*10.0; dp--; } } -
Terenceang reacted to dellwoodbu in newbie question! how do I use UARTprintf with floats?
UARTprintf does not yet support floats directly.
A couple of options exist.
1) use sprintf or similar from the standard 'C' libraries to do the float to string conversion into a character array and then use %s with UARTprintf to put the float (which is now stored as a string in the array) on the UART.
2) Do a little bit of casting and multiplying. cast the float to a integer. Call this the integer part. multiply the float by something like 1000 to get three decimal points of precision. cast this new number to an integer again and now subtract off the integer part * 1000. Call this the fraction part. Then with UARTprintf do "%d.%03d", IntegerPart, FractionPart.
Dexter
-
Terenceang reacted to dellwoodbu in Finally, time to learn about the Stellaris LaunchPad!
The I2C is available in the same place on the right hand header. Examine the schematic closely there is a zero ohm that ties some I2C pins over to the right hand outside header at the same place as the MSP430 LaunchPad.
StellarisWare\docs\SW-DRL-UGxxxx.pdf is the API documentation for StellarisWare Driver Library. It is very helpful. it's designed to work across 5+ different IDE's/Compilers so it is much more independent of the compiler. Start with the examples in StellarisWare\boards\ek-lm4f120xl and build on them.