C8051F060?

tried to use c0851F060's UART0,but I found there is no output signal from tx0 and rx0(I using crossbar to mapping tx0 rx0 to P_0,P_1),I don't know why?,so can anyone remind me that any passable wrong I colud

make?

p.s my internal oscillator is 24.5Mhz,how can I create baud rate 9600? thanks for gave me advice friends,I still confuse,so I repost this problem.My program as below:

#include // SFR declarations

int i; char g=0x35;

void Oscillator_Init() { SFRPAGE = CONFIG_PAGE; OSCICN = 0x82;

}

void Timer_Init() { SFRPAGE = TMR2_PAGE; TMR2CN = 0x04; RCAP2L = 0xFD; RCAP2H = 0xFF;

}

void UART_Init() { SFRPAGE = UART0_PAGE; SCON0 = 0x50; SSTA0 = 0x05;

}

void Port_IO_Init() { // P0.0 - TX0 (UART0), Push-Pull, Digital // P0.1 - RX0 (UART0), Open-Drain, Digital // P0.2 - Unassigned, Open-Drain, Digital // P0.3 - Unassigned, Open-Drain, Digital // P0.4 - Unassigned, Push-Pull, Digital // P0.5 - Unassigned, Push-Pull, Digital // P0.6 - Unassigned, Push-Pull, Digital // P0.7 - Unassigned, Push-Pull, Digital

// P1.0 - Unassigned, Open-Drain, Digital // P1.1 - Unassigned, Open-Drain, Digital // P1.2 - Unassigned, Open-Drain, Digital // P1.3 - Unassigned, Open-Drain, Digital // P1.4 - Unassigned, Open-Drain, Digital // P1.5 - Unassigned, Open-Drain, Digital // P1.6 - Unassigned, Open-Drain, Digital // P1.7 - Unassigned, Open-Drain, Digital

// P2.0 - Unassigned, Open-Drain, Digital // P2.1 - Unassigned, Open-Drain, Digital // P2.2 - Unassigned, Open-Drain, Digital // P2.3 - Unassigned, Open-Drain, Digital // P2.4 - Unassigned, Open-Drain, Digital // P2.5 - Unassigned, Open-Drain, Digital // P2.6 - Unassigned, Open-Drain, Digital // P2.7 - Unassigned, Open-Drain, Digital

// P3.0 - Unassigned, Open-Drain, Digital // P3.1 - Unassigned, Open-Drain, Digital // P3.2 - Unassigned, Open-Drain, Digital // P3.3 - Unassigned, Open-Drain, Digital // P3.4 - Unassigned, Open-Drain, Digital // P3.5 - Unassigned, Open-Drain, Digital // P3.6 - Unassigned, Open-Drain, Digital // P3.7 - Unassigned, Open-Drain, Digital

SFRPAGE = CONFIG_PAGE; P0MDOUT = 0xF1; XBR0 = 0x04; XBR2 = 0x40;

}

// Initialization function for device, // Call Init_Device() from your main program void Init_Device(void) { Oscillator_Init(); Timer_Init(); UART_Init(); Port_IO_Init();

}

void delay(int x) { int i; for(i=0;i

Reply to
freekyidea
Loading thread data ...
  1. freekyidea Aug 20, 5:29 am show options Newsgroups: comp.arch.embedded From: "freekyidea" - Find messages by this author Date: 20 Aug 2005 05:29:17 -0700 Local: Sat, Aug 20 2005 5:29 am Subject: C8051F060?

p.s my internal oscillator is 24.5Mhz,how can I create baud rate 9600? thanks for gave me advice friends,I still confuse,so I repost this problem

RTFM - specifically Section 23 "Timers" and more specifically, Table

22.1 "Timer Settings for Standard Baud Rates Using The Internal Oscillator Frequency: 24.5 MHz"

Bob

Reply to
StephensDigital

Thank you Bob ! very appreciate you that answer my question,but I am sorry I didn't get the mail that you wrote to me,I don't know why...I am sure I am not delete that mail,so...can you send me again please? snipped-for-privacy@ccmail.ncku.edu.tw

//=================================================== RTFM - specifically Section 23 "Timers" and more specifically, Table

22.1 "Timer Settings for Standard Baud Rates Using The Internal Oscillator Frequency: 24.5 MHz //=================================================== I can't find this...which spec. above ?
Reply to
freekyidea

Thank you Bob ! very appreciate you that answer my question,but I am sorry I didn't get the mail that you wrote to me,I don't know why...I am sure

I am not delete that mail,so...can you send me again please? snipped-for-privacy@ccmail.ncku.edu.tw

Reply to
freekyidea

Thank you Bob ! very appreciate you that answer my question,but I am sorry I didn't get the mail that you wrote to me,I don't know why...I am sure

I am not delete that mail,so...can you send me again please? snipped-for-privacy@ccmail.ncku.edu.tw

Reply to
freekyidea

RTFM - specifically Section 23 "Timers" and more specifically, Table

22.1 "Timer Settings for Standard Baud Rates Using The Internal Oscillator Frequency: 24.5 MHz"

Bob

Reply

Reply to
StephensDigital

Dear Bob: I still not get any mail? Is this mean you want to send me a mail? or is my misunderstanding? ha ha~~^^

Tthanks for helping me configuration baud rate 9600,please tell me why my Tx won't output? I will very appreciate you ~

Reply to
freekyidea

Dear Bob~ Can you give me a sample cord for C8051F060 UART0? I tried several times...UART0 still can't word. please help me~

Reply to
freekyidea

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.