8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Moderators: Ajay, junied, abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
ashishdaga
Sun May 11 2008, 12:24AM
 User Offline
Registered Member #7524
Joined: Tue Apr 29 2008, 02:48PM

Posts: 8
Thanked 0 times in 0 posts
CODE:
here is my sample code for serial communication
org 00h
sjmp 30h

org 30h
start:
mov tmod,#20h
mov th1,#0fdh
mov scon,#50h
setb tr1
ag:
jnb ri,$
mov a,sbuf
clr ri
inc a
mov sbuf,a
jnb ti,$
clr ti
sjmp ag
end


baud rate is 9600 1stop bit and no parity

this works fine i.e when i send a 1 to the microcontroller from the pc
microcontroller increments and sends me a 2.i checked this in advanced serial port monitor.
http://www.aggsoft.com/serial-port-monitor.htm

when i replace inc a with mov a,#07 then it shows no transmission from microcontroller side.what could be the problem

is there any other gud software for checking my serial data???
help me urgently??


Back to top


pdi33
Sun May 11 2008, 04:26AM

 User Offline
Registered Member #1329
Joined: Mon Jun 04 2007, 09:28AM

Posts: 228
Thanked 37 times in 37 posts
hi ashish,
the problem with ur code is about the way the PC communicates in. Well, it does not communicate in hex or decimal. in fact it can only recognize ASCII codes. So in the first case when u send say 1 to the microcontroller, the value that ur accumulator is actually receiving is 31h (ascii for '1'). this is then incremented i.e. it takes the value 32h and sends back to PC which recognises it as character '2'. But in the second case( where u found a problem), u r sending a fixed value 07h which is recognised as a special command (audible bell in this case) so u are not seeing any characters on the PC. try sending say 37h and u will get character '7' on the screen.

u can also send/receive bytes on the hyper terminal for checking ur serial hardware communication. just take care that the settings on baud rate etc. match ur microcontroller settings.

inspired to develop,developing to inspire
Back to top



This post has been thanked 1 time
ashishdaga
Sun May 11 2008, 04:33AM
 User Offline
Registered Member #7524
Joined: Tue Apr 29 2008, 02:48PM

Posts: 8
Thanked 0 times in 0 posts
thanks a lot for replying will chk that soon
Back to top


 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems