From: Justin R. <ju...@ra...> - 2008-02-15 00:12:42
|
Never mind. I found the error. It was in my code when I moved it from the Gumstix to the robostix. I used x as a counter but in the robostix code it was used to store the ADC value so it would loop up to 10 then return 10. It works now. Thanks a lot for all of the help I really appreciate it. Justin Justin Rajewski wrote: > > Ok, I now have > // Set ADMUX but don't mess with REFS0 & REFS1 > > ADMUX = ( ADMUX & (( 1 << REFS1 ) | ( 1 << REFS0 ))) | 0; //read ADC0 > > // Start the conversion > > ADCSR = ADCSR | ( 1 << ADSC ); > > // Wait for it to complete > > while ( ADCSR & ( 1 << ADSC )); > > val[x]=((ADCH<<8)&ADCL); > but I still am getting 10 > Do you see anything wrong? > Justin > > > Justin Rajewski wrote: >> >> I am not familiar with the Atmega128 so I will have to look into the data >> sheet for how to set it up. (I only used PIC and dsPIC before I got the >> gumstix) >> Justin >> >> Dave Hylands wrote: >>> >>> Hi Justin, >>> >>>> Seems to be a ADC code problem as I set ir[0-24] to 125 and received >>>> 125. >>> >>> I got all 10's on my robostix with your code as well. I had nothing >>> connected to ADC0. >>> >>> I don't see ADMUX being set anywhere? >>> >>> -- >>> Dave Hylands >>> Vancouver, BC, Canada >>> http://www.DaveHylands.com/ >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Microsoft >>> Defy all challenges. Microsoft(R) Visual Studio 2008. >>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >>> _______________________________________________ >>> gumstix-users mailing list >>> gum...@li... >>> https://lists.sourceforge.net/lists/listinfo/gumstix-users >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/I2C-speed-up.-tp15392828p15492409.html Sent from the Gumstix mailing list archive at Nabble.com. |