th3gr8
Member level 4
- Joined
- Aug 27, 2013
- Messages
- 68
- Helped
- 6
- Reputation
- 12
- Reaction score
- 6
- Trophy points
- 8
- Activity points
- 398
Hello everybody ..
I am working with Serial Communication using Pic MCU .. I got a problem in that .. It is that the programs that consumes less RAM and ROM are working fine (i.e. their outputs are fine at HyperTerminal), but the outputs of the programs that consumes more RAM and ROM (even 20% of RAM and ROM) of MCU doesn't even appear at the HyperTerminal.. Also, when i press the data-lines again and again, i receive some garbage characters on the hyperterminal .. Is there something wrong with my hardware?? .. Plz help !!
I am using PIC16F877A, 4MHz crystal and PIC-CCS for programming ..
Here is the code:
I am working with Serial Communication using Pic MCU .. I got a problem in that .. It is that the programs that consumes less RAM and ROM are working fine (i.e. their outputs are fine at HyperTerminal), but the outputs of the programs that consumes more RAM and ROM (even 20% of RAM and ROM) of MCU doesn't even appear at the HyperTerminal.. Also, when i press the data-lines again and again, i receive some garbage characters on the hyperterminal .. Is there something wrong with my hardware?? .. Plz help !!
I am using PIC16F877A, 4MHz crystal and PIC-CCS for programming ..
Here is the code:
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 // To Calculate Radius of Circle using RS232 Protocol #include <16F877A.h> #fuses HS, NOLVP, NOWDT,BROWNOUT #use delay(clock = 4Mhz) #use rs232(baud=9600, xmit=pin_B0, rcv=pin_B1) void main() { unsigned int r=0,c; float a=0; lcd_init(); delay_ms(30); loop: printf("\n\rInsert value of r (from 0-9): "); r = getc(); putc(r); delay_ms(1000); r = r-48; lcd_putc('\f'); lcd_gotoxy(1,1); //lcd_putc(r); printf(lcd_putc,"Radius = %d", r); a = (3.14*r*r); printf("\n\rArea of circle = %f", a); lcd_gotoxy(1,2); printf(lcd_putc,"Area = %f", a); printf("\n\rRepeat? (Y/N): "); c = getc(); putc(c); if(c=='y') { goto loop; } else { break; } }
Last edited by a moderator: