Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

please help!! i used mikro C for pic32 (pic32mx460f512l) analog to uart

Status
Not open for further replies.

dogiipongs

Newbie level 1
Joined
Apr 11, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,290
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:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top