Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 8th October 2007, 12:49 PM   (permalink)
Default software uart

i got this code from a site, but i cant assemble it in keil
which assembler whould i use??
or is there some fault with the code itself??
the '*' are giving some problem

"djnz r1,*" for instance



TXD EQU P1.0 Transmit on this pin
RXD EQU P1.1 Receive on this pin
* The serial baud rate is determined by the processor crystal, and
* this constant which is calculated as: (((crystal/baud)/12) - 5) / 2
BITTIM EQU 45 (((11059200/9600)/12) - 5) / 2
*
* Transmit character in A via TXD line
*
putc CLR TXD Drop line for start bit
MOV R0,#BITTIM Wait full bit-time
DJNZ R0,* For START bit
MOV R1,#8 Send 8 bits
putc1 RRC A Move next bit into carry
MOV TXD,C Write next bit
MOV R0,#BITTIM Wait full bit-time
DJNZ R0,* For DATA bit
DJNZ R1,putc1 write 8 bits
SETB TXD Set line high
RRC A Restore ACC contents
MOV R0,#BITTIM Wait full bit-time
DJNZ R0,* For STOP bit
RET
*
* Receive a character from the RXD line and return in A
*
getc JB RXD,* Wait for start bit
MOV R0,#BITTIM/2 Wait 1/2 bit-time
DJNZ R0,* To sample in middle
JB RXD,getc Insure valid
MOV R1,#8 Read 8 bits
getc1 MOV R0,#BITTIM Wait full bit-time
DJNZ R0,* For DATA bit
MOV C,RXD Read bit
RRC A Shift it into ACC
DJNZ R1,getc1 read 8 bits
RET go home


is this workable??
baftab is offline  
Old 8th October 2007, 01:27 PM   (permalink)
Default

I Suppose this code is for a 8051 Micro controller, right?

a simple question, why don't you use the hardware UART.. ?
__________________
Ibrahim Kamal
check my electronics and robotics page: http://www.ikalogic.com/
ikalogic is offline  
Old 8th October 2007, 01:31 PM   (permalink)
Default

Quote:
Originally Posted by ikalogic
I Suppose this code is for a 8051 Micro controller, right?

a simple question, why don't you use the hardware UART.. ?
Go to the back of the class!

You've not being paying attention, he has another thread asking about dual UART's.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 8th October 2007, 01:51 PM   (permalink)
Default

the hardware uart is already being used
am interfacing a rfid reader and my pc to the controller

i need an extra serial port...
i knw there are controllers available with 2 uarts, but i cant find them here...in my city...


so..?? which assembler should i use???

i think
djnz r1,*

means as long as r1 is not zero, keep on looping??
right??

keil assembler is not assembling

NOW Nigel...some help??
baftab is offline  
Old 8th October 2007, 01:57 PM   (permalink)
Default

Quote:
Originally Posted by baftab
NOW Nigel...some help??
Only on a PIC I'm afraid, but my tutorial does describe how it works?
http://www.winpicprog.co.uk/pic_tutorial7.htm
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 8th October 2007, 02:03 PM   (permalink)
Default

there has to be someone on this site...good in 89c51 assemble

??

wake up ppl...help me out!!!
baftab is offline  
Old 8th October 2007, 02:11 PM   (permalink)
Default

Quote:
Originally Posted by baftab
there has to be someone on this site...good in 89c51 assemble
It's so old they are probably all dead!

It only seems to be used out India/Pakistan way?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 8th October 2007, 02:44 PM   (permalink)
Default

lol yeh...or they might be afraid to come out and show that they know something abt 89c51...they'll be ridiculed at

yeh...am not sure abt india, but in pakistan latest ics are not available..somethin to do with import restrictions on electronics equipments

we get the used ones and old ones :s

i couldnt find a single controller with 2 uarts here :S
no fair!!!
baftab is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Why does'nt it work!!!!!(dual uart) tkvenki Micro Controllers 1 18th February 2008 06:06 AM
CNC software for PCB drilling 3v0 General Electronics Chat 5 28th February 2007 11:14 PM
UART Message Display Softwares Gayan Soyza Micro Controllers 6 7th February 2007 06:44 AM
Breadboard design software? ThermalRunaway General Electronics Chat 10 24th July 2005 01:35 PM
software uart edrich Micro Controllers 3 12th July 2004 06:44 AM



All times are GMT. The time now is 09:31 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker