thunderfsi
Newbie level 3
- Joined
- Dec 16, 2012
- Messages
- 3
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,298
Hi everyone, I'm having a problem on my circuit. I send AT commands from PIC. After they pass MAX232 "AT" turns into "_" and enter command turns into "y". I'm new to these stuff. Can anyone please help ?
Circuit: View attachment v1.3.rar
Circuit: View attachment v1.3.rar
Code:
sbit LCD_RS at RC0_bit; // LCD_RS assigned to PORT RC0;
sbit LCD_EN at RC1_bit; // LCD_EN assigned to PORT RC1;
sbit LCD_D4 at RC2_bit; // LCD_D4 assigned to PORT RC2;
sbit LCD_D5 at RC3_bit; // LCD_D5 assigned to PORT RC3;
sbit LCD_D6 at RC4_bit; // LCD_D6 assigned to PORT RC4;
sbit LCD_D7 at RC5_bit; // LCD_D7 assigned to PORT RC5;
sbit LCD_RS_Direction at TRISC0_bit; // LCD_RS assigned to TRIS C0;
sbit LCD_EN_Direction at TRISC1_bit; // LCD_EN assigned to TRIS C1;
sbit LCD_D4_Direction at TRISC2_bit; // LCD_D4 assigned to TRIS C2;
sbit LCD_D5_Direction at TRISC3_bit; // LCD_D5 assigned to TRIS C3;
sbit LCD_D6_Direction at TRISC4_bit; // LCD_D6 assigned to TRIS C4;
sbit LCD_D7_Direction at TRISC5_bit; // LCD_D7 assigned to TRIS C5;
#define OSC 20
void main(){
ADCON1 = 0x06; //Analog to Digital Conversion
TRISA=0xFF; //Set PORTA as Input
TRISB=0x00; //Set PORTB as Output
TRISC=0x80; //set direction of PORTC6 as output -- TX -- transmitter //set direction of PORTC7 as input -- RX -- reciever
TRISD =0x00;
TRISE =0x00;
RB0_bit=0;
UART1_init(9600); // Initialize UART at 9600bpm
delay_ms(1000);
Lcd_Init();
Lcd_cmd(_LCD_CLEAR);
Lcd_cmd(_LCD_CURSOR_OFF);
UART1_Write_Text("AT");
delay_ms(1000);
UART1_Write(0x0D); // ENTER
delay_ms(2000);
Lcd_Out(1,1, "Message Sent");
delay_ms(3000);
Lcd_cmd(_LCD_CLEAR);
Lcd_cmd(_LCD_CURSOR_OFF);
}