This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why NRF24LE1 ADC is reading value always as 255?

I am doing a register retention gzll transmit code with ADC. But problem is that the ADC value transmitted is always 255, if I connect ground to ADC it would read 247. Why is there such a problem here. Here is my code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include"reg24le1.h" // I/O header file for NRF24LE1
//#include"hal_uart.h" // library containing serial communication functions
#include"hal_delay.h" // header file containing delay functions
#include"hal_clk.h"
#include <stdio.h>
#include "nrf24le1.h"
#include "gzll_mcu.h"
#include "gzll.h"
#include "hal_adc.h"
// Repeated putchar to print a string
/*void putstring(char *s)
{
while(*s != 0)
hal_uart_putchar(*s++);
}*/
int gzlinit=0,val=0;
uint8_t payload[3];
void wakeup_irq() interrupt INTERRUPT_WUOPIRQ
{
;//putstring("Hello Ranjan I woke up\n");
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX