PDA

View Full Version : Help interface BenQ GSM Modem to IC16F62A



mbox
- 23rd September 2010, 16:15
I got a BenQ Gsm Modem, so far I got it running sending AT commands from PC to GSM module via hyperterminal using USB to serial converter. The GSM module is operates in 3.3v, Pic16F628A on 5v.
Questions:
1.] Obviously I going to need a voltage divider between the module and PIC, but how can I or can Imake Pic16F628A operate on a 3.3v, based on the datasheet in can operates 2.0-5.5v

2.] I want to try using the following setup connection(refer to the attach image) and the code below..

Include "modedefs.bas" ' Include serial modes
'Definitions
DEFINE OSC 4 'for 4 Mhz
'DEFINE OSC 8 'for 8 Mhz

DEFINE HSER_TXSTA 20h 'hardware assign

DEFINE HSER_RCSTA 90h '

DEFINE HSER_BAUD 9600 'for 9600 Baud rate

DEFINE HSER_SPBRG 12 '

DEFINE HSER_CLROERR 1 '

TRISB=%00000000
PORTB=%00000000

' Send signal tp PWON
HIGH PORTB.7
PAUSE 500
Low PORTB.7
PAUSE 3000

start:
HSEROUT ["AT",13] 'Send AT to modem followed by a CR
HSERIN 5000, start, [WAIT("OK")] ' wait 5sec to reply.
PAUSE 1000

goto start
End
Where it simply waits for 'OK'. Can I use PortC.6 (with max232) to COM Port at the same time?

thanks,
mbox

aratti
- 2nd October 2010, 20:49
Where it simply waits for 'OK'. Can I use PortC.6 (with max232) to COM Port at the same time?

You better not!

I suggest you to use a devider also for the PWON input.

Cheers

Al.

mbox
- 4th October 2010, 14:26
Hi Aratti, thanks for replying...

I suggest you to use a devider also for the PWON input.
do you mean to place another 3k3 to PWON and Gnd? Do you think if I use 3.3v to PIC16F628A will communicate well to the GSM module? I tried to supply the mcu with 3.3v with blinking program on PortB.0 but using the voltage meter no deflection shown.
Please help.....

regards,
joe

aratti
- 4th October 2010, 18:36
do you mean to place another 3k3 to PWON and Gnd?

Yes


if I use 3.3v to PIC16F628A will communicate well to the GSM module?

Yes


I tried to supply the mcu with 3.3v with blinking program on PortB.0 but using the voltage meter no deflection shown.

Did you disable brown-out reset feature?

Naturally if you use 3.3V you don't need the devider!


Cheers

Al.

mbox
- 7th October 2010, 14:14
sorry I've been away for awhile,been busy at work.

Did you disable brown-out reset feature?
Now it works great! :) I got to try it on with the GSM (wish me luck)
BTW I noticed that when I used USB to UART (Serial TTL) Converter... I did this to display data to my serial communicator, the power from PC provide 4.5v to my PIC. Funny because even I remove the 3.3v supply for the pic to run the blinky program, it still runs, I think the pc provides the voltage to keep it going.
Could this mean that if I Connect the GSM (3.3v) and connect a USB to UART it will provide 4.5v not 3.3v that could harm the GSM? Please give advice. I need the PC to see what I'm doing.

regards,
mbox

aratti
- 9th October 2010, 11:26
Could this mean that if I Connect the GSM (3.3v) and connect a USB to UART it will provide 4.5v not 3.3v that could harm the GSM?

Yes, You can safely obtain up to 100 mA from the USB port and use it to power your device. In case you will need 3.3 V you have to use a voltage regulator to drop it from 5V to 3.3 V



.... Please give advice. I need the PC to see what I'm doing.

If you want to connect your system to the PC via RS232 port then you should use a level translator as MAX3223, which will convert RS232 level to 3.3 V TTL and vice-versa. Without it you will fry your modem input line.

Cheers

Al.