| Author |
Message |
|
|
Posted: Feb 08, 2012 - 10:55 PM |
|

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
|
| |
|
|
|
|
|
Posted: Feb 09, 2012 - 04:48 PM |
|


Joined: Apr 15, 2009
Posts: 4875
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.
|
| |
|
|
|
|
|
Posted: Feb 09, 2012 - 06:37 PM |
|

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? |
|
|
| |
|
|
|
|
|
Posted: Feb 09, 2012 - 06:38 PM |
|


Joined: Apr 15, 2009
Posts: 4875
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.
|
| |
|
|
|
|
|
Posted: Feb 09, 2012 - 06:46 PM |
|

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. |
|
|
| |
|
|
|
|
|
Posted: Feb 09, 2012 - 06:48 PM |
|


Joined: Apr 15, 2009
Posts: 4875
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.
|
| |
|
|
|
|
|
Posted: Feb 09, 2012 - 06:50 PM |
|

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? |
|
|
| |
|
|
|
|
|
Posted: Feb 09, 2012 - 06:58 PM |
|


Joined: Apr 15, 2009
Posts: 4875
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.
|
| |
|
|
|
|
|