Forum Replies Created
-
AuthorPosts
-
Ligo GeorgeKeymaster
You may use interrupt for reading message indications from GSM module.
Use UART_Read() to read data only after receiving data. You can make sure that the data is received, by using UART_Data_Ready().Ligo GeorgeKeymasterWhat are the errors ?
You should use small letters for int, char, float etc.
Ligo GeorgeKeymasterTry using following functions.
void gsmInit() { UART1_Init(9600); Delay_ms(200); UART1_Write_Text("ATE0\r"); // ECHO OFF Delay_ms(100); UART1_Write_Text("AT+CMGF=1\r"); // Text Mode Delay_ms(100); UART1_Write_Text("AT+CNMI=2,0,0,0,0\r"); Delay_ms(100); } void gsmSendSMS(char mobile[11], char message[10]) { UART1_Write_Text("AT+CMGS=\""); UART1_Write_Text(mobile); UART1_Write_Text("\"\r"); UART1_Write_Text(message); UART1_Write_Text(26); Delay_ms(100); }
Ligo GeorgeKeymasterThat error will be related to standard C syntax and usage.
Ligo GeorgeKeymasterYou should use UART1_Read_Text() or UART1_Read() without any delays…
Eg:for(i=0;i<34;) { if(UART1_Data_Ready()) { s[i] = UART1_Read(); i++; } } // All further data processing or LCD commands should be here..
Ligo GeorgeKeymasterYes, ofcourse.
HC06 is a 3.3V device. So power it from a 3.3v supply. Make grounds of both supply common.
You should reduce the 5V TX output of PIC to 3.3V by using voltage divider resistors before connecting to RX of HC06. You can use a 10K and 4.7K for that.
3.3V TX output of HC06 can be directly connected to PIC RX. PIC will detect 3.3V as HIGH level.
Ligo GeorgeKeymasterFirstly store all characters to a character array.. then print that string on LCD.
Ligo GeorgeKeymasterFor MPLAB you can use the following link.
Generating PWM with PIC Microcontroller – MPLAB Hi-Tech C
That code is working fine for me.
Ligo GeorgeKeymasterMikroC libraries are working fine without any problem. Try the following link.
Ligo GeorgeKeymasterIf you are using MikroC, please use the HELP section to find details of SoftUART library. It is very easy to use.
Ligo GeorgeKeymasterYes, you can. You have two options.
- Multiplex UART using IC 74HC4052
- Using Software UART, which means that you can program any GPIO pin of PIC as UART. MikroC Pro provides built in library for that.
Ligo GeorgeKeymasterMikroC functions are 100% working..
You can use the following MPLAB XC8 tutorial to write your own functions.
Ligo GeorgeKeymasterYes make sure that PIC baud rate matches with that of GSM module.
Ligo GeorgeKeymasterHello
I don’t understand what you are saying. If you are talking about GSM modem,, its data is already ASCII, no need to make any change.
Ligo GeorgeKeymasterYou may separate required data by doing some string operations in the received data.
-
AuthorPosts