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

부트로딩 요청 댓글 남겨주세요 (이메일,연락처 남겨주시면 편합니다.)


Naver

[atmega328 부트로더]




http://arduino-er.blogspot.kr/2015/01/use-arduino-uno-as-isp-to-burn.html

▲아두이노 부트로더(=Arduino BootLoader) 출처

 

부트로더란 컴퓨터 OS에 해당한다.

아두이노 칩이 AVR 계열인데 그냥쓰면 AVR코드를 써야한다.

아두이노용으로 쓰려면 ATmega328칩에 Bootloader를 얹어서 Arduino코드를 사용할 수 있게끔 해줘야 한다.

This post show how to use Arduino Uno as "Arduino as ISP", to burn bootloader on a empty ATmega328, marked ATMEGA328P-PU.

비어있는 ATMega328P-PU칩에 BootLoader를 얹어서 Arduino용 칩으로 만드는 방법을 설명하려한다.


여기서 잠깐 BoootLoader가 무엇인지 쉽게 설명하려한다.

일종의 컴퓨터 OS라고 이해하시면 된다.

컴퓨터에 Windows가 없이는 안되듯이 ATmega328P-PU칩에도 BootLoader없이는 Arduino가 될 수없다.


우선 시작전에 Arduino Uno와 ATmega328P-PU칩의 연결을 정리하고 넘어가자

Arduino 13번핀 <===> PB5(SCK)

Arduino 12번핀 <===> PB4(MISO)

Arduino 11번핀 <===> PB3(MOSI)

Arduino 10번핀 <===> PC6(RESET)

Arduino VCC  <===> AVcc (pin20)

Arduino GND <===> GND

Xtal 16MHz연결하고 Capacitor 약22p을 연결하고 GND로 연결한다.

회로는 맨위의 출처 사이트를 참고하면 된다.



▼AVCC & AREF에 대한 정의들(출처)

AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. 

It should be externally connected to VCC, even if the ADC is not used. 

If the ADC is used, it should be connected to VCC through a low-pass filter. 

Note that PC6..4 use digital supply voltage, VCC.

AREF is the analog reference pin for the A/D Converter.

If you're not using the A/D, you don't need to connect AREF.

http://www.avrfreaks.net/sites/default/files/avrfreaks-vcc-avcc-aref.gif

▲위 그림을 통해서 알 수있듯이 Vcc와 AVcc는 상호간에 연결되있있다.

다만 차이가 있다면 LowPass Filter가 적용되서 Noise가 줄어들었다는 점이다.



이제 Arduino IDE로 와서 순서를 정리해보자.

아두이노를 ISP로 사용하여 BreadBoard에 있는 비어있는 ATmega328P-PU에 BootLoader를 얹을 예정이다.

이 상태에서

파일>> 예제 >>ArduinoISP를 선택하고


이제 부트로더 굽기를 누르면 BootLoader 얹기가 마무리된다.


▼영문으로 요약된 Bootload 순서

Program your Arduino Uno to be "Arduino as ISP":
- Connect Arduino Uno to PC with USB cable.
- Select Tools -> Port and your current connected Board (Arduino Uno).
- Select File -> Examples of ArduinoISP.
- Compile and upload to your Arduino Uno board.
- Once finished, your Arduino Uno is a "Arduino as ISP" now.

Burn bootloader to Atmega328, using your "Arduino as ISP":
- Select Tools -> Board, it is the board on which you want to burn the bootloader, not your current connect board. I will use Arduino Uno as target to verify my steps and setup later, so I keep using Arduino Uno.
- Select Tools -> Programmer of "Arduino as ISP".
- Select Tools -> Burn Bootloader
- Done.



http://arduino-er.blogspot.kr/2015/01/use-arduino-uno-as-isp-to-burn.html

▲9,10번핀에 16MHz Crystal발진기 연결

양쪽끝 핀을 각각 22pF에 연결후 GND로 접지시켜준다. (LOW-Pass Filter를 통해서 미세한 Noise를 잡아주는 역할을 한다.)

그리고 잊지말고 10K pull-up저항을 Reset(1번 핀)에 연결.

AVcc(20번 핀)를 Arduino Uno의 5V에,

GND는 GND끼리.


연결이 끝았다면

파일>>예제>ArduinoISP로 들어가고 코드를 업로드한다.

(COM포트 맞춰주고, 보드는 UNO, 프로그래머는 AVRISP mkII (☜Default 이다.))

우선 업로드한 상태에서

툴>>프로그래머>>Arduino as ISP

이제 ArduinoISP코드가 들어간 Arduino가 다운로더 역할을 하고, ATmega328p-pu가 Target이 된다.

이제 툴>>부트로더 굽기를 눌러준다.




위 방법이 번거롭다 싶은 분은 아래 YouTube를 참고해주세요

11 to 11

12 to 12

13 to 13

10 to Reset(=Target Board)

Vcc to Vcc

GND to GND

Arduino끼리 연결하는 방법을 쓸때는 

한쪽은 DIP타입의 MCU가 부착된 칩을 쓰고,

반대쪽은 SMD타입의 MCU가 부착된 칩을 쓰면된다.

DIP타입의 칩이 Target보드가 된다.

YouTube에서 처럼 Jumper를 연결해도 되고, ICSP를 연결하는 곳에 IDE케이블을 통해 Bootloading 하면 좀더 편하다.



▼위 방법도 귀찮다 싶은 분은 아래 Shield를 사용하는걸 권한다.

(문의 댓글 주셔도 됩니다.)


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

http://extremeelectronics.co.in/microchip-pic-tutorials/introduction-to-pic-interrupts-and-their-handling-in-c/


인터럽트의 종류를 크게 나누자면 크게 4종류로 나뉜다.

External Interrupts

TIMER Interrupts

Analog to Digital Converter Interrupts

Data Interrupts



상세히 정리하면 아래와 같다.

External Interrupts

they are namemd INTx (Like INT0, INT1 etc),

they provide a means for External Hardware

to generate Interrupts.

Like if you connect a touchscreen controller

to your PIC MCU.

Then the touchscreens PENINT (pen interrupt = 팬으로 터치하면 인터럽트)

can be connected to INT0.

Then whenever the pen (or stylus) touches the screen

it will interrupt the CPU.

This interrupt will be explained in details in its own tutorial.


TIMER interrupts

They are also very common in MCUs.

Today’s MCUs comes with very sophisticated timers that can do lots of magic for you.

They have they related interrupts.

In most simple situation

they can act like alarm clocks that can interrupt the CPU at predefined intervals.

If you toggle a i/o pin in response to these alarms (interrupts),

what you have is a frequency generator!

(in response to : ~에 대한 응답으로)

For more info on timers on PIC18, read this article.

Analog to Digital Converter Interrupts

A/D Converter takes some time to complete its operation.

So the CPU can either wait for it to complete 

or 

set up an AD conversion complete interrupt.


In the latter case CPU can do other tasks while A/D converter converts the input.

(the latter case : 후자의 경우)

As soon as A/D converter completes its job it will inform CPU to read the value from its buffer. For more info on A/D Converter of PIC18, read this article.


Data Interrupts

MCUs have many different types of data i/o engines, 

like USARTSPII2CParallel etc.

They can also interrupt the CPU 

when data transmission is complete or data arrives from external source.

Like an RFID reader send a packet 

because a user just brought his or her card near the reader. 

Or the GSM module detected an incoming call.


How interrupts are managed?

어떻게 인터럽트들이 다뤄지는가?

In general each interrupt source have following related bits.

Enable Bit

The are suffixed with IE (Interrupt Enable) example 

TMR0IE stands for TIMER0 Interrupt Enable. 

It can be used to enable/disable the related interrupt. 

When set to ’1′ it enables the interrupt.

Flag Bit 

It is set automatically by the related hardware 

when the interrupt condition occurs. 

It is generally suffixed with IF (Interrupt Fag).

When it is set to ’1′ we know that interrupt has occurred.

For example when TMR0IF is set by TIMER0, 

it indicates that TIMER0 has overflowed.

Priority Bit - 

We can leave this for now to keep things simple. 

We won’t be using interrupt priority feature of PIC18.

 

Code.txt



Arduino Interrupt

▼Original Code

Test_program.txt


▼아직은 Error 있음

버튼A(수동모드) 버튼B(자동모드).txt


▼HEX코드

sketch_apr30a.ino.standard.hex




▲위 그림에서 O표시한 "Connect it to Arduino Input" 그림을 주의깊게 봐야한다.

"To verify the Output"라고 표시된 LEDVCC,GND 만 연결해놓은 상태에서 PhotoInterrupt의 중간을 차단하면 눈으로 확인하기 위해서 탈부착으로 연결했다.

이때의 출력용 LED를 제거하면, 그 전류가 "Connect it to Arduino Input"핀으로 흘러간다.

(C:Collector, E:Emitor -- Emitor의 전류가 출력용 LED에 흘러간다.)

그리고 여기 O표시한 핀과 아래그림의 O표시한 핀을 Jumper로 연결하면 된다.


위에 표시된 글을 좀더 크게 적었다.

아까 PhotoInterrupter의 출력을 여기 OO로 표한 핀에 연결하면 된다.

OO사이는 Open되있으므로 따로따로 입력이 들어간다.

두개의 PhotoInterrupt를 사용해서 출입문을 만들면 된다.


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

신비한 TV 서프라이즈 (2016/06/12) (링크)


Questions, questions, questions...

  • What do the inscriptions on the Chinese pavilion at Stow Lake say?
  • What do the symbols around the dress margin mean?
  • Why is she pointing to those specific places on the sleeves?
  • Why are there 11 moons?
  • What is the significance of the blue shape above the rose?

●뭘 하는가 the inscription(=비문) on the 중국 pavilion(=누각,정자,별관) at the Stow Lake...말하는게?

Stow Lake 지도 확인하기 링크▶LINK

●뭘 하는가 the symbols들이 around the dress margin이 의미하는게?

(여기서 margin은 테두리,가장자리,변두리 라는 뜻이다.)

●왜 그녀인가  가리키며 to those 특정 위치들을 on the 소매에서

●왜 있을까 11개의 달이 ? (크고작은 11개의 달이 산 너머에 있다.)

●뭘까? 의미하는게 of the 파란모양의 above the 장미너머에 ?

Posted by ElectricShock
:

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

공지사항

카테고리

분류 전체보기 (782)
MiDi (2)
Programming(=프로그래밍) (3)
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)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백