expected ',' or '....' before numeric constant

can anyone help me with this error...

//*********************************************************************************************
// defining the register address with their names
//-----------------------------------------------------------------------------------------------
 #define      iocfg2                        0000            
 #define      iocfg1                        0001            
 #define      iocfg0                        0002             
 #define      fifothr                       0003            
 #define      sync1                         0004             
 #define      sync0                         0005             
 #define      pktlen                        0006           
 #define      pktctrl1                      0007           
 #define      pktctrl0                      0008             
 #define      addr                          0009           
 #define      channr                        000a             
 #define      fsctrl1                       000b             
 #define      fsctrl0                       000c            
 #define      freq2                         000d           
 #define      freq1                         000e             
 #define      freq0                         000f           
 #define      mdmcfg4                       0010           
 #define      mdmcfg3                       0011          
 #define      mdmcfg2                       0012           
 #define      mdmcfg1                       0013           
 #define      mdmcfg0                       0014             
 #define      deviatn                       0015             
 #define      mcsm2                         0016            
 #define      mcsm1                         0017             
 #define      mcsm0                         0018          
 #define      foccfg                        0019            
 #define      bscfg                         001a             
 #define      agcctrl2                      001b             
 #define      agcctrl1                      001c             
 #define      agcctrl0                      001d             
 #define      worevt1                       001e             
 #define      worevt0                       001f             
 #define      worctrl                       0020          
 #define      frend1                        0021            
 #define      frend0                        0022             
 #define      fscal3                        0023             
 #define      fscal2                        0024             
 #define      fscal1                        0025             
 #define      fscal0                        0026            
 #define      rcctrl1                       0027            
 #define      rcctrl0                       0028             
 #define      fstest                        0029            
 #define      ptest                         002a             
 #define      agctest                       002b          
 #define      test2                         002c             
 #define      test1                         002d          
 #define      test0                         002e              
 #define      partnum                       0030        
 #define      Ver                           0031            
 #define      freqest                       0032             
 #define      lqi                           0033             
 #define      rssi                          0034             
 #define      marcstate                     0035             
 #define      wortime1                      0036            
 #define      wortime0                      0037             
 #define      pktstatus                     0038           
 #define      vco_vc_dac                    0039           
 #define      txbytes                       003a             
 #define      rxbytes                       003b             
 #define      rcctrl1_status                003c            
 #define      rcctrl0_status                003d          



//*********************************************************************************************************************
// defining control strobe registers
//---------------------------------------------------------------------------------------------------------------------
#define      sres        0x30    // RESET the chip
#define      srx         0x34    //Enable Rx
#define      stx         0x35    //Enable Tx
#define      sidle       0x36    //Exit Tx/Rx mode Idle State
#define      sfrx        0x3a    //flush the rx buffer
#define      sftx        0x3b    //flush the tx buffer



//*************************************************************************
//initializing the pins 
//--------------------------------------------------------------------------
int csn = 10;
int sclk = 13;
int mosi = 11;
int miso = 12 ;
int gdo  = 4 ; 

#include<SPI.h>

void setup(){
  Serial.begin(9600);
  SPI.begin();
  pinMode(csn,OUTPUT);
  pinMode(sclk,OUTPUT);
  pinMode(mosi,OUTPUT);
  pinMode(miso,INPUT);
  pinMode(gdo,INPUT);
  Serial.begin(9600);
}
void loop(){
  
  
  //-------------------------------------------------
  //STEP 1 : RESETTING THE MODULE
  //************************************************
  Serial.println("RESETTING device");
  Serial.println(".....");
  reset;
  Serial.println('MODULE is RESET');
  
  //---------------------------------------------------
  //STEP 2 : CONFIGURE RADIO
  //***************************************************
 writereg(iocfg2,0x0b);
 writereg(iocfg1,0x2e);
 writereg(iocfg0,0x0c);
 writereg(fifothr,0x07);
 writereg(sync1,0xd3);
 writereg(sync0,0x91);
 writereg(pktlen,0xff);
 writereg(pktctrl1,0x04);
 writereg(pktctrl0,0x12);
 writereg(addr,0x00);
 writereg(channr,0x00);
 writereg(fsctrl1,0x08);
 writereg(fsctrl0,0x00);
 writereg(freq2,0x5d);
 writereg(freq1,0x93);
 writereg(freq0,0xb1);
 writereg(mdmcfg4,0x86);
 writereg(mdmcfg3,0x83);
 writereg(mdmcfg2,0x00);
 writereg(mdmcfg1,0x22);
 writereg(mdmcfg0,0xf8);
 writereg(deviatn,0x44);
 writereg(mcsm2,0x07);
 writereg(mcsm1,0x30);
 writereg(mcsm0,0x18);
 writereg(foccfg,0x16);
 writereg(bscfg,0x6c);
 writereg(agcctrl2,0x03);
 writereg(agcctrl1,0x40);
 writereg(agcctrl0,0x91);
 writereg(worevt1,0x87);
 writereg(worevt0,0x6b);
 writereg(worctrl,0xf8);
 writereg(frend1,0x56);
 writereg(frend0,0x10);
 writereg(fscal3,0xa9);
 writereg(fscal2,0x0a);
 writereg(fscal1,0x00);
 writereg(fscal0,0x11);
 writereg(rcctrl1,0x41);
 writereg(rcctrl0,0x00);
 writereg(fstest,0x59);
 writereg(ptest,0x7f);
 writereg(agctest,0x3f);
 writereg(test2,0x88);
 writereg(test1,0x31);
 writereg(test0,0x0b);
}


//**********************************************************************************
//function to RESETTING the Module(see cc2500 SPI design note pg no 8 and datasheet pg no: 24)
//----------------------------------------------------------------------------------
void reset(){
  digitalWrite(csn,LOW);
  delay(1);
  digitalWrite(csn,HIGH);
  delay(41);
  digitalWrite(csn,LOW);
  while(digitalRead(miso == HIGH)){
  // wait until miso is to go low
  }
  SPI.transfer(sres);
  while(digitalRead(miso == HIGH)){
    // wait until miso goes low see fig 8 in pg 24 on data sheet
  }
  
}


//************************************************************************************
// function to CONFIGURING the values to the cc2500 module
//------------------------------------------------------------------------------------
void writereg(char addr, int val){
  digitalWrite(csn,LOW);
  while(digitalRead(miso == HIGH)){
  // wait for miso to go low
  }
  SPI.transfer(addr);
  SPI.transfer(val);
  digitalWrite(csn,HIGH);
}

when i click on verify it showing me the error : "expected ',' or '....' before numeric constant"
How can I coorect It?

How can I coorect It?

That code is so full of crap that Ctrl-A, Ctrl-X seems the best way.

 #define      pktctrl0                      0008             
 #define      addr                          0009           
 #define      channr                        000a             
 #define      fsctrl1                       000b

When you start a number with a 0, the compiler interprets the value as octal. 8, 9, a, b are NOT octal digits.

  while(digitalRead(miso == HIGH)){

You want to read from the true or false pins? I didn't think so.

whats wrong with "read from the true or false pins"?

and Code

whats wrong with "read from the true or false pins"?

Do you want to compare the pin number to HIGH, to determine which pin to read from?

Or do you want to read from the pin, and compare the value read from the pin to HIGH?

You are doing the first, where the second is much more normal.

This is what you seewhile(digitalRead(miso == HIGH))

This is what the compiler seeswhile(digitalRead(12 == 1))

This is what happens while(digitalRead(0))

Can't you just explain that a ) is missing?
while(digitalRead(miso**)** == HIGH~~)~~){

These only need to be bytes, or const byte:
int csn = 10;
int sclk = 13;
int mosi = 11;
int miso = 12 ;
int gdo = 4 ;

This needs to go at the top of the sketch
#include<SPI.h>

Further, SPI.begin( ); sets up 11, 12, 13, so those aren't needed. These either:
pinMode(sclk,OUTPUT);
pinMode(mosi,OUTPUT);
pinMode(miso,INPUT);

Can't you just explain that a ) is missing?

It wasn't missing. It was in the wrong place. Given a hint, most people should be able to see immediately what is wrong.

Replying to a perfectly civil question with an insult reflects on you, not the OP.

8 and 9 were octal digits before ANSI C. 8^)

writereg(iocfg2,0x0b);
void writereg(char addr, char val)
{
  digitalWrite(csn,LOW);
  while(digitalRead(miso) == HIGH){
  // wait for miso to go low
  }
  SPI.transfer(addr);
  SPI.transfer(val);
  digitalWrite(csn,HIGH);
}

this is giving me the following error " too many arguments to function 'void writereg(char)"
what is that i am doing wrong..

if you are creating that function inside another, than that may be it...

post all of your code...

#include <SPI.h>
//*********************************************************************************************
// defining the register address with their names
//-----------------------------------------------------------------------------------------------
#define iocfg2   0x0000             
#define iocfg1   0x0001             
#define iocfg0   0x0002             
#define fifothr  0x0003             
#define sync1    0x0004             
#define sync0    0x0005            
#define pktlen   0x0006            
#define pktctrl1 0x0007            
#define pktctrl0 0x0008             
#define addr     0x0009             
#define channr   0x000a           
#define fsctrl1  0x000b            
#define fsctrl0  0x000c             
#define freq2    0x000d             
#define freq1    0x000e              
#define freq0    0x000f             
#define mdmcfg4  0x0010              
#define mdmcfg3  0x0011             
#define mdmcfg2  0x0012            
#define mdmcfg1  0x0013            
#define mdmcfg0  0x0014            
#define deviatn  0x0015             
#define mcsm2    0x0016             
#define mcsm1    0x0017            
#define mcsm0    0x0018             
#define foccfg   0x0019             
#define bscfg    0x001a             
#define agcctrl2 0x001b             
#define agcctrl1 0x001c            
#define agcctrl0 0x001d             
#define worevt1  0x001e            
#define worevt0  0x001f            
#define worctrl  0x0020            
#define frend1   0x0021            
#define frend0   0x0022             
#define fscal3   0x0023           
#define fscal2   0x0024             
#define fscal1   0x0025             
#define fscal0   0x0026             
#define rcctrl1  0x0027             
#define rcctrl0  0x0028             
#define fstest   0x0029             
#define ptest    0x002a             
#define agctest  0x002b             
#define test2    0x002c           
#define test1   0x002d            
#define test0   0x002e             
#define partnum  0x0030           
#define patable  0x3e              



// defining control strobe registers

#define sres 0x30    // RESET the chip
#define srx  0x34    //Enable Rx
#define stx  0x35    //Enable Tx
#define sidle 0x36    //Exit Tx/Rx mode Idle State
#define sfrx 0x3a    //flush the rx buffer
#define sftx 0x3b    //flush the tx buffer
#define fifo 0x3f    //Tx Fifo




//initializing the pins 

const int csn = 10;
const int sclk = 13;
const int mosi = 11;
const int miso = 12;
const int gdo = 4; 
void setup(){
  Serial.begin(9600);
  pinMode(csn,OUTPUT);
  pinMode(sclk,OUTPUT);
  pinMode(mosi,OUTPUT);
  pinMode(miso,INPUT);
  pinMode(gdo,INPUT);
 }


void loop(){
 
  //STEP 1 : RESETTING THE MODULE
 
  Serial.println("RESETTING device");
  Serial.println(".....");
  reset();
  Serial.println('MODULE is RESET');
  
 
  //STEP 2 : CONFIGURE RADIO

 writereg(iocfg2,0x0b);
 writereg(iocfg1,0x2e);
 writereg(iocfg0,0x0c);
 writereg(fifothr,0x07);
 writereg(sync1,0xd3);
 writereg(sync0,0x91);
 writereg(pktlen,0xff);
 writereg(pktctrl1,0x04);
 writereg(pktctrl0,0x12);
 writereg(addr,0x00);
 writereg(channr,0x00);
 writereg(fsctrl1,0x08);
 writereg(fsctrl0,0x00);
 writereg(freq2,0x5d);
 writereg(freq1,0x93);
 writereg(freq0,0xb1);
 writereg(mdmcfg4,0x86);
 writereg(mdmcfg3,0x83);
 writereg(mdmcfg2,0x00);
 writereg(mdmcfg1,0x22);
 writereg(mdmcfg0,0xf8);
 writereg(deviatn,0x44);
 writereg(mcsm2,0x07);
 writereg(mcsm1,0x30);
 writereg(mcsm0,0x18);
 writereg(foccfg,0x16);
 writereg(bscfg,0x6c);
 writereg(agcctrl2,0x03);
 writereg(agcctrl1,0x40);
 writereg(agcctrl0,0x91);
 writereg(worevt1,0x87);
 writereg(worevt0,0x6b);
 writereg(worctrl,0xf8);
 writereg(frend1,0x56);
 writereg(frend0,0x10);
 writereg(fscal3,0xa9);
 writereg(fscal2,0x0a);
 writereg(fscal1,0x00);
 writereg(fscal0,0x11);
 writereg(rcctrl1,0x41);
 writereg(rcctrl0,0x00);
 writereg(fstest,0x59);
 writereg(ptest,0x7f);
 writereg(agctest,0x3f);
 writereg(test2,0x88);
 writereg(test1,0x31);
 writereg(test0,0x0b);


//write to PATABLE patable address : 0x3e and value: 0xfe for 0db


writereg(patable,0xfe);



//Reading partnum of the module

int partnum_read = readreg(partnum);
Serial.println('The Partnumber is .........');
Serial.println(partnum_read);



//writing the data to the Tx FiFo -- Data : 0X0A

writereg(fifo,0x0a);




// sending the command strobe STX

digitalWrite(csn,LOW);
while(digitalRead(miso) == HIGH){
  // wait for miso to go low
  }
SPI.transfer(stx);
while(digitalRead(gdo) == HIGH){
//sending the sync word
}
if (digitalRead(gdo) == LOW){
  Serial.println('Finnished Transmitting.....');
}



}



//function to RESETTING the Module(see cc2500 SPI design note pg no 8 and datasheet pg no: 24)

void reset(){
  digitalWrite(csn,LOW);
  delay(1);
  digitalWrite(csn,HIGH);
  delay(41);
  digitalWrite(csn,LOW);
  while(digitalRead(miso == HIGH)){
  // wait until miso is to go low
  }
  SPI.transfer(sres);
  while(digitalRead(miso == HIGH)){
    // wait until miso goes low see fig 8 in pg 24 on data sheet
  }
  
}



// function to CONFIGURING the values to the cc2500 module

void writereg(char addr, char val)
{
  digitalWrite(csn,LOW);
  while(digitalRead(miso) == HIGH)
  {
  // wait for miso to go low
  }
  SPI.transfer(addr);
  SPI.transfer(Val);
  digitalWrite(csn,HIGH);
}


// Function to Read the data from registers

char readreg(char addr)
{
 char addr_new = addr + 0x80;
  digitalWrite(csn,LOW);
  while(digitalRead(miso == HIGH)){
    //wait for miso to go low
  }
  SPI.transfer(addr_new);
  char value = SPI.transfer(0);
  digitalWrite(csn,HIGH);
  return value;
}

Error is the one of many in the code....

i changed the all those and few more mistakes but i didn't get rid of the error "cc2500_arduino_Tx:81: error: expected ',' or '...' before numeric constant"
which i think 81 is line number.
but on 81 line
const int gdo = 4;

It is initialization of gdo pin...

what iam doing wrong here?

What you see

void writereg(char addr, char val)
{

What the compiler sees

void writereg(char 0x0009, char val)
{

See the problem?

Unrelated, but Serial.println('The Partnumber is .........'); isn't going to do what I think you intend.
Look closely at the quotes.

#include <SPI.h>
void writereg();
int readreg();

// defining the register address with their names

#define iocfg2   0x00            
#define iocfg1   0x01            
#define iocfg0   0x02           
#define fifothr  0x03          
#define sync1    0x04            
#define sync0    0x05             
#define pktlen   0x06            
#define pktctrl1 0x07            
#define pktctrl0 0x08             
#define addr     0x09             
#define channr   0x0a             
#define fsctrl1  0x0b             
#define fsctrl0  0x0c             
#define freq2    0x0d          
#define freq1    0x0e             
#define freq0    0x0f             
#define mdmcfg4  0x10            
#define mdmcfg3  0x11            
#define mdmcfg2  0x12             
#define mdmcfg1  0x13             
#define mdmcfg0  0x14             
#define deviatn  0x15             
#define mcsm2    0x16             
#define mcsm1    0x17             
#define mcsm0    0x18           
#define foccfg   0x19             
#define bscfg    0x1a            
#define agcctrl2 0x1b            
#define agcctrl1 0x1c             
#define agcctrl0 0x1d             
#define worevt1  0x1e             
#define worevt0  0x1f             
#define worctrl  0x20             
#define frend1   0x21            
#define frend0   0x22             
#define fscal3   0x23            
#define fscal2   0x24             
#define fscal1   0x25             
#define fscal0   0x26             
#define rcctrl1  0x27             
#define rcctrl0  0x28             
#define fstest   0x29             
#define ptest    0x2a             
#define agctest  0x2b             
#define test2    0x2c            
#define test1   0x2d            
#define test0   0x2e            
#define partnum  0x30            
#define patable  0x3e              



// defining control strobe registers

#define sres 0x30    // RESET the chip
#define srx  0x34    //Enable Rx
#define stx  0x35    //Enable Tx
#define sidle 0x36    //Exit Tx/Rx mode Idle State
#define sfrx 0x3a    //flush the rx buffer
#define sftx 0x3b    //flush the tx buffer
#define fifo 0x3f    //Tx Fifo




//initializing the pins 

int gdo = 4; 
void setup(){
  SPI.begin();
  Serial.begin(9600);
  pinMode(gdo,INPUT);
}


void loop(){

  //STEP 1 : RESETTING THE MODULE

  Serial.println("RESETTING device");
  Serial.println(".....");
  reset();
  Serial.println("MODULE is RESET");


  //STEP 2 : CONFIGURE RADIO

  writereg(iocfg2,0x0b);
  writereg(iocfg1,0x2e);
  writereg(iocfg0,0x0c);
  writereg(fifothr,0x07);
  writereg(sync1,0xd3);
  writereg(sync0,0x91);
  writereg(pktlen,0xff);
  writereg(pktctrl1,0x04);
  writereg(pktctrl0,0x12);
  writereg(addr,0x00);
  writereg(channr,0x00);
  writereg(fsctrl1,0x08);
  writereg(fsctrl0,0x00);
  writereg(freq2,0x5d);
  writereg(freq1,0x93);
  writereg(freq0,0xb1);
  writereg(mdmcfg4,0x86);
  writereg(mdmcfg3,0x83);
  writereg(mdmcfg2,0x00);
  writereg(mdmcfg1,0x22);
  writereg(mdmcfg0,0xf8);
  writereg(deviatn,0x44);
  writereg(mcsm2,0x07);
  writereg(mcsm1,0x30);
  writereg(mcsm0,0x18);
  writereg(foccfg,0x16);
  writereg(bscfg,0x6c);
  writereg(agcctrl2,0x03);
  writereg(agcctrl1,0x40);
  writereg(agcctrl0,0x91);
  writereg(worevt1,0x87);
  writereg(worevt0,0x6b);
  writereg(worctrl,0xf8);
  writereg(frend1,0x56);
  writereg(frend0,0x10);
  writereg(fscal3,0xa9);
  writereg(fscal2,0x0a);
  writereg(fscal1,0x00);
  writereg(fscal0,0x11);
  writereg(rcctrl1,0x41);
  writereg(rcctrl0,0x00);
  writereg(fstest,0x59);
  writereg(ptest,0x7f);
  writereg(agctest,0x3f);
  writereg(test2,0x88);
  writereg(test1,0x31);
  writereg(test0,0x0b);


  //write to PATABLE patable address : 0x3e and value: 0xfe for 0db


  writereg(patable,0xfe);



  //Reading partnum of the module

  int partnum_read = readreg(partnum);
  Serial.println("The Partnumber is .........");
  Serial.println(partnum_read);



  //writing the data to the Tx FiFo -- Data : 0X0A

  writereg(fifo,0x0a);




  // sending the command strobe STX

  digitalWrite(SS,LOW);
  while(digitalRead(MISO) == HIGH){
    // wait for miso to go low
  }
  SPI.transfer(stx);
  while(digitalRead(gdo) == HIGH){
    //sending the sync word
  }
  if (digitalRead(gdo) == LOW){
    Serial.println("Finnished Transmitting.....");
  }



}


//function to RESETTING the Module(see cc2500 SPI design note pg no 8 and datasheet pg no: 24)

void reset(){
  digitalWrite(SS,LOW);
  delay(1);
  digitalWrite(SS,HIGH);
  delay(41);
  digitalWrite(SS,LOW);
  while(digitalRead(MISO == HIGH)){
    // wait until miso is to go low
  }
  SPI.transfer(sres);
  while(digitalRead(MISO == HIGH)){
    // wait until miso goes low see fig 8 in pg 24 on data sheet
  }

}



// function to CONFIGURING the values to the cc2500 module

void writereg(int addr, int val)
{
  digitalWrite(SS,LOW);
  while(digitalRead(MISO) == HIGH)
  {
    // wait for miso to go low
  }
  SPI.transfer(addr);
  SPI.transfer(val);
  digitalWrite(SS,HIGH);
}


// Function to Read the data from registers

int readreg (int addr){
  int addr_new = addr + 0x80;
  digitalWrite(SS,LOW);
  while(digitalRead(MISO == HIGH))
  {
    //wait for miso to go low
  }
  SPI.transfer (addr_new);
  int value = SPI.transfer(0);
  digitalWrite(SS,HIGH);
  return value;
}

"too many arguments to function" error is eliminated by declaring the function in the starting of the code...
i am still getting the error "cc2500_arduino_Tx:212: error: expected ',' or '...' before numeric constant".....
212 line is the function staring line... does the compiler taking function as numerical value ?

And what is meaning of the error message?

error is eliminated by declaring the function in the starting of the code...

Bullshit. You defined a function prototype for a function taking no arguments. Yet you call it with two arguments.

  while(digitalRead(MISO == HIGH))
  {

You still have this useless shit. Why? You are not paying attention. Why should we?

sketch_sep11a:206: error: expected ',' or '...' before numeric constant

and this line is highlighted:

void writereg(int addr, int val)

You have already been told why that is wrong. Yet, you've done NOTHING to fix it. Why?

sketch_sep11a.ino: In function 'void writereg(int)':
sketch_sep11a:214: error: 'val' was not declared in this scope

Why do you suppose the compiler thinks that writereg() takes one argument? You have defined a function prototype that takes none. The IDE has defined a function prototype that takes two. Fix the stuff you've been told to fix BEFORE you come back here.

You've still got the same problem I pointed out in my last reply.

#define addr 0x009

Now do you see the problem?

Ok, That's a Serious Reply.....

Let me tell you what I understand and correct me if i wrong.

#define addr 0x009

the compiler replaces the char "addr" with value "0x09"... so I changed the data type..

And I didn't Noticed the variable name till now....

Thanks for your reply AWOl and your Patience paulS...

and I dont know why...
it does show no errors when i add those functions at the starting.....
and all the remaining are my mistakes......
anyway thanks for helping....

and I dont know why...
it does show no errors when i add those functions at the starting.....

No, it doesn't. I copied and pasted the last code you posted into the IDE to generate the error messages I posted.

and your Patience paulS...

You must have me confused with someone else. 8)

the compiler replaces the char "addr" with value "0x09"... so I changed the data type..

No, the preprocessor replaces "addr" with "0x0009", so it doesn't matter what the datatype is; a definition like char 0x0009 makes as little sense as unsigned long 0x0009.
On the other hand, if you followed convention, and made your #define macros in capital letters, we probably wouldn't be having this discussion. #define ADDR 0x0009

edit: spelling