please help!! i used mikro C for pic32 (pic32mx460f512l) write half wave send to uart is not work
++++programe+++++
Code C - [expand] |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
| unsigned char buffer[1024];
unsigned int ram[4096];
int i;
void get_wave()
{
for(i=0; i<512; i++)
{
ram[i]= ADC1_Get_Sample(8);
delay_us(10);
}
}
void send_data()
{
for(i=0; i<512; i++)
{
sprinti(buffer,"\r\n%d",ram[i]);
UART1_Write_Text(buffer);
}
}
void main()
{
//PORTB = 0x00;
//TRISB.F0= 0xff;
CHECON = 0x32;
AD1PCFG = 0xFFF7;
// AD1PCFG = 0x0000; // Configure AN pins as digital I/O
ADC1_Init();
//ADC1_Init_Advanced(_ADC_INTERNAL_REF);
UART1_Init(9600);
UART1_Write_Text("\r\nCapture waveform");
get_wave();
send_data();
for(;;);
} |
// program is not work ///
//data sent to uart and i plot graph is not half wave//
thank you to help me
Last edited by a moderator: