LOW PORTA cause serin2 not working.


Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    Aug 2009
    Posts
    3

    Default LOW PORTA cause serin2 not working.

    Really need some help here.
    I spent the whole weekends still not able to figure out the problem:
    LOW PORTA.4
    will cause serin2 stop working

    If I comment out the ' LOW PORTA.4 ' in my code.
    It works fine.

    Can someone shed any light onto the problem ?
    BTW, I use PBP250A. the chip is PIC12F635.

    Code:
    Include "modedefs.bas"
    
    OSCCON = $60
    TRISA = %11111110
    PORTA = GPIO
    BaudRate    CON 188
    
    STR1 VAR BYTE[12]  'Use as Lat and other
    STR2 VAR BYTE[12]   'Use as Log 
    T Var BYTE
    
    RS232_out var PORTA.1
    GPS var PORTA.2  
    RS232_in var PORTA.5
    
    GPIO.0 = 0
    GPIO.1 = 0
    GPIO.2 = 1
    GPIO.3 = 1
    GPIO.4 = 0
    GPIO.5 = 1
    
    Init:
        SERout2 RS232_out,BaudRate,["at+clip=1",10,13]
        SERIN2 RS232_in,BaudRate,2000,Init,[WAIT("OK"),T]
        
        
    read 1,STR1[0]
    if STR1[0] = "1" THEN
        LOW PORTA.4   'Here is the problem
        SERout2 RS232_out,BaudRate,["On",10,13] 
    else
        HIGH GPIO.4
        SERout2 RS232_out,BaudRate,["Off",10,13] 
    endif
    
    PAUSE 1000
    
    SERIN2 RS232_in,BaudRate,[WAIT("+CLIP: ",34,"+8600"), STR STR2\12]
    'Not enough RAM, use Lat to get caller id
    
        select case STR2[0]
            Case "1"
                write 1,STR2[0]
            Case "2"
                write 1,STR2[0]
            case "3"
                'Get Tracking
                SERout2 RS232_out,BaudRate,["ATA",10,13]
                PAUSE 1000
                SERIN2 GPS,BaudRate,2000,Reboot,[WAIT("$GPGGA,"),Skip 11,STR STR1\12,STR STR2\12] ' Fill the arrays with received data.
                SERout2 RS232_out,BaudRate,["AT+vts=*;+vts=",STR1[0],";+vts=",STR1[1],";+vts=",STR1[2],";+vts=",STR1[3],";+vts=",STR1[5],";+vts=",STR1[6],";+vts=",STR1[7],";+vts=",STR1[8],10,13]
                PAUSE 5000
                SERout2 RS232_out,BaudRate,["AT+vts=#;+vts=",STR2[0],";+vts=",STR2[1],";+vts=",STR2[2],";+vts=",STR2[3],";+vts=",STR2[4],";+vts=",STR2[6],";+vts=",STR2[7],";+vts=",STR2[8],10,13]
                PAUSE 5000
        end select
        SERout2 RS232_out,BaudRate,["ATH",10,13]
    
    Reboot:
    @ goto $
    Last edited by mikewen; - 23rd August 2009 at 21:04.

Similar Threads

  1. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  2. confused problem with interrupt in a working program
    By illuminator4 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th November 2008, 17:01
  3. Pic16f84 and RC5 kode
    By terminator in forum Bluetooth
    Replies: 5
    Last Post: - 18th June 2007, 21:40
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. Problems with RC2 and RC3
    By Christopher4187 in forum General
    Replies: 11
    Last Post: - 29th May 2006, 17:19

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