No Modem response


Results 1 to 17 of 17

Threaded View

  1. #3
    jimboho's Avatar
    jimboho Guest


    Did you find this post helpful? Yes | No

    Post

    OOPS thanks for catching that Dave,
    I posted the wrong code.
    here is the correct code
    Code:
    ' PIC:	16LF84A (low voltage)
    ' LCD connections
    '       DB4     PortA.0
    '       DB5     PortA.1
    '       DB6     PortA.2
    '       DB7     PortA.3
    '       RS      PortA.4 (add 4.7K pullup resistor to 5 volts)
    '       E       PortB.3
    '		
    '		RXD		PortB.6
    '		TXD		PortB.7
    '		RESET	PortB.5	
    
    Include "modedefs.bas"	' Include serial modes
    
    LF		CON	10			' Line feed constant
    RXD  	VAR PORTB.6  	'recive data pin
    TXD  	VAR PORTB.7		'transmit data pin
    RESET 	VAR PORTB.5		'reset pin
    SRIN 	VAR byte[2]		'array to hold modem tx data
    
    
    
    		SRIN[0]=0		'init SRIN byte to zero
    		SRIN[1]=0		'init SRIN byte to zero
    		pause 1000
    
    loop:   Lcdout $fe, 1   	' Clear LCD screen
    		Lcdout $fe,$80
    		Lcdout "Reseting Modem"		
    
    		'Reset Command. reset pin must be held low for 300ms then return
    		'to high state within 5ms.
    		low reset			
    		pause 300
    		high reset
    
    		pause 1000
    		Lcdout $fe, 1   	' Clear LCD screen
    		Lcdout $fe,$80
    		Lcdout "Sending"	
    		Lcdout $fe,$C0		' Move curser to second line
    		Lcdout  "serout command"	
    		serout2 TXD,813,["AT",13]	'Send AT command to modem
    		pause 200
    		serin2 RXD,813,3000,cont,[STR SRIN\2]	'Recieve 2 bytes from modem
    cont:		
    		Lcdout $fe, 1   ' Clear LCD screen
    		Lcdout $fe,$80
    		Lcdout "recieved: ",#SRIN[0],#SRIN[1]  'Display results from Modem	
    	
    finish: 	
    	 goto finish
    oh, by the way, how do you keep the code snipets formatted?

    thanks
    Last edited by jimboho; - 3rd November 2004 at 23:44.

Similar Threads

  1. Interface Pic --> Max232 --> GSM Modem
    By SangkiMangki in forum GSM
    Replies: 1
    Last Post: - 28th September 2013, 12:57
  2. Replies: 10
    Last Post: - 14th April 2007, 04:34
  3. SEROUT2 to GSM Modem
    By tommyers in forum General
    Replies: 5
    Last Post: - 21st August 2006, 21:35
  4. How to build modem for only send and receive the msg
    By PoTeToJB in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th April 2006, 13:37
  5. Reading a Hex value from a Modem and showing it as Decimal..
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th March 2005, 17:58

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