A Microcontroller Discussion Board
July 30, 2010, 12:03:58 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: If this is your first visit, be sure to check out the Help by clicking the link below.
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Serial I/O and Three Wheels Driver  (Read 3147 times)
0 Members and 1 Guest are viewing this topic.
weiqiang
Freshy
*
Posts: 10


View Profile Email
« Reply #15 on: November 19, 2007, 09:22:47 PM »

been busy for weeks...just gave it a try, it didn't seem to work...gonna look into it tomorrow...here is my code

#include <serial_IO.h>

int main()
{
   // inituart(250); // need a bit analysis
   // 256 - (22101500/384/9.6k) = value that needs to be passed up
   // since CPCON = 0x80, the PCON.7 is enabled, so the calculation should be
   // 256 - (22101500/192/9.6k) = 244, which 0xf4
   inituart(0xf4);
   
   while(1)
   {
   char c;
   c = getchar();
//   c = c + 1;
   putchar(c);
   }
}

Logged
A Microcontroller Discussion Board
« Reply #15 on: November 19, 2007, 09:22:47 PM »

 Logged
weiqiang
Freshy
*
Posts: 10


View Profile Email
« Reply #16 on: November 27, 2007, 11:08:12 PM »

okay, it works now with  inituart(0xe8), I think the reason is that PCON|= 0x80, 1000 0000, so SMOD.1 is set, SMOD.1 is not the doubler while the SMOD.0 is....so i am supposed to use the calculation that contains 384...
Logged
mviboolr
Newbie
*
Posts: 1


View Profile
« Reply #17 on: December 12, 2007, 06:42:43 PM »

Hi Doug
    Is "using 1" mean using register bank 1 ? Is it right ?
Logged
Doug
Administrator
Jr. Member
*****
Posts: 92



View Profile WWW
« Reply #18 on: December 13, 2007, 08:20:08 AM »

hi mviboolr

using 1, 1 = mode 1
Logged

Microcontroller Programming Blog
http://www.mcuprogramming.com/blog
jitheshmj
Freshy
*
Posts: 5


View Profile
« Reply #19 on: January 08, 2008, 02:26:36 AM »

Im new to 8051 programming....nice place to be in
Logged
A Microcontroller Discussion Board
   

 Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Help!!! C code for 14 segment display driver and.... PIC kottaho 0 720 Last post October 26, 2009, 12:45:29 PM
by kottaho
Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!