View previous topic :: View next topic |
Author |
Message |
gust Guest
|
sms with pic |
Posted: Thu Mar 06, 2008 6:56 am |
|
|
Hi all
I have a project about sms, i succeeded in making interface between nokia mobile & hyperterminal by using AT command
how can i make interface between 16F877 & the same mobile "software &hardware"
thanks alot in advance. |
|
|
joven
Joined: 30 Jan 2007 Posts: 56 Location: Viana do Castelo - Portugal
|
|
Posted: Thu Mar 06, 2008 10:38 am |
|
|
can you use the serial interface of the mobile |
|
|
Guest
|
|
Posted: Sun Mar 23, 2008 3:12 pm |
|
|
hi joven, do u know the connections of the modem and the microcontroller for the serial connection? |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Sun Mar 23, 2008 4:24 pm |
|
|
Sorry but you will have to be a bit more specific before we can give you an answer to these questions.
On the PIC16F877 the serial receive pin is called RX and the transmit TX. The exact pin number depends on the chip housing. Are you using the PDIP, PLCC or QFP housing?
For the Nokia we can't tell without knowing which phone you are using. What is the type number of your phone?
Did you have a look at the Nokia support site? |
|
|
Guest
|
|
Posted: Sun Mar 23, 2008 6:07 pm |
|
|
i'm using a wavecom modem and also PIC16f873a |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Sun Mar 23, 2008 7:03 pm |
|
|
For the PIC processor still the same question stands: if you don't tell us which package type you are using we can't tell you the pin number. Find them yourself by looking at page 2 of your PIC16F873A datasheet, look for the RX and TX pins.
Wavecom has many different modems. Which one are you using? |
|
|
Guest
|
|
Posted: Sun Mar 23, 2008 11:31 pm |
|
|
i'm currently using wavecom fastrack supreme 10....
my connections with the PIC are
RC6(TX) ---> T1IN(MAX232) ---> T1OUT(MAX232) ---> RXD(MODEM)
TXD(MODEM) ---> R1IN(MAX232) ---> R1OUT(MAX232) ---> RC7(RX)
GND --> GND
what clock osc should i use for the crystal? is it possible to operate at 4MHz? or should i use higher frequency for 115200bps baud rate? thanks for the reply!
are my connections correct? or is it something to do with my program that i'm not receiving response from the modem?? |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Mar 24, 2008 9:06 am |
|
|
Quote: | what clock osc should i use for the crystal? is it possible to operate at 4MHz? or should i use higher frequency for 115200bps baud rate? | At this clock frequency you get a frequency error of 8.5%, that's too high. The maximum allowed error for reliable communication is 3%. Strange, normally the compiler will issue a warning if the clock frequency and baudrate don't match. What is your compiler version number?
Either lower the baudrate or choose another crystal. Best is to choose a crystal frequency that is a multiple of your baudrate, so not a nice round xMHz value but one of those crystals with many decimals specified.
Helpful is to use a baudrate calculator tool like the one from Micromagic Systems
Your connections look right but there might be a few small gotcha's like:
- The modem is communicating at a different baudrate than you think.
- The modem expecting hardware flow control (DTR, DSR and CTS lines). This can be configured in the modem.
- Maybe the modem is only sending data as a response to your commands? If you don't send a command then there is no data from the modem?
An easy method to check this is by connecting the modem to your PC using the same 3 signals. Can you communicate with the modem then?
If all the above works correct the problem is most likely in your program. Have a look at the program ex_sisr.c in the Examples directory of the CCS compiler. |
|
|
keanesiew
Joined: 24 Mar 2008 Posts: 2
|
|
Posted: Mon Mar 24, 2008 1:49 pm |
|
|
i just sign up to the forum, previously it was me... thanks for the reply... but i tried writing the program using 18MHz and also tried with 20MHz... in the program, i simply used the ADC to obtain a temperature from the LM35 and displays on LCD...
it is not working when i'm using the crystal 18Mhz or 20Mhz but it works when i'm using 4MHz... what does this mean? does it mean that my pic16f873a does not support such high crystal frequency? does the crystal capacitors affect?
therefore, i'm unable to set the baudrate of 115200 to communicate with the modem? pls help me here... thank you!
keane |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Mar 24, 2008 3:36 pm |
|
|
What is your compiler version?
The newer versions will give an error message when you try to compile 4MHz and 115200 baud.
Quote: | it is not working when i'm using the crystal 18Mhz or 20Mhz but it works when i'm using 4MHz... | You should use the HS fuse settings for the 18 and 20MHz clock speeds. The 4MHz clock will work with HS or XT fuse. |
|
|
keanesiew
Joined: 24 Mar 2008 Posts: 2
|
|
Posted: Mon Mar 24, 2008 4:06 pm |
|
|
yes, it did show an error message when i try to compile 4Mhz and 115200 baudrate.. therefore, i used 18Mhz and 20Mhz to compile with the 115200 baudrate.. i did set HS fuse.. compile succeeds...
before trying to communicate with the modem, i simply wrote a program just to display characters on the LCD with 20Mhz crystal used and compiled into the program.. it seems not to display anything on the LCD except blinkings and weird characters instead of what i programmed.. i'm currently using a pic16f873a.. as i know, the pic supports 20Mhz... i'm doing the testing on a breadboard.... does the capacitors affect? what do u think the problem might be?? thanks for the reply...
keane |
|
|
|