TC35i GSM With PIC 16F690 help


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    I used the pins 10 & 12 of 16f690 instead of 17 & 18 of 16F873. Hope it will work
    If you have in mind to use the downloaded software, the answer is IT WILL NOT WORK.

    If you will write your own software the answer is YES IT WILL WORK.

    Al.
    All progress began with an idea

  2. #2


    Did you find this post helpful? Yes | No

    Red face

    Quote Originally Posted by aratti View Post
    If you have in mind to use the downloaded software, the answer is IT WILL NOT WORK.

    If you will write your own software the answer is YES IT WILL WORK.

    Al.
    Hi Aratti, your project has inspired me to do one by myself. I wont be connecting to the computer (as it does not have an serial port) neither I can get 16F873 that easily. So I am using 16F690.

    Any advise as to how to set up the registers, correctly for 690?

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Any advise as to how to set up the registers, correctly for 690?
    With pic 16F690 you need to turn off analog port to make them digital. You will accomplish this with the following instruction:

    Code:
    ANSEL = 0 : ANSELH = 0
    In my project I have used 8 ports as inputs and 8 ports as output. 690 doesn't have all these ports available, so you will decide how many inputs and how many outputs to use. Remember to set the TrisA; TrisB and TrisC registers accordingly.


    Al.
    All progress began with an idea

  4. #4


    Did you find this post helpful? Yes | No

    Exclamation

    Here is my code:

    OSCTUNE=%01111 ' Oscillator 8MHz
    intcon=0 ' Interrupts disabled
    cm1con0=0 ' Comparator 1 disabled
    cm2con0=0 ' Comparator 2 disabled
    ansel=0 ' Pins to be Digital
    anselh=0 ' Pins to be Digital
    baud con 16468 ' baud rate = 9600 Inverted
    trisc=%00000000 ' Port C I/O
    trisb=%01111111 ' Port B I/O
    trisa=%000000 ' Port A I/O
    portc=0 ' Setting port c Low
    portb=0 ' Setting port b Low
    porta=0 ' Setting port a Low
    i var byte ' Declaring variable
    c var byte ' Declaring variable
    tx var Portb.7 ' Declaring tx pin
    rx var Portb.5 ' Declaring rx pin

    Include "modedefs.bas"

    main:
    Serout2 tx,baud,["AT+CMGF=1",13]
    gosub one
    Serin2 rx,baud,5000,main,[wait("OK"),i]
    gosub two
    goto main

    one:
    for c=1 to 5
    portc=255
    pause 20
    portc=0
    pause 20
    next c
    return
    two:
    for c=1 to 5
    portc=255
    pause 400
    portc=0
    pause 400
    next c
    return

    My Problems:

    1) My led connected to portc only goes high ONCE in label one though it should enter label one every 5000mS.

    2) It never enters label two as I assume there is somthign wrong in the communication part of PIC with the modem.

    Please help me find out what am I doing wrong here?

  5. #5
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    It never enters label two as I assume there is somthign wrong in the communication part of PIC with the modem


    Code:
    main:
    Serout2 tx,baud,["AT+CMGF=1",13]
    gosub one
    Serin2 rx,baud,5000,main,[wait("OK"),i]
    gosub two
    goto main

    Remove the GOSUB One instruction! When you send an AT command to the modem, then you MUST immediatly switch to the SERIN2 instruction otherwise there is a high chance that the modem answer will be lost.

    Edited:
    baud con 16468 ' baud rate = 9600 Inverted
    Looking to the PBP manual the correct setting for 9600 bauds is 84 not 16468

    Did you use the MAX232 for connecting Pic to modem?

    Al.
    Last edited by aratti; - 29th September 2009 at 18:26.
    All progress began with an idea

  6. #6


    Did you find this post helpful? Yes | No

    Red face

    Done it to 84, so now it is transmitting in True mode. NOW the code is entering gosub one as expected BUT not gosub two.
    Changed the code to the following:
    main:
    gosub one
    Serout2 tx,baud,["AT+CMGF=1",13]
    Serin2 rx,baud,5000,main,[wait("OK"),i]
    gosub two
    goto main

    As always code never enters label two which means it is not getting the required response. I attach my setup photo, though not very clear but the schematic is the same except the pin change to 10 & 12 instead of your 17 & 18.
    Attached Images Attached Images  
    Last edited by financecatalyst; - 29th September 2009 at 19:15. Reason: Adding more info

  7. #7
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default

    tc35i factory settings for bounrate is 2400 not 9600!
    Becouse you use max its not inverted signal.
    on 2400 and true settings should be 396 if you use 4mhz crystal.
    here example of code how to star communication with modem if max232 is used:
    Code:
     Init:
    serout tx,0,["AT",13]
    serin2 rx,396,1000,init,[WAIT("OK")]

  8. #8
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Code:
    baud con 84 ' baud rate = 9600 Inverted
    Rx var Portb.7 ' Declaring rx pin
    Tx var Portb.5 ' Declaring tx pin
    
    Change your code as per the above, then it should work.

    Edited:
    Remember to allow the modem to settle after powerup, before start serial communication (See modem led blink)
    Al.
    Last edited by aratti; - 29th September 2009 at 19:49.
    All progress began with an idea

Similar Threads

  1. Want to learn GSM & PIC programming
    By financecatalyst in forum GSM
    Replies: 5
    Last Post: - 25th February 2014, 10:22
  2. GSM With PIC?
    By financecatalyst in forum General
    Replies: 1
    Last Post: - 20th September 2009, 00:12
  3. SERIN AND SEROUT PROBELM USING 16f690 PIC
    By Charles in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 18th January 2007, 04:59
  4. gsm card reader using pic
    By ninebarmaximus in forum General
    Replies: 0
    Last Post: - 6th December 2005, 19:08
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th March 2005, 00:14

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts