Maker Pro
Maker Pro

hello world in 2051

L

LPC2106

http://www.dunfield.com/downloads.htm it does not look like there is a C
compiler found here at all



http://chaokhun.kmitl.ac.th/~kswichit/2051/basic/basic.htm

how to program that 2051 so that I have the same of result

http://arm.web7days.com/tn/serial.jpg.html
when I apply the realterm.

and suppose to store "hello world" in a register or P.X , I need help

1. idenify itself "I am here" like hello world in
http://arm.web7days.com/tn/serial.jpg.html

*
* helloworld.c
* First C program for 2051 experiment
* * Copyright (C) 2005
* compiled with Dunfield Micro-C for 8051 Release 3.2
*/

#include c:\mc\8051io.h /* include i/o header file */
#include c:\mc\8051reg.h

printf, sprintf, concat
int main()
{
unsigned char temp;
BAUD = 0x30; // 9600b
SCCR1 = 0x00; // 8-bit mode
SCCR2 = 0x0C; // enable Tx/Rx, no interrupts

printf("Hello, world!\n");

temp = 0;
while(1)
{
if(temp%2)
PORTA = PORTA | 0x10; // turn on Port A, pin 4
else
PORTA = PORTA & ~(0x10); // turn off Port A, pin 4
temp++;
}
return 0;
}


no sure if this will work since I have not compile micro-c compiler


TIA
 
Top