DHANANJAYA L
Banned
- Joined
- Jan 21, 2009
- Messages
- 23
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 0
Post your code.
. The following program works successfully when PIC16f877a is interfaced with HyperTerminal.
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 #define _XTAL_FREQ 4000000L #define HIGH_SPEED 1 #if NINE == 1 #define NINE_BITS 0x40 #else #define NINE_BITS 0 #endif #if HIGH_SPEED == 1 #define SPEED 0x4 #else #define SPEED 0 #endif #define RX_PIN TRISC7 #define TX_PIN TRISC6 __CONFIG(XT & WDTDIS & PWRTEN & BORDIS & LVPDIS & DEBUGDIS & UNPROTECT ); #define LCD_PULSE() ((LCD_EN=1),(LCD_EN=0)) void wait(unsigned char msec); void Tx_string(const char *string); void Tx_byte(unsigned char byte); void interrupt receive(void); main() { TRISC=0b11000000;// Rx pin RC7 only i/p others o/ps including Tx pin PORTC=0b11000000; SPBRG = 25; RCSTA = (NINE_BITS|0x90); TXSTA = (SPEED|NINE_BITS|0x20); Tx_string("AT"); wait(100000); Tx_byte(0X0D); wait(100000); Tx_byte(0X0A); wait(100000); Tx_string("ATD944xxxxxxx;"); wait(100000); Tx_byte(0X0D); wait(100000); Tx_byte(0X0A); wait(100000); while(1); } void interrupt receive(void) // interrupt service routine { if(RCIE && RCIF) { RCIF = 0; } else if(ADIE && ADIF) { ADIF =0; } } void Tx_string(const char *string) { while(*string){ TXREG=*string; while(TRMT==0); string++; } } void Tx_byte(unsigned char byte) { while(TRMT==0); TXREG=byte; }
please help me...
Thank you!
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 #define _XTAL_FREQ 4000000L #define HIGH_SPEED 1 #if NINE == 1 #define NINE_BITS 0x40 #else #define NINE_BITS 0 #endif #if HIGH_SPEED == 1 #define SPEED 0x4 #else #define SPEED 0 #endif #define RX_PIN TRISC7 #define TX_PIN TRISC6 __CONFIG(XT & WDTDIS & PWRTEN & BORDIS & LVPDIS & DEBUGDIS & UNPROTECT ); #define LCD_PULSE() ((LCD_EN=1),(LCD_EN=0)) void wait(unsigned char msec); void Tx_string(const char *string); void Tx_byte(unsigned char byte); void interrupt receive(void); main() { TRISC=0b11000000;// Rx pin RC7 only i/p others o/ps including Tx pin PORTC=0b11000000; SPBRG = 25; RCSTA = (NINE_BITS|0x90); TXSTA = (SPEED|NINE_BITS|0x20); Tx_string("AT"); wait(100000); Tx_byte(0X0D); wait(100000); Tx_byte(0X0A); wait(100000); Tx_string("ATD944xxxxxxx;"); wait(100000); Tx_byte(0X0D); wait(100000); Tx_byte(0X0A); wait(100000); while(1); } void interrupt receive(void) // interrupt service routine { if(RCIE && RCIF) { RCIF = 0; } else if(ADIE && ADIF) { ADIF =0; } } void Tx_string(const char *string) { while(*string){ TXREG=*string; while(TRMT==0); string++; } } void Tx_byte(unsigned char byte) { while(TRMT==0); TXREG=byte; }
Code C - [expand] 1 2 3 4 5 6 7 TRISC=0b10000000;// Rx pin RC7 only i/p others o/ps including Tx pin PORTC=0b00000000; Tx_string("AT\r\n"); wait(100000); Tx_string("ATD944xxxxxxx;\r\n"); wait(100000);
Without a question you are asking for help???
Post your code.
Mention Which micro you are using and also the Fosc.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 void main() { TRISA = 0xFF; TRISB = 0x00; PORTB = 0x00; TRISC = 0x80; PORTC = 0x00; UART1_Init(9600); Delay_ms(200); while(1){ UART1_Write_Text("AT\r"); Delay_ms(1000); UART1_Write_Text("ATD9742453836;\r"); Delay_ms(10000); } }
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?