Help for changing a program from AUBTM-22 to AUBTM-23!

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everybody
i have a program for use of AUBTM-22 but, now, i want to change it for use by AUBTM-23.
but i have a problem. i saw the datasheet and AT-Command of the new module(AUBTM-23). seems the some
command has changed. for example i can't find the RRR or the LLL command. how can i do this job?
this is my code:

#include 
#include 
#include 
#include 
#include 


char a,i,j,k,n,r,l,m,co;
char d=0,c=0;
char data_lcd[32];
char dt[32];


// Alphanumeric LCD Module functions
#include 

// USART Receiver interrupt service routine
interrupt [USART_RXC] void usart_rx_isr(void)
{

dt[c]=UDR;
c=c+1;
if (c==32) 
{
c=0;
lcd_clear();
for (i=0;i<33;i++) 
      {
      dt[i]=0;
      data_lcd[i]=0;
      }
}

}

// External Interrupt 0 service routine
interrupt [EXT_INT0] void ext_int0_isr(void)
{

for (i=0;i<33;i++) 
            {
            dt[i]=0;
            data_lcd[i]=0;
            }
UDR=0;
c=0;

k=0;
lcd_clear();
delay_ms(200);
lcd_putsf("Enter Command:");
delay_ms(1500);
lcd_clear();
lcd_gotoxy(k,l);                    //shifting the cursor for next character
_lcd_write_data(0x0F);  //
        a=scan_key();     //copying the pressed number of the keypad 
        for (n=0;n<250;n++)
        
         {   
            i=0; 
            for(j=0;j<120;j++)   //moveing the cursor on the character
                {
                if(k==16) 
                {
                 k=0;
                 l=!l;
                 if (l==0) m=0;
                 else  m=16;    
                }
                a=scan_key();
                lcd_gotoxy(k,l);
                
                if(a!=0xff) j=0;
                if(a==82)  //creating space
                 {
                 k=k+1;
                 data_lcd[m+k]=0x20;
                 i=0;
                 delay_ms(400);
                 }
                if(a==48)
                {
                lcd_putsf("0");
                data_lcd[m+k]=0x30;
                delay_ms(300);
                }
                if(a==49)    //typeing other word
                    {
                    i=i+1;
                    if (i==1) 
                        {
                        lcd_putsf(".");
                        data_lcd[m+k]=0x2e;
                        }
                    if (i==2) 
                        {
                        lcd_putsf(",");
                        data_lcd[m+k]=0x2c;
                        }
                    if (i==3) 
                        {
                        lcd_putsf("'");
                        data_lcd[m+k]=0x22;
                        }
                    if (i==4) 
                        {
                        lcd_putsf("+");
                        data_lcd[m+k]=0x2b;
                        }
                    if (i==5) 
                        {
                        lcd_putsf("(");
                        data_lcd[m+k]=0x28;
                        }
                    if (i==6) 
                        {
                        lcd_putsf(")");
                        data_lcd[m+k]=0x29;
                        }
                    if (i==7) 
                        {
                        lcd_putsf("<");
                        data_lcd[m+k]=0x3c;
                        }
                    if (i==8) 
                        {
                        lcd_putsf(">");
                        data_lcd[m+k]=0x3e;
                        }
                    if (i==9) 
                        {
                        lcd_putsf("=");
                        data_lcd[m+k]=0x3d;
                        }
                    if (i==10) 
                        {
                        lcd_putsf("?");
                        data_lcd[m+k]=0x3f;
                        }
                    if (i==11) 
                        {
                        lcd_putsf(":");
                        data_lcd[m+k]=0x3a;
                        }
                    if (i==12) 
                    {
                    lcd_putsf("1");
                    data_lcd[m+k]=0x31;
                    i=0;
                    }
                    delay_ms(300);
                    }
                if(a==50) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("a");
                    data_lcd[m+k]=0x61; 
                    }
                    if (i==2) 
                    {
                    lcd_putsf("b");
                    data_lcd[m+k]=0x62;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("c");
                    data_lcd[m+k]=0x63;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("2");
                        data_lcd[m+k]=0x32;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==51) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("d");
                    data_lcd[m+k]=0x64;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("e");
                    data_lcd[m+k]=0x65;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("f");
                    data_lcd[m+k]=0x66;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("3");
                        data_lcd[m+k]=0x33;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==52)
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("g");
                    data_lcd[m+k]=0x67;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("h");
                    data_lcd[m+k]=0x68;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("i");
                    data_lcd[m+k]=0x69;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("4");
                        data_lcd[m+k]=0x34;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==53) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("j");
                    data_lcd[m+k]=0x6a;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("k");
                    data_lcd[m+k]=0x6b;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("l");
                    data_lcd[m+k]=0x6c;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("5");
                        data_lcd[m+k]=0x35;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==54) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("m");
                    data_lcd[m+k]=0x6d;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("n");
                    data_lcd[m+k]=0x6e;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("o");
                    data_lcd[m+k]=0x6f;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("6");
                        data_lcd[m+k]=0x36;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==55) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("p");
                    data_lcd[m+k]=0x70;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("q");
                    data_lcd[m+k]=0x71;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("r");
                    data_lcd[m+k]=0x72;
                    }
                    if (i==4) 
                    {
                    lcd_putsf("s");
                    data_lcd[m+k]=0x73;
                    }
                    if (i==5) 
                        {
                        lcd_putsf("7");
                        data_lcd[m+k]=0x37;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==56) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("t");
                    data_lcd[m+k]=0x74;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("u");
                    data_lcd[m+k]=0x75;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("v");
                    data_lcd[m+k]=0x76;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("8");
                        data_lcd[m+k]=0x38;
                        i=0;
                        }
                    delay_ms(300);
                    }    
                if(a==57) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("w");
                    data_lcd[m+k]=0x77;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("x");
                    data_lcd[m+k]=0x78;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("y");
                    data_lcd[m+k]=0x79;
                    }
                    if (i==4) 
                    {
                    lcd_putsf("z");
                    data_lcd[m+k]=0x7a;
                    }
                    if (i==5) 
                        {
                        lcd_putsf("9");
                        data_lcd[m+k]=0x39;
                        i=0;
                        }
                    delay_ms(300);
                    }                  
                if(a==83) 
                    {
                    lcd_putsf(" ");
                    k=k-1;
                    data_lcd[m+k]=0x20;
                    delay_ms(300);
                    }
                
                
                if (a==69)      //all act after pressing the enter key
                {   
                    _lcd_write_data(0x0C);
                    lcd_clear();
                    lcd_putsf("Sending Command:");
                    lcd_gotoxy(0,1);        
                    lcd_puts(data_lcd);
                    delay_ms(500);
                    co=1;
                    k=0;
                    l=0;
                    m=0;
                    #asm ("reti");
                }
                
                
                
                
                
             }
          

         }

}


// External Interrupt 1 service routine
interrupt [EXT_INT1] void ext_int1_isr(void)
{
d=1;
k=0;
l=0;
lcd_clear();
delay_ms(200);
lcd_putsf("Enter DATA:");
delay_ms(1000);
lcd_clear();
lcd_gotoxy(k,l);                    //shifting the cursor for next character
_lcd_write_data(0x0F);  //
        a=scan_key();     //copying the pressed number of the keypad
        for (n=0;n<250;n++)
         {
         
            
            
            
            i=0; 
            for(j=0;j<120;j++)   //moveing the cursor on the character
                {
                
                if(k==16) 
                {
                 k=0;
                 l=!l;
                 if (l==0) m=0;
                 else  m=16;
                }
                a=scan_key();
                lcd_gotoxy(k,l);
                if(a!=0xff) j=0;
                if(a==82)  //creating space
                 {
                 k=k+1;
                 data_lcd[m+k]=0x20;
                 i=0;
                 delay_ms(400);
                 }
                if(a==48)
                {
                lcd_putsf("0");
                data_lcd[m+k]=0x30;
                delay_ms(300);
                }
                if(a==49)    //typeing other word
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf(".");
                    data_lcd[m+k]=0x2e;
                    }
                    if (i==2) 
                    {
                    lcd_putsf(",");
                    data_lcd[m+k]=0x2c;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("'");
                    data_lcd[m+k]=0x22;
                    }
                    if (i==4) 
                    {
                    lcd_putsf("+");
                    data_lcd[m+k]=0x2b;
                    }
                    if (i==5) 
                    {
                    lcd_putsf("(");
                    data_lcd[m+k]=0x28;
                    }
                    if (i==6) 
                        {
                        lcd_putsf(")");
                        data_lcd[m+k]=0x29;
                        }
                    if (i==7) 
                        {
                        lcd_putsf("<");
                        data_lcd[m+k]=0x3c;
                        }
                    if (i==8) 
                        {
                        lcd_putsf(">");
                        data_lcd[m+k]=0x3e;
                        }
                    if (i==9) 
                        {
                        lcd_putsf("=");
                        data_lcd[m+k]=0x3d;
                        }
                    if (i==10) 
                        {
                        lcd_putsf("?");
                        data_lcd[m+k]=0x3f;
                        }
                    if (i==11) 
                    {
                    lcd_putsf("1");
                    data_lcd[m+k]=0x31;
                    i=0;
                    }
                    delay_ms(300);
                    }
                if(a==50) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("a");
                    data_lcd[m+k]=0x61; 
                    }
                    if (i==2) 
                    {
                    lcd_putsf("b");
                    data_lcd[m+k]=0x62;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("c");
                    data_lcd[m+k]=0x63;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("2");
                        data_lcd[k]=0x32;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==51) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("d");
                    data_lcd[k]=0x64;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("e");
                    data_lcd[k]=0x65;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("f");
                    data_lcd[k]=0x66;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("3");
                        data_lcd[k]=0x33;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==52)
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("g");
                    data_lcd[k]=0x67;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("h");
                    data_lcd[k]=0x68;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("i");
                    data_lcd[k]=0x69;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("4");
                        data_lcd[k]=0x34;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==53) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("j");
                    data_lcd[k]=0x6a;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("k");
                    data_lcd[k]=0x6b;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("l");
                    data_lcd[k]=0x6c;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("5");
                        data_lcd[m+k]=0x35;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==54) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("m");
                    data_lcd[m+k]=0x6d;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("n");
                    data_lcd[m+k]=0x6e;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("o");
                    data_lcd[m+k]=0x6f;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("6");
                        data_lcd[m+k]=0x36;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==55) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("p");
                    data_lcd[m+k]=0x70;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("q");
                    data_lcd[m+k]=0x71;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("r");
                    data_lcd[m+k]=0x72;
                    }
                    if (i==4) 
                    {
                    lcd_putsf("s");
                    data_lcd[m+k]=0x73;
                    }
                    if (i==5) 
                        {
                        lcd_putsf("7");
                        data_lcd[m+k]=0x37;
                        i=0;
                        }
                    delay_ms(300);
                    }
                if(a==56) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("t");
                    data_lcd[m+k]=0x74;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("u");
                    data_lcd[m+k]=0x75;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("v");
                    data_lcd[m+k]=0x76;
                    }
                    if (i==4) 
                        {
                        lcd_putsf("8");
                        data_lcd[m+k]=0x38;
                        i=0;
                        }
                    delay_ms(300);
                    }    
                if(a==57) 
                    {
                    i=i+1;
                    if (i==1) 
                    {
                    lcd_putsf("w");
                    data_lcd[m+k]=0x77;
                    }
                    if (i==2) 
                    {
                    lcd_putsf("x");
                    data_lcd[m+k]=0x78;
                    }
                    if (i==3) 
                    {
                    lcd_putsf("y");
                    data_lcd[m+k]=0x79;
                    }
                    if (i==4) 
                    {
                    lcd_putsf("z");
                    data_lcd[m+k]=0x7a;
                    }
                    if (i==5) 
                        {
                        lcd_putsf("9");
                        data_lcd[m+k]=0x39;
                        i=0;
                        }
                    delay_ms(300);
                    }                  
                if(a==83) 
                    {
                    lcd_putsf(" ");
                    data_lcd[m+k]=0x20;
                    k=k-1;
                    delay_ms(300);
                    }
                
                if (a==71) lcd_clear();
                if (a==69)      //all act after pressing the enter key
                {   
                    
                    _lcd_write_data(0x0C);
                    lcd_clear();
                    lcd_putsf("Sending DATA...");
                    puts(data_lcd);
                    delay_ms(1000);
                    for (i=0;i<33;i++) 
                        {
                        dt[i]=0;
                        data_lcd[i]=0;
                        }
                        UDR=0;
                        c=0;
                        d=0;
                        k=0;
                        l=0;
                        m=0;
                    #asm ("reti");
                }
                
                
                
             }
          

         }


}





// Standard Input/Output functions
#include 

// Declare your global variables here

void main(void)
{
// Declare your local variables here

// Input/Output Ports initialization
// Port A initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In 
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T 
PORTA=0x00;
DDRA=0x00;

// Port B initialization
// Func7=Out Func6=Out Func5=Out Func4=Out Func3=In Func2=In Func1=In Func0=In 
// State7=0 State6=0 State5=0 State4=0 State3=P State2=P State1=P State0=P 
PORTB=0x0F;
DDRB=0xF0;

// Port C initialization
// Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out 
// State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 
PORTC=0x00;
DDRC=0xFF;

// Port D initialization
// Func7=Out Func6=Out Func5=Out Func4=Out Func3=In Func2=In Func1=Out Func0=In 
// State7=0 State6=0 State5=0 State4=0 State3=P State2=P State1=0 State0=T 
PORTD=0x0C;
DDRD=0xF2;

// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=0xFF
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;

// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer1 Stopped
// Mode: Normal top=0xFFFF
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;

// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer2 Stopped
// Mode: Normal top=0xFF
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;

// External Interrupt(s) initialization
// INT0: On
// INT0 Mode: Rising Edge
// INT1: On
// INT1 Mode: Rising Edge
// INT2: Off
GICR|=0xC0;
MCUCR=0x0F;
MCUCSR=0x00;
GIFR=0xC0;

// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;

// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud Rate: 9600
UCSRA=0x00;
UCSRB=0x98;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x33;

// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;

// ADC initialization
// ADC disabled
ADCSRA=0x00;

// SPI initialization
// SPI disabled
SPCR=0x00;

// TWI initialization
// TWI disabled
TWCR=0x00;

// Alphanumeric LCD initialization
// Connections specified in the
// Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu:
// RS - PORTC Bit 0
// RD - PORTC Bit 1
// EN - PORTC Bit 2
// D4 - PORTC Bit 4
// D5 - PORTC Bit 5
// D6 - PORTC Bit 6
// D7 - PORTC Bit 7
// Characters/line: 16
lcd_init(16);
lcd_clear();
#asm("sei")
lcd_gotoxy(0,0);
delay_ms(1000);
lcd_puts(dt);
delay_ms(1000);
for (i=0;i<33;i++) 
{
dt[i]=0;
UDR=0;
}
r=0;
lcd_clear();
while (1)
      {
      if (co==1)
      {
      putchar(0x0D);
      putchar(0x0A);
      puts(data_lcd);
      putchar(0x0D);
      putchar(0x0A);
      delay_ms(1500);
      lcd_clear();
      for (i=0;i<100;i++)
      {
      lcd_gotoxy(0,0);
      lcd_puts(dt);
      delay_ms(30);
      }                 
      for (i=0;i<33;i++) 
        {
        dt[i]=0;
        data_lcd[i]=0;
        }
        UDR=0;
        c=0;
        co=0;
      }
      if (d!=1)
       {
        lcd_clear();
        lcd_putsf("Select Mode");
        delay_ms(500);
        lcd_clear();
        delay_ms(500);
        a=scan_key();
        if (a==72)
        {
         for (i=0;i<33;i++) 
            {
            dt[i]=0;
            data_lcd[i]=0;
            }
            UDR=0;
            c=0;
         lcd_clear();
         lcd_gotoxy(0,0);
         lcd_puts("Select R By *");
         lcd_gotoxy(0,1);
         lcd_puts("Select L By #");
         delay_ms(1000);
         lcd_gotoxy(0,0);
         for (i=0;i<120;i++)
            {
            a=scan_key();
            if (a==83)
            {
            puts ("RRR");
            delay_ms(500);
            lcd_clear();
            lcd_puts("Use Remote.");
            delay_ms(1000);
            }
            if (a==82)
            {
            puts ("LLL");
            delay_ms(500);
            lcd_clear();
            lcd_puts("Use Local.");
            delay_ms(1000);
            }
            }
         lcd_clear();
         lcd_puts(dt);
         delay_ms(1000);
         for (i=0;i<33;i++) 
            {
            dt[i]=0;
            data_lcd[i]=0;
            }
            UDR=0;
            c=0;
        }
        if (a==71)
                 {
                 PORTD.6=1;         
                 delay_ms(100);
                 PORTD.6=0;
                 }
        if (a==70)
                 {
                 d=1;
                 lcd_clear();
                 lcd_putsf("Enter Data...");
                 delay_ms(1000);
                 lcd_clear();
                 for (i=0;i<33;i++) 
                    {
                    dt[i]=0;
                    data_lcd[i]=0;
                    }
                 UDR=0;
                 c=0;
                 }
       }
      if (d==1) 
       {
        a=scan_key();
        lcd_gotoxy(0,0);
        lcd_puts(dt);
        if (a==71)
                 {
                 PORTD.5=1;         
                 delay_ms(100);
                 PORTD.5=0;
                 }
        if (a==69) d=0;
        if (a==70) 
        {
        lcd_clear();
        for (i=0;i<33;i++) dt[i]=0; 
        UDR=0;
        c=0;
        } 
         
       }
      }
}

and this is the schematic:

i think it just necessary to change the some code at the main while.

"One's value is inherent; money is not inherent"

 

Chuck, you are in my heart!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Excuse me (it wonot solve your problem) , but is ext_int1_isr an interrupt routine (has a lot of delays > 100 ms)?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, but no important

"One's value is inherent; money is not inherent"

 

Chuck, you are in my heart!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That code is soooo wrong in sooo many ways. How many lines? And nary a comment. External interrupt pins looped back to port pins - probably to gain some form of task switching and considering you don't need to loop back to port pins to do this. At a guess, this code could be written so much smaller, simpler and better structured.

You need to read my tutorial on multitasking, get rid of the delays and get away from using external interrupts to do a task switch.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you russel for reply.

Kartman wrote:
That code is soooo wrong in sooo many ways

Actually, yes. i got it of my friend and just want to change it to AUBTM-23 for him.
Kartman wrote:
You need to read my tutorial on multitasking, get rid of the delays and get away from using external interrupts to do a task switch.

Good!
where can i find that tutorial?

"One's value is inherent; money is not inherent"

 

Chuck, you are in my heart!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If it is your friend's code -why doesnt he modify it? Your mythical freinds seem to play a large role in many of your questions.

So what is a aubtm-22 and how does it differ from a aubtm-23?

Look in the tutorials section and what do we find?
https://www.avrfreaks.net/index.p...

A quick Google found it as the first hit.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
If it is your friend's code -why doesnt he modify it? Your mythical freinds seem to play a large role in many of your questions.

:lol:
Yes.
so, he can't do it. :)
Kartman wrote:
So what is a aubtm-22 and how does it differ from a aubtm-23?

it's a bluetooth module.
the AT-Command of it is a little different. :roll:

Thank you for link.

"One's value is inherent; money is not inherent"

 

Chuck, you are in my heart!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To be honest I'd pretty much start from scratch. Throw away your "friends" code. Design the solution properly, implement it for the original (working/testable) device. When that is proven then look at command differences and port it to the new device. Well written, designed, modular code should be easy to port. Trying to port a knot of spaghetti will just leave you with an even bigger knot of spaghetti.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
To be honest I'd pretty much start from scratch. Throw away your "friends" code. Design the solution properly, implement it for the original (working/testable) device. When that is proven then look at command differences and port it to the new device. Well written, designed, modular code should be easy to port. Trying to port a knot of spaghetti will just leave you with an even bigger knot of spaghetti.

Thank you Cliff for reply,
awo!, cliff, i swear that got this code of my friend.
in fact, he give me this code untill change it and finally give me a little money(as wage).
for this, i got $50. i don't know it's suitable or not.

"One's value is inherent; money is not inherent"

 

Chuck, you are in my heart!