Hello,
I am fairly new to programming PIC's and I have run into a complete wall. I am trying to interface a modem with a 16LF84A. The modem module I am using is a SLM2405 made my Wintec. It has a Silicon Labs chip set(SI2403) . I connection via the serial(UART) mode. According to the data sheet if I send the "AT" command I shoud recieve an "OK" from the modem. I am pretry sure the "AT" command is getting to the modem but I am not getting anything back from it. I have also connected an LCD to Display the recieved data from the modem. The modem uses a 3.3v supply and didgital input., so I am using a LP PIC and running the whole system on 3.3V . I have th LCD connected to PortA qnd the modem connected to PortB. The following is the code I am using.
[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"] '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
[\code]
I hope I have covered everything and my question is clear, if I have missed something please let me know.
any help would be greatly appreciated.
thanks
Jim
Bookmarks