Discussion in "8051 Discussion Forum" started by    Alok Shah    Apr 2, 2008.
Wed Apr 02 2008, 07:36 pm
#1
i wanted to know how to program 89c52 using bascom compiler...
Wed Apr 02 2008, 08:20 pm
#2
Download BASCOM 8051 Manual
you will get a lot of info inside.. to get you started..

here is small piece of code..
$baud = 9600
$crystal = 11059200       ' 11.0592 MHz crystal
Print "Rickey's World"
End


[ Edited Wed Apr 02 2008, 09:38 pm ]
Tags bascom 8051 serial communication
Thu Apr 03 2008, 01:34 am
#3

thank you.
very good.
:bye
Sat Apr 05 2008, 03:24 pm
#4
i have gone through the manual..but didnt get wat i was lookin for...can you please help me to send AT commands using 89c52 uc to a max 232 ic which is interfaced with GSM module...do i need to send data to the sbuf first and then transfer it on the tx pin...or will the "print" command do the same...
i tried using the same program given above and connected it to a hyperterminal...but cudnt read the data there...help plz..


[ Edited Sat Apr 05 2008, 03:26 pm ]
Sat Apr 05 2008, 08:18 pm
#5
You don't need to do anything with sbuf. 'Print' will handle all that.
Have you setup hyperterminal properly......baudrate 9600,8-N-1,flowcontrol-none ?
If you're not getting any output in hyperterminal,it could either be incorrectly configured hyptrmnl,some problem with the serial connection with MAX,or the microcontroller itself or it's associated circuitry.
Do check all connections carefully.
Sat Apr 05 2008, 10:24 pm
#6
print command will do..
thats why basic is so simple.. and it really spoils you
Sun Apr 06 2008, 11:07 pm
#7
thnks guys..i think there shld be sm thing wrong wid the hardware only..will check it again..thanks once again...
Mon Apr 07 2008, 07:13 pm
#8
hi guys..
i wanted to know how to send special characters like "ctrl+z" through serial port using bascom...i know the decimal equivalent of "ctrl +z" is 26..but if i print 26 using bascom will it take it as the ctrl+z...a part of the program i have written is as follows

dim crz as integer
crz=26
print crz

tell me if this is the correct way to transmit a decimal equivalent...
Mon Apr 07 2008, 07:34 pm
#9
following is the codei have written to config the gsm modem..plz correct it and reply asap...thanks...


$regfile = "89s8252.dat"
$crystal = 11059200
$baud = 9600

Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = P1.4 , Db5 = P1.5 , Db6 = P1.6 , Db7 = P1.7 , E = P1.3 , Rs = P1.2

Dim Name As String * 12
Dim Crz As String * 5

Crz = "26"

Print "AT+CSCA=+919892051914 " 'mesg center no

Waitms 1000

Print "AT+CMGF=1" 'initializing modem
Waitms 1000

Print "AT+CSMP=17,168,0,0" 'using eng char
Waitms 1000

Print "AT+CMGS= " + 9198197xxxxxx "" 'number to send mesg to
Waitms 1000

Printhex Crz

End
Tue Apr 08 2008, 11:29 am
#10
Use print chr(26); or if you prefer print chr(Crz);
Please note that when you use the print statement always add a crlf at the end of the string;
so you have to suppress this crlf with the ";" and then send ONLY the cr.

Print "AT+CSCA=+919892051914 "; 'suppress cr lf
print chr(13); 'now send cr

Regards

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Michailqfh
Fri Mar 29 2024, 01:53 am
Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm