UART HATASI

Başlatan armsistem, 03 Haziran 2011, 14:03:06

armsistem

Arkadaşlar Selam ; Aşağıdaki kodu NXP sitesinden indirdim pdf 'te çalıştığını gösteriyor ama bende hata veriyor. Yardımlarınız için şimdiden teşekkür ederim.

Build target 'Target 1'
assembling LPC2300.s...
compiling uart.c...
uart.c(14): error:  #65: expected a ";"
uart.c(28): warning:  #12-D: parsing restarts here after previous syntax error
uart.c(10): warning:  #177-D: variable "i" was declared but never referenced
uart.c(11): warning:  #177-D: variable "c" was declared but never referenced
Target not created




#include"LPC23xx.h"
void Initialize(void);
/* Macro Definitions */
#define TEMT (1<<6)
#define LINE_FEED 0xA
#define CARRIAGE_RET 0xD
/************************* MAIN *************************/
int main()
{
int i;
char c[]="Philips LPC";
Initialize()
/* Print forever */
while(1)
{
i=0;
/* Keep Transmitting until Null character('\0') is reached */
while(c[i])
{
U0THR=c[i];
i++;
}
U0THR=LINE_FEED;
U0THR=CARRAIGE_RET;
/* Wait till U0THR and U0TSR are both empty */
while(!(U0LSR & TEMT)){}
}
}
/*************** System Initialization ***************/
void Initialize()
{
/* Initialize Pin Select Block for Tx and Rx */
PINSEL0=0x5;
/* Enable FIFO's and reset them */
U0FCR=0x7;
/* Set DLAB and word length set to 8bits */
U0LCR=0x83;
/* Baud rate set to 9600 */
U0DLL=0x10;
U0DLM=0x0;
/* Clear DLAB */
U0LCR=0x3;
}
/*********************************************************/

mufitsozen

Alıntı yapılan: armsistem - 03 Haziran 2011, 14:03:06
Arkadaşlar Selam ; Aşağıdaki kodu NXP sitesinden indirdim pdf 'te çalıştığını gösteriyor ama bende hata veriyor. Yardımlarınız için şimdiden teşekkür ederim.

Build target 'Target 1'
assembling LPC2300.s...
compiling uart.c...
uart.c(14): error:  #65: expected a ";"
uart.c(28): warning:  #12-D: parsing restarts here after previous syntax error
uart.c(10): warning:  #177-D: variable "i" was declared but never referenced
uart.c(11): warning:  #177-D: variable "c" was declared but never referenced
Target not created




#include"LPC23xx.h"
void Initialize(void);
/* Macro Definitions */
#define TEMT (1<<6)
#define LINE_FEED 0xA
#define CARRIAGE_RET 0xD
/************************* MAIN *************************/
int main()
{
int i;
char c[]="Philips LPC";
Initialize()
/* Print forever */
while(1)
{
i=0;
/* Keep Transmitting until Null character('\0') is reached */
while(c[i])
{
U0THR=c[i];
i++;
}
U0THR=LINE_FEED;
U0THR=CARRAIGE_RET;
/* Wait till U0THR and U0TSR are both empty */
while(!(U0LSR & TEMT)){}
}
}
/*************** System Initialization ***************/
void Initialize()
{
/* Initialize Pin Select Block for Tx and Rx */
PINSEL0=0x5;
/* Enable FIFO's and reset them */
U0FCR=0x7;
/* Set DLAB and word length set to 8bits */
U0LCR=0x83;
/* Baud rate set to 9600 */
U0DLL=0x10;
U0DLM=0x0;
/* Clear DLAB */
U0LCR=0x3;
}
/*********************************************************/


"Initialize()" dan sonra ';' gerekiyor ===> Initialize();
Aptalca bir soru yoktur ve hiç kimse soru sormayı bırakana kadar aptal olmaz.

armsistem

onu şimdi farkettim de şimdide şu hatayı alıyorum. Yardım için sağolasın


kkkkkk.c(24): error:  #20: identifier "CARRAIGE_RET" is undefined

CLR

Alıntı yapılan: armsistem - 03 Haziran 2011, 15:25:22
onu şimdi farkettim de şimdide şu hatayı alıyorum. Yardım için sağolasın


kkkkkk.c(24): error:  #20: identifier "CARRAIGE_RET" is undefined


CARRIAGE_RET yazman gereken yere CARRAIGE_RET yazmışsın. Yani A ile I ters.
Knowledge and Experience are Power

armsistem

Arkadaşlar selam , 16Mhz harici kristal kullanıyorum STARTUP.S ayarını ona göre yaptım ama UART bir türlü çıkış alamadım gözden kaçırdığım bir nokta varmı. UART 'tan çıkış almak bu kadar zor mu ?