
Komunikasi Serial Mikrokontroler At89c51 Projects
Serial communication using UART or USART of a microcontroller 8051 AVR PIC, software implementation of half-duplex UART and MAX232 interfacing with microcontrollers 8051 AVR PIC. Komunikasi Serial Mikrokontroler Software Engineer. Mikrokontroler Adalah. Automatically detect COM. New design by Ajay Bhargav, best for student projects. The simple programmer for 40-pin AT89C51/52/55.
Kalau komunikasi uC (mikrokontroler) dengan Kompi. banyak ditemukan di berbagai artikel. Namun disini penulis mencoba berkomunikasi antar 2 uC. Satu uC sebagai pengirim data dan uC satunya lagi berfungsi sebagai penerima data. Biasanya digunakan untuk komunikasi antar 2 Robot. Berfungsi sebagai tuka-menukar data antara robot yang satu dengan robot yang lain untuk mengerjakan suatu misi. Kalau kata sederhanannya Robot yang saling gotong-royong untuk mengerjakan suatu misi. 😀 😀 😀
“Hubungkan PORTD.1 (uC1) ke PIND.0 (uC2) , Vcc +5 dan Gnd ke (uC2). Jadi supply tegangan +9 Volt terhubung ke uC1.”
– Modul AVR (Transmitter uC1)
Download Program ke uC. Berikut programnya
Camray 2 Oil Boiler Manual Greenstar camray kitchen floor standing oil fired condensing boiler Check and clean filters & valves from oil To reset, wait 2 minutes then press the lockout. Installation & Maintenance Manual For Camray 5 and Camray. Buy Boulter Camray Oil Boilers at MyTub the online trade counter. BOULTER BUDERUS CAMRAY 5 PAGE 2 If any part of the Boiler or its flue is modified, then the guarantee/warranty will be invalidated. 1:3 INSTALLATION & COMMISSIONING After your Camray Boiler has been installed it MUST be commissioned by a competent engineer preferably an O.F.T.E.C. Registered engineer, or by one of our registered service engineers. Boulter Camray 5 Boiler Manual New listing Boulter Camray 5 Oil Boiler in good working order. Read information on boilers, including the prices and advice from an. Boiler Parts No.1 supplier of Worcester Camray Compact 50/70 Boiler Parts, order your Worcester Camray Compact 50/70 Boiler Spare Parts on a next day delivery at very competitive.
/*****************************************************
This program was produced by the
CodeWizardAVR V1.25.3 Standard
Automatic Program Generator
© Copyright 1998-2007 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com
Project :
Version :
Date   : 1/4/2010
Author : F4CG
Company : F4CG
Comments:
Chip type          : ATmega8535
Program type       : Application
Clock frequency    : 4.000000 MHz
Memory model       : Small
External SRAM size : 0
Data Stack size    : 128
*****************************************************/
#include <mega8535.h>
#include <delay.h>
#define RXB8 1
#define TXB8 0
#define UPE 2
#define OVR 3
#define FE 4
#define UDRE 5
#define RXC 7
#define FRAMING_ERROR (1<<FE)
#define PARITY_ERROR (1<<UPE)
#define DATA_OVERRUN (1<<OVR)
#define DATA_REGISTER_EMPTY (1<<UDRE)
#define RX_COMPLETE (1<<RXC)
// USART Transmitter buffer
#define TX_BUFFER_SIZE 8
unsigned char tx_buffer[TX_BUFFER_SIZE];
#if TX_BUFFER_SIZE<256
unsigned char tx_wr_index,tx_rd_index,tx_counter;
#else
unsigned int tx_wr_index,tx_rd_index,tx_counter;
#endif
// USART Transmitter interrupt service routine
interrupt [USART_TXC] void usart_tx_isr(void)
{
if (tx_counter)
{
–tx_counter;
UDR=tx_buffer[tx_rd_index];
if (++tx_rd_index TX_BUFFER_SIZE) tx_rd_index=0;
};
}
#ifndef _DEBUG_TERMINAL_IO_
// Write a character to the USART Transmitter buffer
#define _ALTERNATE_PUTCHAR_
#pragma used+
void putchar(unsigned char c)
{
while (tx_counter TX_BUFFER_SIZE);
#asm(“cli”)
if (tx_counter ((UCSRA & DATA_REGISTER_EMPTY)0))
{
tx_buffer[tx_wr_index]=c;
if (++tx_wr_index TX_BUFFER_SIZE) tx_wr_index=0;
++tx_counter;
}
else
UDR=c;
#asm(“sei”)
}
#pragma used-
#endif
// Standard Input/Output functions
#include <stdio.h>
// Declare your global variables here
void main(void)
{
// Declare your local variables here
// Input/Output Ports initialization
// Port A initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTA=0x00;
DDRA=0x00;
// Port B initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTB=0x00;
DDRB=0x00;
// Port C initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTC=0x00;
DDRC=0x00;
// Port D initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTD=0x00;
DDRD=0x00;
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;
// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer 1 Stopped
// Mode: Normal top=FFFFh
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer 1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;
// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer 2 Stopped
// Mode: Normal top=FFh
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;
// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off
MCUCR=0x00;
MCUCSR=0x00;
// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;
// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: Off
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud rate: 9600
UCSRA=0x00;
UCSRB=0x48;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x19;
Cartilha caminho suave antigua pdf compressor. // Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;
// Global enable interrupts
#asm(“sei”)
while (1)
{
// Place your code here
putchar(255);
//printf(“tes”);
//putchar(‘ ‘);
delay_ms(1000);
putchar(253);
delay_ms(1000);
putchar(200);
delay_ms(1000);
};
}
– Modul AVR dan LCD 2×16 (Receiver uC2)
Download Program ke uC. Berikut programnya
#include <mega8535.h>
// Alphanumeric LCD Module functions
#asm
.equ __lcd_port=0x15 ;PORTC
#endasm
#include <lcd.h>
#define RXB8 1
#define TXB8 0
#define UPE 2
#define OVR 3
#define FE 4
#define UDRE 5
#define RXC 7
#define FRAMING_ERROR (1<<FE)
#define PARITY_ERROR (1<<UPE)
#define DATA_OVERRUN (1<<OVR)
#define DATA_REGISTER_EMPTY (1<<UDRE)
#define RX_COMPLETE (1<<RXC)
// USART Receiver buffer
#define RX_BUFFER_SIZE 8
unsigned char rx_buffer[RX_BUFFER_SIZE];
#if RX_BUFFER_SIZE<256
unsigned char rx_wr_index,rx_rd_index,rx_counter;
#else
unsigned int rx_wr_index,rx_rd_index,rx_counter;
#endif
// This flag is set on USART Receiver buffer overflow
bit rx_buffer_overflow;
// USART Receiver interrupt service routine
interrupt [USART_RXC] void usart_rx_isr(void)
{
unsigned char status,data;
status=UCSRA;
data=UDR;
if ((status & (FRAMING_ERROR PARITY_ERROR DATA_OVERRUN))0)
{
rx_buffer[rx_wr_index]=data;
if (++rx_wr_index RX_BUFFER_SIZE) rx_wr_index=0;
if (++rx_counter RX_BUFFER_SIZE)
{
rx_counter=0;
rx_buffer_overflow=1;
};
};
}
#ifndef _DEBUG_TERMINAL_IO_
// Get a character from the USART Receiver buffer
#define _ALTERNATE_GETCHAR_
#pragma used+
unsigned char getchar(void)
{
unsigned char data;
while (rx_counter0);
data=rx_buffer[rx_rd_index];
if (++rx_rd_index RX_BUFFER_SIZE) rx_rd_index=0;
#asm(“cli”)
–rx_counter;
#asm(“sei”)
return data;
}
#pragma used-
#endif
// Standard Input/Output functions
#include <stdio.h>
// Declare your global variables here
unsigned char a;
char lcd_buffer[33];
void main(void)
{
// Declare your local variables here
// Input/Output Ports initialization
// Port A initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTA=0x00;
DDRA=0x00;
// Port B initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTB=0x00;
DDRB=0x00;
// Port C initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTC=0x00;
DDRC=0x00;
// Port D initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTD=0x00;
DDRD=0x00;
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;
// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer 1 Stopped
// Mode: Normal top=FFFFh
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer 1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;
// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer 2 Stopped
// Mode: Normal top=FFh
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;
// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off
MCUCR=0x00;
MCUCSR=0x00;
// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;
// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: Off
// USART Mode: Asynchronous
// USART Baud rate: 9600
UCSRA=0x00;
UCSRB=0x90;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x19;
// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;
// LCD module initialization
lcd_init(16);
// Global enable interrupts
#asm(“sei”)
while (1)
{
// Place your code here
a=getchar();
sprintf(lcd_buffer,”%d”,a);
lcd_puts(lcd_buffer);
};
}
Selamat Mencoba….!!!!
Our AT89C2051 and AT89C51 programmers are now only available to special order - the new P89C51RD+ and T89C51RD2 represent far better value for money - and they can be programmed via a serial port, so you don't need to buy a programmer from us! If you still want our programmer - after all it is one of the only AT89C2051 programmers that works under any operating system, and programs in 6 seconds - Please contact us and we'll place a backorder for you |
Erase, Program and verify an AT89C2051 in one easy operation!
Programs in just 6 seconds!PG2051 - A Programmer for the Atmel AT89C2051, from AirBorn Electronics
The AT89C2051 is a 20 pin 8051 compatible microprocessor (including serial port) with 2k of FLASH memory, available from Atmel (see http://www.atmel.com/atmel/products/). The PG2051 erases, programs, and verifies AT89C2051 chips in 6 seconds. As the AT89C2051 devices are FLASH, they can be reprogrammed as often as needed.
The PG2051 may be connected to a PC or other host by a serial cable. The programmer interface is PC serial compatible, operates at 9600 Baud, and accepts standard Intel Hex files.
The programmer features a test switch which allows the owner to check if an AT89C2051 is blank, working, programmed or failed in just one second - without needing the PC connected.
- Programs the 2k FLASH memory in 89C2051's
- Can be reprogrammed 1000 times per chip
- Fast - programs a chip in 6 seconds (typ.)
- 89C2051 is 8051 Instruction and Reg compatible
- Programmer interface is PC serial compatible
- 9600 Baud, 8 data, 2 stop bits, no parity
- Accepts standard Intel Hex files
- Programs Security bits, if required
- Dipswitch selectable
- One Step program operation
- Download starts Test/Erase/Program/Verify
- Stand-alone test switch
- Allows 89C2051 test without PC download
- Tests for blank chip without PC download
- Programmer also handles AT89C1051's
- Powered by DC plug pack (supplied)
- Evaluation Kit includes two sample 89C2051 devices
FEATURES:
AUD$188 (+gst)
for Programmer, plugpack
& Data sheet
OPERATION:
The PG2051 is a development programmer for the ATMEL AT89C2051. The AT89C2051 programmer is fast, small and simple to use.The programmer may be connected to a PC or other host by a serial cable. The data to be downloaded to the programmer is transmitted in Intel Hex format. The programmer will erase & program, verify, write protect and security protect as it receives the file, according to the settings on its Dip switches.
Insert an 89C2051 | - (Manual Test if desired) | Mode COM1:9600,N,8,2 |
Download intel hex file | - (Causes programming) | Copy Myfile.hex COM1 |
Watch LEDs | - (Indicates success) |
The PG2051 can be used stand-alone by inserting an 89C2051 and operating the Manual test switch, in this mode it indicates Tested, Blank and Verified checksum conditions.
EVALUATION KIT:
The PG2051 evaluation kit, with prototype board [Click here for schematic]
- The PG2051 programmer
- Power supply plugpack
- PG2051 data sheet and reference card
- Two AT89C2051 FLASH memory CPU devices
- A small prototype board with LEDs, to test with
- A well documented sample .ASM program
- A shareware assembler & dis-assembler
- $233 (plus GST [tax] in Australia)
AUD$233 (+gst) for Evaluation kit &
Programmer. Order by Fax, Phone
or Mail - see ORDER FORM.
The AT89C2051 Microprocessor
- Just Page One of the AT89C2051 data sheet ..the pinout and features, quicker download
- For more information on these microprocessors, visit Atmel's site.
The AirBorn Electronics programmer described here connects to a Serial port, works under any operating system, and programs in 6 seconds by just copying the hex file to the COM port. There is also a programmer design available from Atmel that you can build yourself - although it does not share these features. Download the free programmer here, - but remember to get the software from Atmel, also. |
Fax: (61)(2) 9922 4483
Tel: (61)(2) 9925 0325
Mail: AirBorn Electronics
P O Box 1491
North Sydney 2059
Australia