Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jdperess
PostPosted: Feb 08, 2012 - 10:55 PM
Rookie


Joined: Oct 17, 2011
Posts: 34


Hello All,
I'm having trouble reading the ADC using the bitcloud stack. My app is for an end device which sleeps for the period defined. When it wakes up it should read some sensor data from the adc as well as from an additional port and then send this data to the coordinator. All functionality is working correctly when i don't read the ADC. I have successfully read from the ADC using another bitcloud app but it didn't utilize sleeping. I have checked the status of HAL_OpenAdc() and it is '0'. I can't read the status of HAL_ReadAdc() because whenever I call the function, the app seems to fail to continue (no response). The app works just fine when i don't call HAL_ReadAdc(). Does anybody know what the issue could be?


Last edited by jdperess on Feb 21, 2012 - 01:41 AM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 09, 2012 - 04:48 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 6450
Location: San Jose, CA

Please create simpler code. So far I see that you open your ADC in END_DEVICE_STATE_PERIPHERY_CLOSING state which looks suspicious.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Feb 09, 2012 - 06:37 PM
Rookie


Joined: Oct 17, 2011
Posts: 34


Whoops, I didn't catch that one. I fixed that but I'm still having the same problem. In what way could I make it simpler?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 09, 2012 - 06:38 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 6450
Location: San Jose, CA

Test ADC without starting a network and without complex state machines.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Feb 09, 2012 - 06:46 PM
Rookie


Joined: Oct 17, 2011
Posts: 34


I have done that, and indeed it worked. I took the ADC code from that and put it into this application, and this is where it ceases to work.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 09, 2012 - 06:48 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 6450
Location: San Jose, CA

Well, I would enable applications features one-by-one and see where it breaks. I can't tell what is wrong without extensive debugging and reading through the code.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jdperess
PostPosted: Feb 09, 2012 - 06:50 PM
Rookie


Joined: Oct 17, 2011
Posts: 34


well it breaks only when i call HAL_AdcOpen(). Other than that call nothing else fails. I have tried disabling all of the interrupt stuff and basically everything besides the adc without luck. Do you know what could cause HAL_AdcOpen() to freeze the app?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 09, 2012 - 06:58 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 6450
Location: San Jose, CA

Well you have simple application where it does not "fail", right?

Also, define "freeze". Maybe callback is called when your state machine is not ready, or something like this.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I'm affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits