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
 
Thread Tools Display Modes
Old 27th June 2008, 11:54 AM   (permalink)
Default baud rate

hi
i am trying to write a program to send data to PC through air using LEDs and
photodiodes . i am using 4800 baud rate to comunicate .thus for approx 208microsec the led should toggle to send one bit. i have wriiten a program to toggle the led ,wait for 208 microsec and then toggle again.
BUT THATS NOT WORKING
data is displayed but not the one i try to send
Can anybody tell me how to calcute the delay time between two toggles for 4800 baud rate
aamirkhan is offline  
Reply With Quote
Old 27th June 2008, 12:19 PM   (permalink)
Default

If you connect the LED to the USART port of a PIC, and set-up the port correctly you should not have to worry about usec etc time. Don't know how well a photodiode will work at that speed though.
Boomslang is offline  
Reply With Quote
Old 27th June 2008, 12:50 PM   (permalink)
Default

i am not using UART its already occupied .I have to built another using program.
aamirkhan is offline  
Reply With Quote
Old 27th June 2008, 01:05 PM   (permalink)
Default

Quote:
Originally Posted by aamirkhan View Post
i am not using UART its already occupied .I have to built another using program.
Hi,
If I understand correctly, you want to write the program for a 'software' UART.

Look at Nigels tutorials link, bottom of this post.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now  
Reply With Quote
Old 27th June 2008, 01:10 PM   (permalink)
Default

Use a wire connection first to debug the 232, and once you have it working use the LED, so that you can address one problem at a time. Never tried 232 in software so can't help you on that.

edit to add: If you use the LED/photo setup on your existing uart connection, does it work?

Last edited by Boomslang; 27th June 2008 at 01:11 PM.
Boomslang is offline  
Reply With Quote
Old 27th June 2008, 01:10 PM   (permalink)
Default

Quote:
Originally Posted by ericgibbs View Post
Hi,
If I understand correctly, you want to write the program for a 'software' UART.

Look at Nigels tutorials link, bottom of this post.
but i am using AT89S52 not PIC
aamirkhan is offline  
Reply With Quote
Old 27th June 2008, 01:13 PM   (permalink)
Default

Quote:
Originally Posted by aamirkhan View Post
but i am using AT89S52 not PIC
The same principles apply - basically that you usually require some kind of coding for IR or radio use, neither of which output the same width pulses you supply them.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
FSK Baud rate khgsm2007 General Electronics Chat 7 10th May 2008 12:41 PM
PIC 18f1220 EUSART Baud Rate Cache Problem wklose99 Micro Controllers 7 16th April 2008 10:37 PM
Baud rate transmission problem Spectacular Butter General Electronics Chat 18 24th February 2005 09:30 AM
Baud rate and frequency Spectacular Butter General Electronics Chat 5 6th December 2004 07:25 PM
Setting Baud Rate for Modem connected to 89c52 ????? Yatin Electronic Projects Design/Ideas/Reviews 1 13th September 2004 10:11 AM



All times are GMT. The time now is 01:23 PM.


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