Discussion in "8051 Discussion Forum" started by    Alok Shah    Apr 2, 2008.
Wed Apr 02 2008, 02:06 PM
i wanted to know how to program 89c52 using bascom compiler...
Wed Apr 02 2008, 02:50 PM
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"

[ Edited Wed Apr 02 2008, 04:08 PM ]
Tags bascom 8051 serial communication
Wed Apr 02 2008, 08:04 PM

thank you.
very good.
Sat Apr 05 2008, 09:54 AM
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, 09:56 AM ]
Sat Apr 05 2008, 02:48 PM
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, 04:54 PM
print command will do..
thats why basic is so simple.. and it really spoils you
Sun Apr 06 2008, 05:37 PM
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, 01:43 PM
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
print crz

tell me if this is the correct way to transmit a decimal equivalent...
Mon Apr 07 2008, 02:04 PM
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

Tue Apr 08 2008, 05:59 AM
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


Get Social


Powered by e107 Forum System


Wed Jan 22 2020, 07:16 PM
I m getting errors while simulation process during interfacing socket output and lcd... Can i get the report of ur project which is same as us.
Tue Jan 14 2020, 08:08 AM
shubham kharade
when i am trying to simulate the program in Proteus 8 professional, I am getting some errors as cannot find module file dhtxx.md can u help me
Tue Dec 17 2019, 02:44 PM
hello..i am programming industrial timer using 8051 with 24lc64 eeprom. i have query in storing the 3 diff value in eeprom with enter button. can anyone share c code ?
Tue Dec 17 2019, 11:30 AM
Hello. Can anyone share the code in Bascon and scheme in Proteus?
Thu Nov 21 2019, 01:30 PM
how to interface 8051 microcontroller with NRF24L01+ module
Sat Oct 12 2019, 11:23 PM
Log in.. then post your code in the 8051 forum
Sat Oct 12 2019, 11:18 AM
Bhadra Sajikumar
i am doing a countdown timer with 8051 for my project, unfortunately our professor had to take a leave of absence before he could teach us most of it.. can someone explain the .asm code of it for me?
Mon Sep 23 2019, 08:37 AM
I am doing a project for my schools wireless security system with cameras,sensors and spot lights using 8051 micro controller, could you help me out with the design and its source code.
Wed Sep 18 2019, 09:48 PM
Caryn Kover
Thank you for your time,
Mon Aug 05 2019, 08:09 PM
@Ismail ..post in forum, give details



Sun Jan 19 2020, 02:13 AM
Sat Jan 11 2020, 10:42 AM
Tue Jan 07 2020, 06:53 PM
Tue Jan 07 2020, 12:42 PM
Sun Dec 29 2019, 05:54 AM
Fri Dec 27 2019, 06:14 PM
Sat Dec 14 2019, 12:31 PM
Thu Dec 12 2019, 12:04 PM


Guests: 12, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38116
Newest member: Nippy56
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Jan 17 2020, 10:24 PM
We will need the circuit diagram.A Proteus simulat...
Billz Avatar
Posted By Billz
Sat Jan 11 2020, 05:43 PM
hi everyone please attached files are my c code fo...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jan 07 2020, 08:18 PM
Not a stupid question.Setting up "Eclipse" can be...
elt Avatar
Posted By elt
Tue Jan 07 2020, 07:06 PM
So i have just began learning programming micros a...
Billz Avatar
Posted By Billz
Mon Jan 06 2020, 09:22 PM
I think it would be better if you guys try to come...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Jan 06 2020, 12:22 AM
Can you post a circuit diagram and any code you ha...
Billz Avatar
Posted By Billz
Sun Jan 05 2020, 08:17 PM
Need help regarding C code (specifically for PIC 1...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Dec 30 2019, 06:42 PM
Can you give more details of your problem.
Rupeshpatil Avatar
Posted By Rupeshpatil
Fri Dec 27 2019, 06:21 PM
How to copy program my old microcontroller to new ...
ilylily07 Avatar
Posted By ilylily07
Thu Dec 12 2019, 02:26 PM
wil do.thank you for your advice!