336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.



bing[avr can 통신 예제]





질문있으면 언제든 댓글달아주세요

http://nexp.tistory.com/category/?page=45

▲여러가지 카테고리들 중

http://nexp.tistory.com/1236

▲휴대폰을 이용한 램프제어

http://nexp.tistory.com/1234

▲MSP430 Soft_UART 쌍방향 테스트

=============================================================================http://myfreetimehobbies.blogspot.kr/2012_10_01_archive.html

▲Example program using two UART  (PIC16F877A기반)....(AVR에 맞춰서 코드를 수정했다.)


/*This program inputs from on chip UART and output to Soft UART*/

char i, error, byte_read='1',uart_rd='1';    //Auxiliary variables

void main()

{

      DDRB=0xFF;    //원래코드:::TRISB = 0x00;.......Set PortB as Output (error signalization)

      PORTB = 0;    //Default Value

      UART1_Init(9600);    //통신속도


      error = Soft_UART_Init(&PORTC,1,0,9600,0);  //Initialize Soft_UART at 9600 bps

      if(error > 0)          //when erro=1, successful initialization

      {

         PORTB = error;      //put the error result in PORTB variable

         while(1);

      }

      Delay_ms(100);

      UART1_Write_Text("Enter Text Here(0 to exit)");

      do

      {

        if(UART1_Data_Ready())

        {

           UART1_Write(10);

           UART1_Write(13);

           uart_rd = UART1_Read();

           Soft_UART_Write(uart_rd);

           Delay_ms(100);

        }

      }

      while(uart_rd!='0');

}

==================================================================

http://myfreetimehobbies.blogspot.kr/2012_10_01_archive.html

▲인터럽트 (PIC16F877A 기반)




Code

  void interrupt(void)    //인터럽트 메소드
{
  PORTD++;          //Increment PORTD value by one
  //delay_ms(500);
  INTCON.INTF = 0;          // clear the interrupt flag
  //INTCON::GIE PEIE T0IE INTE RBIE T0IF INTF RBIF
}
void main(void)
{
  TRISB = 0x01;
  TRISD = 0x00;
  INTCON.GIE = 1;                  //Enable Global Interrupt
  INTCON.INTE = 1;                //Enable RB0/INT external Interrupt
  INTCON.PEIE = 0;                //Disable all unmasked peripheral interrupt
  OPTION_REG.INTEDG = 1;    //Interrupt on rising edge
  PORTD=0;
do
  {
   } while(1);
}
▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲

Posted by ElectricShock
:
BLOG main image
잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

공지사항

카테고리

분류 전체보기 (782)
Programming(=프로그래밍) (3)
MiDi (2)
Animation (4)
Blender (3D Graphic Program.. (10)
Blendtuts.com (Series) (1)
Blender 기초 팁들 (2)
Processing (디지털미디어과) (2)
Music (1)
Books in the world (0)
Communication(CAN, UART, et.. (12)
MCU Examples (PIC 기반) (7)
Transistor (1)
Mikro C Pro (11)
Mikro Pascal (1)
Proton IDE (0)
Robot (0)
Swift 3D (1)
Dummies Series (1)
All about Hacking (0)
제2 외국어 (1)
PIC 해외서적들 (3)
AVR (25)
PIC (MikroC) (MPLAB) (4)
Assembly (2)
ARM (3)
Arduino (26)
PSpice (1)
Proteus ISIS (14)
CodeVision (2)
FPGA (15)
MPLAB (24)
PCB (the Procedure) (15)
3D Printer (5)
PICKIT3 (6)
Matlab (11)
RaspBerry PI (15)
BeagleBone (1)
Android Studio (17)
졸업작품 (172)
Korea History (0)
Issue(사회) (73)
Multimeter 리뷰 (1)
Oscilloscope (1)
A (34)
B (19)
J (6)
C (32)
P (12)
T (37)
H (12)
I (12)
M (44)
R (5)
E (5)
F (2)
D (9)
O (2)
L (7)
S (9)
W (2)
V (6)
G (14)
Visual C++ or Visual Studio (2)
Android App Development (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백