embeded/arduino(genuino)2016. 4. 7. 10:25

기본값으로 설치되었다는 전제하에

아래 경로에 플래시 구울때 사용하는 설정들이 존재한다.


아두이노는 기본적으로 USB 파워나 외부 전원을 통해(7805) 5V를 공급하도록 되어있는데

7805를 들어내거나 결선을 바꾸거나 외부 Vcc에다가 3.3V를 넣어 주고

클럭을 다운시켜 작동하면 좀 간편할지도?


아니면 프로미니 3.3V 이런거라던가?


ATmega328 running at 8MHz with external resonator (0.5% tolerance)

Low-voltage board needs no interfacing circuitry to popular 3.3V devices and modules (GPS, accelerometers, sensors, etc)

[링크 : https://www.sparkfun.com/products/11114]


C:\Program Files (x86)\Arduino\hardware\arduino\avr\boards.txt

##############################################################


nano.name=Arduino Nano


nano.upload.tool=avrdude

nano.upload.protocol=arduino


nano.bootloader.tool=avrdude

nano.bootloader.unlock_bits=0x3F

nano.bootloader.lock_bits=0x0F


nano.build.f_cpu=16000000L

nano.build.board=AVR_NANO

nano.build.core=arduino

nano.build.variant=eightanaloginputs


## Arduino Nano w/ ATmega328

## -------------------------

nano.menu.cpu.atmega328=ATmega328


nano.menu.cpu.atmega328.upload.maximum_size=30720

nano.menu.cpu.atmega328.upload.maximum_data_size=2048

nano.menu.cpu.atmega328.upload.speed=57600


nano.menu.cpu.atmega328.bootloader.low_fuses=0xFF

nano.menu.cpu.atmega328.bootloader.high_fuses=0xDA

nano.menu.cpu.atmega328.bootloader.extended_fuses=0x05

nano.menu.cpu.atmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328.hex


nano.menu.cpu.atmega328.build.mcu=atmega328p


## Arduino Nano w/ ATmega168

## -------------------------

nano.menu.cpu.atmega168=ATmega168


nano.menu.cpu.atmega168.upload.maximum_size=14336

nano.menu.cpu.atmega168.upload.maximum_data_size=1024

nano.menu.cpu.atmega168.upload.speed=19200


nano.menu.cpu.atmega168.bootloader.low_fuses=0xff

nano.menu.cpu.atmega168.bootloader.high_fuses=0xdd

nano.menu.cpu.atmega168.bootloader.extended_fuses=0x00

nano.menu.cpu.atmega168.bootloader.file=atmega/ATmegaBOOT_168_diecimila.hex


nano.menu.cpu.atmega168.build.mcu=atmega168 


[링크 : https://forum.arduino.cc/index.php?topic=236128.0]



Arduino Duemilanove or Nano w/ ATmega328


Low Fuse 0xFF

High Fuse 0xDA

Extended Fuse 0x05 


[링크 : http://www.codingwithcody.com/2011/04/arduino-default-fuse-settings/]

[링크 : http://www.engbedded.com/fusecalc/] 퓨즈비트 계산기



+

어제 퇴근길에 본거 겨우 링크 찾았네..

[링크 : http://www.ba0sh1.com/tutorial-3-3v-hacking-for-arduino-nano/]

Posted by 구차니
embeded/arduino(genuino)2016. 4. 7. 09:58

툴에서 설정을 해놨다면 그걸 이용해서

스케치 - 프로그래머를 이용해 업로드

를 함으로서 stk500 호환 usbisp 등을 이용해 업로드가 가능해진다.





[링크 : https://www.arduino.cc/en/Hacking/Bootloader?from=Tutorial.Bootloader]


Tools->Boards->Your Board

Tools->Programmer->Your Programmer

Sketch->Upload Using a Programmer

[링크 : https://www.arduino.cc/en/Hacking/Programmer]

Posted by 구차니
embeded/arduino(genuino)2016. 4. 6. 23:41



 

예전에 가지고 있던 녀석으로 구워볼려고 했더니..

프로그래머 이녀석은... 굽는 용도가 아닌가? 안되지 왜?

(어쩌면 보드를 정해줘서 그런걸지도..)


아무튼 STK500 개발보드로 하니 USBISP로 구워진다

[링크 : http://www.us-technology.co.kr/product/product_main.asp?mode=5&smode=5]



근데.. 메시지가 머이리 길어?

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500 -PCOM6 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m


avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58

         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         Copyright (c) 2007-2009 Joerg Wunsch


         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"


         Using Port                    : COM6

         Using Programmer              : stk500

         AVR Part                      : ATmega328P

         Chip Erase delay              : 9000 us

         PAGEL                         : PD7

         BS2                           : PC2

         RESET disposition             : dedicated

         RETRY pulse                   : SCK

         serial program mode           : yes

         parallel program mode         : yes

         Timeout                       : 200

         StabDelay                     : 100

         CmdexeDelay                   : 25

         SyncLoops                     : 32

         ByteDelay                     : 0

         PollIndex                     : 3

         PollValue                     : 0x53

         Memory Detail                 :


                                  Block Poll               Page                       Polled

           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------

           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff

           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff

           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00


         Programmer Type : STK500V2

         Description     : Atmel STK500

         Programmer Model: AVRISP

         Hardware Version: 2

         Firmware Version Master : 2.10

         Vtarget         : 5.0 V

         SCK period      : 43.5 us


avrdude: AVR device initialized and ready to accept instructions


Reading | ################################################## | 100% 0.09s


avrdude: Device signature = 0x1e950f

avrdude: erasing chip

avrdude: reading input file "0x3F"

avrdude: writing lock (1 bytes):


Writing | ################################################## | 100% 0.04s


avrdude: 1 bytes of lock written

avrdude: verifying lock memory against 0x3F:

avrdude: load data lock data from input file 0x3F:

avrdude: input file 0x3F contains 1 bytes

avrdude: reading on-chip lock data:


Reading | ################################################## | 100% 0.03s


avrdude: verifying ...

avrdude: 1 bytes of lock verified

avrdude: reading input file "0x05"

avrdude: writing efuse (1 bytes):


Writing | ################################################## | 100% 0.03s


avrdude: 1 bytes of efuse written

avrdude: verifying efuse memory against 0x05:

avrdude: load data efuse data from input file 0x05:

avrdude: input file 0x05 contains 1 bytes

avrdude: reading on-chip efuse data:


Reading | ################################################## | 100% 0.03s


avrdude: verifying ...

avrdude: 1 bytes of efuse verified

avrdude: reading input file "0xDA"

avrdude: writing hfuse (1 bytes):


Writing | ################################################## | 100% 0.03s


avrdude: 1 bytes of hfuse written

avrdude: verifying hfuse memory against 0xDA:

avrdude: load data hfuse data from input file 0xDA:

avrdude: input file 0xDA contains 1 bytes

avrdude: reading on-chip hfuse data:


Reading | ################################################## | 100% 0.03s


avrdude: verifying ...

avrdude: 1 bytes of hfuse verified

avrdude: reading input file "0xFF"

avrdude: writing lfuse (1 bytes):


Writing | ################################################## | 100% 0.03s


avrdude: 1 bytes of lfuse written

avrdude: verifying lfuse memory against 0xFF:

avrdude: load data lfuse data from input file 0xFF:

avrdude: input file 0xFF contains 1 bytes

avrdude: reading on-chip lfuse data:


Reading | ################################################## | 100% 0.02s


avrdude: verifying ...

avrdude: 1 bytes of lfuse verified


avrdude done.  Thank you.


C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500 -PCOM6 -Uflash:w:C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:i -Ulock:w:0x0F:m 


avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58

         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         Copyright (c) 2007-2009 Joerg Wunsch


         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"


         Using Port                    : COM6

         Using Programmer              : stk500

         AVR Part                      : ATmega328P

         Chip Erase delay              : 9000 us

         PAGEL                         : PD7

         BS2                           : PC2

         RESET disposition             : dedicated

         RETRY pulse                   : SCK

         serial program mode           : yes

         parallel program mode         : yes

         Timeout                       : 200

         StabDelay                     : 100

         CmdexeDelay                   : 25

         SyncLoops                     : 32

         ByteDelay                     : 0

         PollIndex                     : 3

         PollValue                     : 0x53

         Memory Detail                 :


                                  Block Poll               Page                       Polled

           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------

           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff

           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff

           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00


         Programmer Type : STK500V2

         Description     : Atmel STK500

         Programmer Model: AVRISP

         Hardware Version: 2

         Firmware Version Master : 2.10

         Vtarget         : 5.0 V

         SCK period      : 43.5 us


avrdude: AVR device initialized and ready to accept instructions


Reading | ################################################## | 100% 0.09s


avrdude: Device signature = 0x1e950f

avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed

         To disable this feature, specify the -D option.

avrdude: erasing chip

avrdude: reading input file "C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex"

avrdude: writing flash (32670 bytes):


Writing | ################################################## | 100% 0.00s


avrdude: 32670 bytes of flash written

avrdude: verifying flash memory against C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:

avrdude: load data flash data from input file C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:

avrdude: input file C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex contains 32670 bytes

avrdude: reading on-chip flash data:


Reading | ################################################## | 100% 0.00s


avrdude: verifying ...

avrdude: 32670 bytes of flash verified

avrdude: reading input file "0x0F"

avrdude: writing lock (1 bytes):


Writing | ################################################## | 100% 0.09s


avrdude: 1 bytes of lock written

avrdude: verifying lock memory against 0x0F:

avrdude: load data lock data from input file 0x0F:

avrdude: input file 0x0F contains 1 bytes

avrdude: reading on-chip lock data:


Reading | ################################################## | 100% 0.04s


avrdude: verifying ...

avrdude: 1 bytes of lock verified


avrdude done.  Thank you. 


Posted by 구차니
embeded/arduino(genuino)2016. 4. 6. 22:59

헐.. 설정이 문제가 아니었나 -ㅁ-?!?!


시리얼 포트를 통해서는 이런 메시지가(115k)

 NON GENUINE DEVICE FOUND! NON GENUINE DEVICE FOUND! 


구을려고 하면 아래와 같은 메시지가 나온다.

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58

         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         Copyright (c) 2007-2009 Joerg Wunsch


         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"


         Using Port                    : COM6

         Using Programmer              : arduino

         Overriding Baud Rate          : 57600

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x43

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x45

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x20

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x46

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x4f

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x55

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x4e

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x44

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x21

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x20 


얘는 내가 쓰던 usbisp 인데.. 이렇게 나오고..


안구워지는 녀석은.. 이렇게


구워지는 놈은 이렇게... 어?


윈도우 드라이버가 의심되서 봐도 머.. 둘다 상관없네




[링크 : http://www.instructables.com/id/A-solution-to-avrdude-stk500getsync-not-in-syn/]

[링크 : https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader]

[링크 : http://electropit.com/index.php/2015/09/06/arduino-nano-v3-0-clones/]

[링크 : http://internetofhomethings.com/homethings/?tag=not-genuine-device-found]

[링크 : http://www.ftdichip.com/Support/Utilities.htm#FT_PROG]



일단.. 위에 내용을 덮어 쓰고 하니까.

새로운 포트로 잡히고 나서 구워진다.. 머지?


16진수 값으로도 가장 마지막 비트가 먼가 이상한게 씌어져 있을때는 안되었고(무슨값인진..)

0000 으로 되어 있으니 되는걸 봐서는..

의심가는 건.. hardware specific 하위의 RS232와 IO 컨트롤 관련 셋팅..



Posted by 구차니
embeded/raspberry pi2016. 4. 6. 20:06

안된다는 말이 있어서 따라가보니...

핀 자체가 실장이 안되어 있다고... (GPIO19)



bcm2835 has support for I2C slave. Refer to section 11 of http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf


Unfortunately, GPIO pin 19 (BSC slave CLK) was dropped. http://elinux.org/RPi_BCM2835_GPIOs


So, the built-in I2C slave cannot be used.

[링크 : http://raspberrypi.stackexchange.com/questions/5584/i2c-raspberri-pi-as-a-slave]





[링크 : http://elinux.org/RPi_BCM2835_GPIOs]

Posted by 구차니
embeded/arduino(genuino)2016. 4. 6. 20:01

라즈베리는 3.3v 일테고

아두이노는 5v 일텐데.. 그냥 연결해도 되려나?

라즈베리 날려먹긴 싫은데.. 레벨 시프터 사야하나 ㅠㅠ


[링크 : https://www.eleparts.co.kr/EPX8MXNR] 6천원... ㅠㅠ


일단은...

아래는 3.3V 짜리를 5V인 아두이노에서 쓰는거지만...

[링크 : http://playground.arduino.cc/Main/I2CBi-directionalLevelShifter]

2016/04/01 - [embeded/arduino(genuino)] - 아두이노 level shift / MPU-6050


The Raspberry Pi is running at 3.3 Volts while the Arduino is running at 5 Volts. There are tutorials suggest using a level converter for the I2C communication. This is NOT needed if the Raspberry Pi is running as “master” and the Arduino is running as “slave”.


The reason it works is because the Arduino does not have any pull-ups resistors installed, but the P1 header on the Raspberry Pi has 1k8 ohms resistors to the 3.3 volts power rail. Data is transmitted by pulling the lines to 0v, for a “high” logic signal. For “low” logic signal, it’s pulled up to the supply rail voltage level. Because there is no pull-up resistors in the Arduino and because 3.3 volts is within the “low” logic level range for the Arduino everything works as it should.

[링크 : http://blog.oscarliang.net/raspberry-pi-arduino-connected-i2c/]

    [링크 : http://dsscircuits.com/articles/effects-of-varying-i2c-pull-up-resistors]

[링크 : http://blog.retep.org/2014/02/15/connecting-an-arduino-to-a-raspberry-pi-using-i2c/]




걍.. 과감하게(?) atmega 녀석들이 대부분 2.8V~5.5V 니까 3.3V로 주면 안되려나?


Operating Voltage:

1.8 - 5.5V


TWI(I2C)쪽 입력 전압은 Vcc + 0.5 니까.. 3.3V 주면은.. 어떻게 안되려나?

그나저나.. 0.3V~0.7V 로 무지 좁네..



[링크 : http://www.atmel.com/...atmega48a-48pa-88a-88pa-168a-168pa-328-328p_datasheet_complete.pdf]

Posted by 구차니
이론 관련2016. 4. 6. 09:39

어... 단순하게 arctan으로 하면 땡~이 아니었던게야?!?!?!





void calc_xy_angles(void){

   // Using x y and z from accelerometer, calculate x and y angles

   float x_val, y_val, z_val, result;

   unsigned short long x2, y2, z2; //24 bit


   // Lets get the deviations from our baseline

   x_val = (float)accel_value_x-(float)accel_center_x;

   y_val = (float)accel_value_y-(float)accel_center_y;

   z_val = (float)accel_value_z-(float)accel_center_z;


   // Work out the squares 

   x2 = (unsigned short long)(x_val*x_val);

   y2 = (unsigned short long)(y_val*y_val);

   z2 = (unsigned short long)(z_val*z_val);


   //X Axis

   result=sqrt(y2+z2);

   result=x_val/result;

   accel_angle_x = atan(result);


   //Y Axis

   result=sqrt(x2+z2);

   result=y_val/result;

   accel_angle_y = atan(result);


[링크 : http://www.hobbytronics.co.uk/accelerometer-info]


[링크 : https://cache.freescale.com/files/sensors/doc/app_note/AN3461.pdf]

[링크 : http://www.st.com/web/en/resource/technical/document/application_note/CD00268887.pdf]

[링크 : http://www.analog.com/media/en/technical-documentation/application-notes/AN-1057.pdf]


Posted by 구차니
embeded/raspberry pi2016. 4. 5. 16:00

음.. FREX 핀은있으나.. 웬지 라즈베리용 카메라에는 FREX를 빼놓지 않았을 기분?



43p



[링크 : http://www.seeedstudio.com/wiki/images/3/3c/Ov5647_full.pdf]

[링크 : http://www.ovt.com/uploads/parts/OV5647.pdf]


어? 120p가 안돼?

Frame rate up to 120 fps

max 90fps. Limitations on frame size for the higher frame rates (VGA only for above 47fps)


그리고.. external / internal sync. 미지원

Support for internal and external frame synchronisation for frame exposure mode

No

[링크 : https://www.raspberrypi.org/documentation/hardware/camera.md]

Posted by 구차니
embeded/raspberry pi2016. 4. 5. 15:25

한마디로 4채널까진 해상도 좀 낮춰서 1Gbps 보다 낮게 설정하면(동시 4채널까진 가능하단건가?)



[링크 : https://github.com/ivmech/ivport/wiki/Capture-Sequence]

[링크 : https://github.com/ivmech/ivport]


[링크 : http://www.arducam.com/multi-camera-adapter-module-raspberry-pi/]

[링크 : http://www.ivmech.com/.../ivport-raspberry-pi-camera-module-multiplexer-p-90]

[링크 :http://www.ivmech.com/.../ivport-dual-raspberry-pi-camera-module-multiplexer-p-104 ]




+

OV5647 can be synched with another sensor using the FREX pin input/output (works also in rolling shutter mode). Needs support in driver though. Guess the FREX pin is not even used in Raspberry Pi Camera design, at least Omnivision reference desing tells not to populate the zero ohm resistor which connect this pin to connector.

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?p=483936]



The Raspberry Pi has a Mobile Industry Processor Interface (MIPI) Camera Serial Interface Type 2 (CSI-2)

MIPI CSI-2 version 1.01 supports up to four data lanes, where each lane has a maximum of 1 Gbps bandwidth, to provide a total bandwidth of 4 Gbps.

[링크 : http://www.petervis.com/Raspberry_PI/Raspberry_Pi_CSI/Raspberry_Pi_CSI_Camera_Interface.html]



음? 카메라 모듈이 기본 2개니까.. 2채널은 동시?


MIPI interface (two lanes) Yes

[링크 : https://www.raspberrypi.org/documentation/hardware/camera.md]



compute module에는 카메라가 두개 꽂히나 보네?

[링크 : https://www.raspberrypi.org/blog/real-time-depth-perception-with-the-compute-module/]

[링크 : http://www.argondesign.com/case-studies/2014/oct/21/stereo-depth-perception-raspberry-pi/]




[링크 : https://www.raspberrypi.org/.../computemodule/RPI-CMIO-V1_2-SCHEMATIC.pdf]


[링크 : https://www.raspberrypi.org/.../raspberrypi/schematics/RPI-3B-V1_2-SCHEMATIC-REDUCED.pdf]

Posted by 구차니


ext. sync 라고 되어 있는 구멍이 장비들에 있어서

그게 명칭인줄 알았더니.. genlock이 명칭인가?



[링크 : http://wiki.edgertronic.com/index.php/Genlock]

[링크 : http://www.bhphotovideo.com/.../timecode-versus-sync-how-they-differ-and-why-it-matters]

[링크 : https://en.wikipedia.org/wiki/Genlock]

'이론 관련 > 전기 전자' 카테고리의 다른 글

bayer 포맷 출력...?  (0) 2016.04.14
패럿(farad) / 암페어(ampere) 변환  (0) 2016.04.14
tri-state  (0) 2016.03.30
solid state  (0) 2016.01.17
디지털 서보(?)  (0) 2015.11.24
Posted by 구차니