View previous topic :: View next topic |
Author |
Message |
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Tue Feb 04, 2014 2:49 pm |
|
|
Hi Low,
I looked at the datasheet, a noted a couple of important things. First, the pin nomenclature is a bit odd. I see where it comes from, but in my opinion it's a
potential source of confusion. In the case of the TC-35, the 'Tx' pin is the input, and the 'Rx' pin is the output. So, the Tx pin on the modem gets
connected to the Tx pin on the PIC. The same for the Rx pin!
I identified another issue. The TC-35 is a 3.3V-ish device, and the 'RS232' levels are CMOS 2.65V. This means that you really can't connect the modem
directly to the PIC if the PIC is powered at 5V. The PIC output *may* damage the GSM input, and the GSM output will most likely be not enough to reliably
trigger the PIC input.
So, you have two possible solutions:
Solution #1: Power your PIC and your TC-35 at 3.3V. This may require a special version of the PIC. I'll leave that to you to determine.
Solution #2: Power the TC-35 at 3.3V, and the PIC at 5V, and use a 'level translator' between the two. By a level translator, I mean
something like this: https://www.sparkfun.com/products/11978
Are you sure you made the TC-35 work with your PC? I don't see how you did that without some additional hardware? Also, the TC-35 has a
rather rigorous 'Turn-on' procedure. How did you accomplish that?
John |
|
|
low
Joined: 04 Feb 2014 Posts: 28 Location: Malaysia
|
|
Posted: Wed Feb 05, 2014 12:56 pm |
|
|
Hi ezflyr,
Ya.. I very sure TC-35 work to my PC... I use the adapter 12V directly connect to the GSm module to power up it...
Regards |
|
|
low
Joined: 04 Feb 2014 Posts: 28 Location: Malaysia
|
|
Posted: Wed Feb 05, 2014 1:02 pm |
|
|
[http://www.thanksbuyer.com/gsm-sms-tc35-remote-control-module-900-1800mhz-voice-adapter-uart-rs232-for-arduino-avr-51-27375?keyword=GSM%20SMS]
This type of TC35 GSM module i using...
Regards |
|
|
low
Joined: 04 Feb 2014 Posts: 28 Location: Malaysia
|
|
Posted: Wed Feb 05, 2014 1:43 pm |
|
|
Hi Gabriel,
What is the mean COMMS FAILED??? My LCD display COMMS FAILED RETRYING- STRUCK
Regards |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Wed Feb 05, 2014 3:19 pm |
|
|
Hi Low,
Well, the module shown in the link you posted today is totally different than the module shown in the link you posted yesterday. This makes me realize
that we are all wasting our valuable time trying to help you! Without good, solid and reliable data, how do you think you are going to get your project
completed?
Your question to Gabriel further highlights the fact that you don't even have a basic idea about what's going on with the hardware or the 'driver' that's
been provided to you. Frankly, this project has a very low probability of success.....
The module you show today appears to have a 9 Pin 'D' connector, so it most likely has a TTL-to-RS232 converter built in. That is why you can
use it with your PC. That mystery is now solved. So, you need to add a MAX232 device to your PIC, so that you can then connect directly to the
board you've shown today.
PIC ---> MAX232 ---> TC-35 Modem Board
I'll leave it to you to figure out the cabling, but remember, the TC-35 Tx output needs to ultimately connect to the PIC Rx input, and the TC-35 Rx
input needs to ultimately connect to the PIC Tx output.
John |
|
|
low
Joined: 04 Feb 2014 Posts: 28 Location: Malaysia
|
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Thu Feb 06, 2014 10:53 am |
|
|
Hi Low,
In the driver provided by Gabriel, he is using a 'PWM' output to generate a negative bias voltage for his LCD. My guess is you don't need that, so just
get rid of that code.
BTW, how is it that you built the code before (you showed us an error message generated by the code!), but now you can't build it???
John |
|
|
low
Joined: 04 Feb 2014 Posts: 28 Location: Malaysia
|
|
Posted: Thu Feb 06, 2014 11:34 am |
|
|
hi ezflyr,
Before i delete the code but it came out 6 warnings with 0 error...
Then i try burn the hex run it.....
Regards |
|
|
low
Joined: 04 Feb 2014 Posts: 28 Location: Malaysia
|
|
Posted: Thu Feb 06, 2014 11:04 pm |
|
|
hi ezflyr,
The LCD still display COMMS FAILED RETRYING- STRUCK???
Which part i did it wrong???
Regards |
|
|
low
Joined: 04 Feb 2014 Posts: 28 Location: Malaysia
|
|
Posted: Fri Feb 07, 2014 2:16 am |
|
|
Hi ezflyr,
Thank you i success send the message.... Now want change the coding in real project....
Thank you
Regards, |
|
|
low
Joined: 04 Feb 2014 Posts: 28 Location: Malaysia
|
|
Posted: Fri Feb 07, 2014 10:28 am |
|
|
hi,
The input i using PIR sensor... How to change the code which when PIR detected able to send the sms for first alert message then wait after 5 min just send for second message??? Below is my code ardy able to send sms
Code: | #include <18F4550.h> // PIC18F4550 HEADER FILE
#include <stdlib.h>
#fuses HS,NOWDT,NOLVP,NOPROTECT // EXTERNAL CLOCK, NO WATCH DOG TIMER, NO LOW VOLTAGE PROGRAMMING
#use delay (clock=20M) // 20 MHZ CRYSTAL
#include <lcd.c> // LCD DISPLAY HEADER FILE
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,stream=GSM)
#define LED1 PIN_B6 // LED1
#define BUZZER PIN_B7 // BUZZER
#define BUTTON1 PIN_B0 // PRESET BUTTON 1
#define LCD_E PIN_D0 // PIN E
#define LCD_RS PIN_D1 // PIN RS
#define LCD_RW PIN_D2 // PIN RW
#define LCD_D4 PIN_D4 // PIN D4
#define LCD_D5 PIN_D5 // PIN D5
#define LCD_D6 PIN_D6 // PIN D6
#define LCD_D7 PIN_D7 // PIN D7
void PIR();
void main()
{
lcd_init(); //INITIALISE LCD
lcd_putc("\f....WELCOME.....");
delay_ms(1000);
lcd_putc("\f");
lcd_putc("\n...loading...!");
delay_ms(1000);
lcd_putc("\f");
lcd_putc("\f....Ready");
delay_ms(1000);
while(TRUE) // always repeat program
{
printf(lcd_putc,"\fSystem On!!"); // DISPLAY VR VALUE AT LCD DISPLAy
delay_ms(5);
if (!input(BUTTON1)) // when press button 1
{
output_high(LED1); // turn on LED1
delay_ms(100);
PIR();
else
{
output_low(LED1);
output_low(BUZZER);
lcd_putc(0x01);
delay_ms(300);
}
}
}
void PIR()
{
printf("AT+CMGF=1\n\r"); //It inhabits the text mode sms
delay_ms (500);
fprintf(GSM, "at+cmgs=\"0174366043\"\r\n");
delay_ms (4000);
printf ("GSM TC35");
delay_ms (500);
putchar (0x1a); //Ctrl-Z(send)
}
Thank you
Regards, |
|
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Fri Feb 07, 2014 12:41 pm |
|
|
it means the communication between the module and the PIC is failing.
The pic is sending "AT" and the modem is not responding with "OK"
it will remain stuck in a loop retrying until it receives the appropiate OK response form the module.
In other words... you hardware is wrong because your connections to the GSM module are not working.
... as a simple test, try switching the TX RX lines...
Are you sharing the Ground?
G. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Fri Feb 07, 2014 12:43 pm |
|
|
Quote: | In the driver provided by Gabriel, he is using a 'PWM' output to generate a negative bias voltage for his LCD. My guess is you don't need that, so just
get rid of that code. |
That is correct. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Fri Feb 07, 2014 4:23 pm |
|
|
Hi Low,
At this point, I think you've got to play a little bit! If we show you everything, how are you going to learn?
As far as your request, in it's simplest form, just wait for the signal from the PIR detector, and then send Msg #1. Now enter a delay loop for 5 minutes, and at the end send Msg #2. Your code won't be able to do anything else during the delay, so in that sense it's not very well written, but at least it will satisfy your stated design criteria.
John |
|
|
low
Joined: 04 Feb 2014 Posts: 28 Location: Malaysia
|
|
Posted: Fri Apr 11, 2014 12:34 am |
|
|
hi masters,
Now i want continue my project which can received and display the message on the lcd...
I already read all the old or past post i still cant get the point to start... Can masters show me some hint????
Thank you
Regards |
|
|
|