tag:blogger.com,1999:blog-6100511197805579796.post85832971342129528..comments2024-02-14T18:43:36.096+01:00Comments on Davide Gironi blog: AVR Atmega L3G4200D gyroscope library 01Davide Gironihttp://www.blogger.com/profile/16366076989473118278noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-6100511197805579796.post-77719116911680440062017-10-28T10:24:31.304+02:002017-10-28T10:24:31.304+02:00If your module does not support 5V, yes. I mean, i...If your module does not support 5V, yes. I mean, if your module did not have a 3.3V voltage regulator you may have burn the main gyro chip, which works from 2.4v to 3.6v. No pull-up resistor is needed on the VCC input.Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-72110940281899209472017-10-27T18:49:35.386+02:002017-10-27T18:49:35.386+02:00Hmmm is there a chance that I broke the gyro by co...Hmmm is there a chance that I broke the gyro by connecting VCC to 5 [V]? do i need some pull-up resistor? Anonymoushttps://www.blogger.com/profile/07077164049953155440noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-74181955496311572882017-10-16T21:49:05.707+02:002017-10-16T21:49:05.707+02:00Hello. AREF is not needed for this project, you ca...Hello. AREF is not needed for this project, you can leave it unconnected. I do not know your module wiring, what's the VIN pin? "adapt..." that is Peter Fleury, cause the i2c library if from him. I suppose he mean to change SCL and SDA port and pin when you are using the .s module (which is the assembler versione of the i2c libary I'm using). Do not uncomment the main, that is a library example. I suppose you do not have a logic analyzer, so you have to debut if by uart, test it putting debug poit in the init function. One think it may be is a wrong L3G4200D_ADDR.Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-18563466823569538772017-10-16T00:05:52.815+02:002017-10-16T00:05:52.815+02:00Uart worked! :) I changed baud rate to 9600, bcs i...Uart worked! :) I changed baud rate to 9600, bcs i remembered it as more "bulletproof" when I built my tachometer, but nothing happens if I "uncomment" l3g4200d_init() and I'm wondering what now. I see on your schematics that AREF of ATmega is connected to VCC, is it really necessary?, also do I have to connect VIN of my gyro to VCC? I believe that your code is perfect after reading it, but what do you mean by typing: "adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module i2master.s? (why ".s" though), do I have to find some info in my datasheet and implement in your code in i2cmaster.h? And finally do I have to uncomment int main (void) in this header? Sorry for my amateurishness xdAnonymoushttps://www.blogger.com/profile/07077164049953155440noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-8219401248861220642017-10-12T15:57:03.163+02:002017-10-12T15:57:03.163+02:00Hello, at first just use the uart library to check...Hello, at first just use the uart library to check if the code complies and output a simple message to your serial. Something like this should emit a message to your serial output<br />for(;;) { uart_puts("Test\r\n"); _delay_ms(500); }<br /><br />Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-80734641356183374082017-10-11T21:21:57.014+02:002017-10-11T21:21:57.014+02:00I compiled your code and it has no errors :) altho...I compiled your code and it has no errors :) although nothing happened after uploading it to my ATmega8, I'm using USB-UART FTDI converter and Realterm Terminal to watch data on PC and nothing, I have also this avrdude: warning: cannot set sck period. please check for usbasp firmware update, but I've searched for solutions online and ppl said to ignore it basically. Dunno if to invest in some analyzer or try sending some text via your program to PC.Anonymoushttps://www.blogger.com/profile/07077164049953155440noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-43877218059557707092017-03-19T12:02:45.522+01:002017-03-19T12:02:45.522+01:00Hello, you are right SDA to SDA of your micro, SCL...Hello, you are right SDA to SDA of your micro, SCL to SCL of your micro, then one pullup 4k7 resistor for each bus to VCC. SDO unconnected.Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-19633585475229881672017-03-18T19:34:25.852+01:002017-03-18T19:34:25.852+01:00hi I have a question, do I connect SDA (gyro) to S...hi I have a question, do I connect SDA (gyro) to SDA (atmega) and then both to VCC through 4,7k resistor?? Same with SCL and do I have to connect SDO somehow?Anonymoushttps://www.blogger.com/profile/07077164049953155440noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-84103510839986433162017-01-02T20:30:55.061+01:002017-01-02T20:30:55.061+01:00Hello, the getrawdata return raw data (not convert...Hello, the getrawdata return raw data (not converted, as it is read by the data registers), get data return converted to deg/sec data. Hope this help.Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-51668884122772982462017-01-02T06:22:52.340+01:002017-01-02T06:22:52.340+01:00I want to ask a question,
what differrent about ge...I want to ask a question,<br />what differrent about getrawdata and getdata?hannasy arifhttps://www.blogger.com/profile/15922989607936586420noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-72365223941940221032015-03-24T22:56:38.121+01:002015-03-24T22:56:38.121+01:00Shouldnt it be 0 when its still?, the data are jum...Shouldnt it be 0 when its still?, the data are jumping all over the placeguesthttps://www.blogger.com/profile/00172973763169655801noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-39835486596912778682015-03-24T21:56:57.498+01:002015-03-24T21:56:57.498+01:00Consider that, even if you have setup the sensitiv...Consider that, even if you have setup the sensitivity to 250 dps, <br />a raw value of of 8192 it is converted to: 8192*0.00875<br />= deg/sec, more than 50 deg/sec, which is too much for a still device.<br />Check with a logic analizer what's going on the bus, and compare the reading with the value you get.<br />Check that the IC is well initialized. Double check your wiring. Check that you F_CPU it is well setted up. Check you IC with other hardware, try it on Arduino as example. Just to prove that you IC works.Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-75711333041465710082015-03-24T13:02:59.261+01:002015-03-24T13:02:59.261+01:00Shouldnt it be 0 when its still?, the data are jum...Shouldnt it be 0 when its still?, the data are jumping all over the placeguesthttps://www.blogger.com/profile/00172973763169655801noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-85302914748447348692015-03-24T12:39:19.811+01:002015-03-24T12:39:19.811+01:00Hi I get these values without using offset and cal...Hi I get these values without using offset and calibration<br />X: -8192 Y: 17376 Z: -8192<br />X: -7864 Y: 17367 Z: -7864<br />X: -8192 Y: 17376 Z: -8192<br /><br />And this when I roll it on the X-axi<br />X: -20644 Y: -15228 Z: -20644<br />X: -20644 Y: -15228 Z: -20644<br />X: -20644 Y: -15228 Z: -20644<br />Can it be correct?guesthttps://www.blogger.com/profile/00172973763169655801noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-9623285554890935312015-03-23T20:00:45.069+01:002015-03-23T20:00:45.069+01:00Looking at the datasheet, if your IC is not damage...Looking at the datasheet, if your IC is not damaged, you should have +-2% error. Also, if you calibrate the gyroscope, you can reduce this error.Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-63271771272021796562015-03-23T18:58:40.185+01:002015-03-23T18:58:40.185+01:00Hi davide, how do I know that the raw data are cor...Hi davide, how do I know that the raw data are correct?guesthttps://www.blogger.com/profile/00172973763169655801noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-91860155022535918152015-03-23T16:25:57.774+01:002015-03-23T16:25:57.774+01:00Raw data it is converted to deg/sec, angular veloc...Raw data it is converted to deg/sec, angular velocity. Not to angles. If you look at the datasheet you will find the Sensitivity parameter for this IC. You can use this parameter to convert raw values to deg/sec. Look at the l3g4200d_getdata function to see the conversion forumla.Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-7198279606826336462015-03-23T16:13:24.597+01:002015-03-23T16:13:24.597+01:00HI good library. How do you convert the data to an...HI good library. How do you convert the data to angles?guesthttps://www.blogger.com/profile/00172973763169655801noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-88037135719035507242014-08-14T09:53:58.360+02:002014-08-14T09:53:58.360+02:00Hello, it could be hardware or software problem. D...Hello, it could be hardware or software problem. Double check your wiring. Check that the hardware (your board), works on other software, like an arduino board. Also check that you write the code and compile it with the same frequency FCPU settings. If you have logic analyzer, you could also try to inspect the I2C line. Try to define a SCL_CLOCK at 10000L or 50000L if you are working at 1Mhz. Check that you have selected the correct device I2C address "(0x68<<1)" or "(0x69<<1)" depending on the SDO pin. As datasheet states, to enable the I2C line, CS has to tied high.Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-85411468382410329682014-08-14T09:44:33.676+02:002014-08-14T09:44:33.676+02:00I'm using avr studio 4.15 and WinAVR avr_gccI'm using avr studio 4.15 and WinAVR avr_gccAnonymoushttps://www.blogger.com/profile/06552137598929351394noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-52133148532243657632014-08-14T09:41:49.095+02:002014-08-14T09:41:49.095+02:00hello, sorry for the inconvenience, but I have a p...hello, sorry for the inconvenience, but I have a problem with i2c_readNak and i2c_readAck twimaster.c library functions. The problem is that they do not return the call to the function i2c_readAck and i2c_readNak, ie remain in the whille (!(...)); and never leaves donot how to fix it, I could help? Please. Thank you.Anonymoushttps://www.blogger.com/profile/06552137598929351394noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-90444073920813691912014-05-12T10:04:07.257+02:002014-05-12T10:04:07.257+02:00You have got mail.You have got mail.Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-64116219716819199092014-05-11T14:41:29.627+02:002014-05-11T14:41:29.627+02:00Make a src directory.
Import all code files. Compi...Make a src directory.<br />Import all code files. Compile. It should be as simple.<br />Anyway, just send me an email, and i will reply you with my eclipse directory for this project.Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-38935859389427764612014-05-10T19:10:39.995+02:002014-05-10T19:10:39.995+02:00Yeah! My atmel processor's compiler is AVR st...Yeah! My atmel processor's compiler is AVR studio. Recently I installed Eclipse+ Avrplugin. I couldn't find out how to import L3G4200 gyroscope's C code, header file to my eclipse C project. Could you give a all completed L3G4200 gyroscope C projecd based on Eclipse? Anonymoushttps://www.blogger.com/profile/16927955615436869071noreply@blogger.comtag:blogger.com,1999:blog-6100511197805579796.post-32942596105124433362014-05-10T15:02:23.228+02:002014-05-10T15:02:23.228+02:00To me the simpler way of working with atmega is Ec...To me the simpler way of working with atmega is Eclipse + AVR plugin for Eclipse + avrgcc as compiler, or AVR studio. But i prefer Eclipse.<br />If you use other than avrgcc compiler i suppose you should port this code to your compiler.<br />Anyway, using Eclipse for AVR is really simple, you can just google around here and you will find a lot of tutorial on how to do it.<br />I suggest you to start from a simple "hello world" blinking led, just to see if your compiler works ;)Davide Gironihttps://www.blogger.com/profile/16366076989473118278noreply@blogger.com