i'm using c51. i get an error"not in formal parameter list" and cannot find a way to solve it,so i'm here to ask for ur help,please. Here is my code: #include <stdio.h> #include <absacc.h> #include <reg51.h> #define uchar unsigned char void serial() interrupt 4 using 1 uchar time[6],date[6]; uchar latitude[9],longitude[9]; uchar semisphere_f,semisphere_s; uchar input_data="GPRMC"; uchar data_in; int numbercomma; bit flag; if(SBUF==0x24) { if(SBUF==input_data) { flag=1; numbercomma=0; } else flag=0; } if(flag==1) { if(SBUF==0x2c) { numbercomma++; } }
if(numbercomma==2) { data_in=SBUF; } if (data_in=A) { swith(numbercomma) { case 1:time[6]=SBUF; case 3:latitude[9]=SBUF; case 4:semisphere_f=SBUF; case 5:longitude[9]=BUF; case 6:semisphere_s=SBUF; case 9:date[6]=SBUF; default:;break; } }
main() { TMOD=0x21; TH1=0xfa; TL1=0xfa; SCON=0x50; ES=1; EA=1; } Thank you!
The way to think about it is this:
First, gain an understanding of how the underlying hardware works;
Then write code to work with that.
To understand how the 8051 architecture works, you will need to study the so-called "bible" for the 8051 - links here: www.8052.com/.../120112
There's also a tutorial here: http://www.8052.com/tutorial
And booklists here: http://www.keil.com/books/8051books.asp http://www.8052.com/book/ www.8052.com/.../174564
I think you might also want to brush-up on your 'C' ?