embeded/AVR (ATmega,ATtiny)2021. 6. 28. 22:19

attiny2313에 엣지 트리거 핀 하나 이용해서 USB 1.1 구현을 한 듯.

음.. atmega128 등에서는 못쓰는건가?

No UART, timer, input capture unit or other special hardware is required (except one edge triggered interrupt).

 [링크 : https://www.obdev.at/products/vusb/index.html]

 

Previous versions have been tested with IAR 4.10B/W32 and

[링크 : https://github.com/obdev/v-usb/blob/master/Readme.txt]

[링크 : https://github.com/obdev/v-usb]

 

다운로드 해서 보니 ATtny45 ATmega8에 대한 언급은 있는데

압축 파일 자체가 2012 인걸 봐서는.. 오랫동안 유지보수 안된 것 같긴하다..

[링크 : https://www.obdev.at/products/vusb/download.html]

'embeded > AVR (ATmega,ATtiny)' 카테고리의 다른 글

ATMEL AT32UC3A 시리즈  (0) 2023.07.04
AVR FFB(force feedback)  (0) 2021.06.29
avrisp mk2 / avrisp mk2 clone / stk500 clone  (0) 2017.11.21
avr unlock 관련  (0) 2017.11.21
avrdude + usbasp 테스트  (0) 2017.11.21
Posted by 구차니
embeded/raspberry pi2021. 6. 28. 16:14

usb hid 라이브러리

[링크 : https://circuitpython.org/libraries]

circuit python uf2 다운로드

[링크 : https://circuitpython.org/board/raspberry_pi_pico/]

 

step 1. circuit python uf2 파일 쓰기

BOOTSEL 누르고 부팅해서 adafruit-circuitpython-raspberry_pi_pico-en_US-6.3.0.uf2 파일을 드라이브에 던진다.

 

step 2. lib 복사

circuitpython이 설치되면 리부팅 되고 아래와 같은 구조의 디렉토리가 보이게 된다.

adafruit-circuitpython-bundle-6.x-mpy-20210625.zip 를 받아 zip 파일내의

adafruit_hid 디렉토리를 lib/adafruit_hid 에 복사한다.

[링크 : https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries]

 

step 3. code.py 작성

아래는 꽂으면 A만 미친듯이 눌러대는 녀석이다. (그러니 현재는 테러용 USB ㅋㅋ)

마치 shift가 눌린 것 처럼 작동하는데 코드는 좀 더 분석이 필요하다.

Import time

import board
import digitalio
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_hid.keycode import Keycode

# The Keycode sent for each button, will be paired with a control key
keys_pressed = [Keycode.A, "Hello World!\n"]
control_key = Keycode.SHIFT

# The keyboard object!
time.sleep(1)  # Sleep for a bit to avoid a race condition on some systems
keyboard = Keyboard(usb_hid.devices)
keyboard_layout = KeyboardLayoutUS(keyboard)  # We're in the US :)

while True:
    keyboard_layout.write('A')
    time.sleep(0.01)

 

Hello world 출력하는 키보드(!) 예제 ㅋㅋ

import time

import board
import digitalio
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_hid.keycode import Keycode

# The keyboard object!
time.sleep(1)  # Sleep for a bit to avoid a race condition on some systems
keyboard = Keyboard(usb_hid.devices)
keyboard_layout = KeyboardLayoutUS(keyboard)  # We're in the US :)

while True:
    keyboard_layout.write('H')
    keyboard_layout.write('e')
    keyboard_layout.write('l')
    keyboard_layout.write('l')
    keyboard_layout.write('o')
    keyboard_layout.write(' ')
    keyboard_layout.write('w')
    keyboard_layout.write('o')
    keyboard_layout.write('r')
    keyboard_layout.write('l')
    keyboard_layout.write('d')
    time.sleep(1)

[링크 : https://tutorial.cytron.io/.../keyboard-emulator-using-raspberry-pi-pico-maker-pi-pico-and-circuitpython/]

[링크 : https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython]

[링크 : https://learn.adafruit.com/circuitpython-essentials/circuitpython-hid-keyboard-and-mouse]

 

'embeded > raspberry pi' 카테고리의 다른 글

AArch64 linux cpu features  (0) 2021.06.30
citcuitpyrhon joystick  (0) 2021.06.28
rpi pico pinout  (0) 2021.06.28
rpi 3b+ with bt / uart  (0) 2021.06.28
rpi pico USB OTG를 이용한 오실로스코프  (0) 2021.06.27
Posted by 구차니
embeded/raspberry pi2021. 6. 28. 11:51

VBUS(GP40, 우측 상단)에 연결하면 USB Host 모드로만 작동해야 한다는 의미 같은데

아마 USB device 모드라면 USB를 통해 전원을 입력받아야 하기 때문이려나?

Whilst it is possible to connect the Raspberry Pi’s 5V pin to the Raspberry Pi Pico VBUS pin, this is not recommended.
Shorting the 5V rails together will mean that the Micro USB cannot be used. An exception is when using the Raspberry
Pi Pico in USB host mode, in this case 5V must be connected to the VBUS pin.

 

 

GP0이 TX GP1이 RX

 

LED는 GPIO25에 연결되어 있고, TP5로도 연결이 되어있는데

BOOTSEL은 TP6에만 되어있고 GPIO로 연결은 되어 있지 않다.

TP1 – Ground (close coupled ground for differential USB signals)
TP2 – USB DM
TP3 – USB DP
TP4 – GPIO23/SMPS PS pin (do not use)
TP5 – GPIO25/LED (not recommended to be used)
TP6 – BOOTSEL

[링크 : https://www.raspberrypi-spy.co.uk/2021/01/pi-pico-pinout-and-power-pins/#prettyPhoto]

 

[링크 : https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf]

'embeded > raspberry pi' 카테고리의 다른 글

citcuitpyrhon joystick  (0) 2021.06.28
rpi pico, circuitpython, USB HID  (0) 2021.06.28
rpi 3b+ with bt / uart  (0) 2021.06.28
rpi pico USB OTG를 이용한 오실로스코프  (0) 2021.06.27
rpi pico usb 저장소  (0) 2021.06.24
Posted by 구차니
embeded/raspberry pi2021. 6. 28. 11:44

라즈베리파이 3B를 사용중인데 ttyAMA0를 하니 minicom 자체가 먹통이 되서

rpi pico랑 연결하는글을 보다가 발견

$ minicom -b 115200 -o -D /dev/serial0

[링크 : https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf]

 

흐음.. serial0을 쓰도록 해야 할 것 같네.

$ ls -al /dev/serial*
lrwxrwxrwx 1 root root  5 Jun 28 02:17 /dev/serial0 -> ttyS0
lrwxrwxrwx 1 root root  7 Jun 28 02:17 /dev/serial1 -> ttyAMA0

 

+

원래 시리얼통신 포트 이름은 /dev/ttyAMA0이다. 그런데 파이3에서는, 이전까지 /dev/ttyAMA0에 할당되어있던 시리얼포트가 블루투스에 할당되었다. 시리얼포트는 /dev/ttyS0로 옮겨졌다.

[링크 : http://lhdangerous.godohosting.com/wiki/index.php/라즈베리파이_시리얼_통신_설정...]

'embeded > raspberry pi' 카테고리의 다른 글

rpi pico, circuitpython, USB HID  (0) 2021.06.28
rpi pico pinout  (0) 2021.06.28
rpi pico USB OTG를 이용한 오실로스코프  (0) 2021.06.27
rpi pico usb 저장소  (0) 2021.06.24
rpi pico main.py 올리기 윈도우10, 우분투  (0) 2021.06.24
Posted by 구차니
embeded/esp322021. 6. 28. 11:11

http://ip << 웹기반 뷰어

http://ip:81/stream << 크롬 / vlc 스트리밍

 

물론(?) 당연히 한개 세션만 스트리밍 되는 한계로

웹에서 켜놓고 있으면 http://ip:81/stream 으로도 안나온다. -_-

 

[링크 : https://blog.naver.com/pa3018/221481983862]

[링크 : https://github.com/espressif/esp32-camera/issues/24]

'embeded > esp32' 카테고리의 다른 글

esp32 freertos  (0) 2021.07.07
esp32cam setting  (0) 2021.07.06
LDO 발열?  (0) 2021.06.25
esp32-cam camerawebserver  (0) 2021.06.24
esp32 cpu 사양 및 성능  (0) 2021.06.23
Posted by 구차니
embeded/raspberry pi2021. 6. 27. 08:23

USB OTG 케이블을 이용하여

간이 오실로스코프를 만들수 있다니 혹하는데 3.3V 까지 밖에 안되니 주의를 기울여야 할지도..

 

[링크 : https://hackaday.com/2021/06/26/raspberry-pi-pico-oscilloscope/]

[링크 : https://github.com/fhdm-dev/scoppy]

 

'embeded > raspberry pi' 카테고리의 다른 글

rpi pico pinout  (0) 2021.06.28
rpi 3b+ with bt / uart  (0) 2021.06.28
rpi pico usb 저장소  (0) 2021.06.24
rpi pico main.py 올리기 윈도우10, 우분투  (0) 2021.06.24
uf2 - USB Flash Format  (0) 2021.06.23
Posted by 구차니
embeded/esp322021. 6. 25. 10:09

LDO를 다들 설계잘해서 열이 안나는 거였나..

아니면 전류가 너무 높은건가?

 

[링크 : https://elec4.co.kr/article/articleView.asp?idx=18339]

[링크 : http://www.thelec.kr/news/articleView.html?idxno=3080]

[링크 : https://cafe.daum.net/HWD/3uXt/5365?svc=cafeapi]

 

 

+

2021.06.28

라즈베리의 3.3V 출력을 이용해서 켜봤는데..

부하가 걸리면 열 나는건 매한가지. 코어 자체가 클럭이 높아서 그런가 열이 좀 심한듯..

그리고 LDO가 열나는건지 PSRAM이 열나는건진 분간이 안되네

'embeded > esp32' 카테고리의 다른 글

esp32cam setting  (0) 2021.07.06
esp32cam webservercam rtsp?  (0) 2021.06.28
esp32-cam camerawebserver  (0) 2021.06.24
esp32 cpu 사양 및 성능  (0) 2021.06.23
ov2640 on esp32-cam  (0) 2021.06.23
Posted by 구차니
embeded/raspberry pi2021. 6. 24. 19:38

usn storage는 bootloader나 펌웨어 올리는 용도라고

micropython 에서 파일 시스템 처럼 제공하는건 그럼 그렇게 보여질 뿐인건가?

 

[링크 : https://forum.micropython.org/viewtopic.php?t=9745]

'embeded > raspberry pi' 카테고리의 다른 글

rpi 3b+ with bt / uart  (0) 2021.06.28
rpi pico USB OTG를 이용한 오실로스코프  (0) 2021.06.27
rpi pico main.py 올리기 윈도우10, 우분투  (0) 2021.06.24
uf2 - USB Flash Format  (0) 2021.06.23
rpi pico micropython  (0) 2021.06.23
Posted by 구차니
embeded/esp322021. 6. 24. 16:17

환경설정에서 espressif의 패키지를 추가한다.

[링크 : https://dl.espressif.com/dl/package_esp32_index.json]

 

 

보드 매니저에서 esp32를 추가한다.

 

소스 예제에서 esp32 / cam / camerawebserver를 끌어와서

camera_model_ai_thinker로 변경하고 ssid와 password를 변경한다.

 

음.. 구으면서 CPU 모델이 나오네?

스케치는 프로그램 저장 공간 2594790 바이트(82%)를 사용. 최대 3145728 바이트.
전역 변수는 동적 메모리 56256바이트(17%)를 사용, 271424바이트의 지역변수가 남음.  최대는 327680 바이트. 
esptool.py v3.0-dev
Serial port /dev/ttyUSB0
Connecting.....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 84:cc:a8:2f:0d:d0
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 12970.2 kbit/s)...
Hash of data verified.
Compressed 18656 bytes to 12053...
Writing at 0x00001000... (100 %)
Wrote 18656 bytes (12053 compressed) at 0x00001000 in 0.3 seconds (effective 532.1 kbit/s)...
Hash of data verified.
Compressed 2594912 bytes to 2073530...
Writing at 0x00010000... (0 %)
...
Writing at 0x00208000... (100 %)
Wrote 2594912 bytes (2073530 compressed) at 0x00010000 in 48.9 seconds (effective 424.9 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 119...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (119 compressed) at 0x00008000 in 0.0 seconds (effective 5636.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...




3.3V로 했더니 전력 부족으로 켜지지 못해서 brown out detector 가 트리거 되었다고 에러가 뜬다. -_ㅠ

Brownout detector was triggered

ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4

 

5V로 하니 정상적으로 켜지는 느낌? 일단 점만 찍어대고 먼가 진행을 못하네..

다시 코드를 보니 아무생각 없이 5G 공유기 SSID를 적어놨... 2.4GHz만 되는 WIFI에 무슨 학대를!!!

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371 
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944                                                       
load:0x40080400,len:6388                                                        
entry 0x400806b4                                                                
                                                               

[링크 : https://dronebotworkshop.com/esp32-cam-intro/]

 

공유기에서 ip 찾아서 (시리얼 로그에서 아이피 출력되면 좋으련만) 접속하니 된다!

그런데 카메라 문제인가 -_ㅠ 한쪽에 노란줄이 생기네!! 불량아냐 불량?!!?

그리고 동시에 여러 곳에서 접속은 불가능하다(한곳에서 start stream 하면 다른 곳에서는 엑박으로 나온다)

 

그나저나 가동한지 얼마 안되었는데 5V 전압을 넣어서 그런건진 모르겠지만

손으로 잡고 있기 조금 부담스러울 정도로 열이 난다.

비접촉식으로 재보니 50도 넘게 올라가는 듯(5분 정도 켜놓으니)

 

+

AMS1117 라고 써있어서 보니 5V -> 3.3V LDO 인데

왜이렇게 열이 미친듯이 나지?

[링크 : https://www.devicemart.co.kr/goods/view?no=1321251]

 

아니면 PSRAM?

ipus ips6404lsq

[링크 : http://platform.digiic.com/Docs/Product/IPS6404L-SQ-SPN/IPUS%2064Mbit%20SQPI%20PSRAM%20.pdf]

'embeded > esp32' 카테고리의 다른 글

esp32cam webservercam rtsp?  (0) 2021.06.28
LDO 발열?  (0) 2021.06.25
esp32 cpu 사양 및 성능  (0) 2021.06.23
ov2640 on esp32-cam  (0) 2021.06.23
esp32 fw upload  (0) 2021.06.23
Posted by 구차니
embeded/raspberry pi2021. 6. 24. 12:35

우분투에서 rpi pico를 연결하면 아래와 같이 뜨고

[   44.398531] usb 2-1.2: new full-speed USB device number 4 using ehci-pci
[   44.508833] usb 2-1.2: New USB device found, idVendor=2e8a, idProduct=0005, bcdDevice= 1.00
[   44.508840] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   44.508845] usb 2-1.2: Product: Board in FS mode
[   44.508848] usb 2-1.2: Manufacturer: MicroPython
[   44.508852] usb 2-1.2: SerialNumber: e6609cb2d3440b2a
[   44.535497] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device
[   44.536117] usbcore: registered new interface driver cdc_acm
[   44.536119] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

 

동영상에서 본대로 해보니 되는데 일단은 ttyACM0을 sudo 없이 여는 법을 찾아봐야...(휠 설정을 찾아야 하나)

아무튼 rshell을 통해서 접속하면 /pyboard 라는 경로가 생기는데 이쪽으로 복사해야 된다.

USB 저장장소로 인식되는 건.. 펌웨어만 올리는 용도인가?

$ sudo pip3 install rshell
Collecting rshell
  Downloading rshell-0.0.30.tar.gz (51 kB)
     |████████████████████████████████| 51 kB 514 kB/s 
Collecting pyserial
  Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)
     |████████████████████████████████| 90 kB 2.8 MB/s 
Collecting pyudev>=0.16
  Downloading pyudev-0.22.0.tar.gz (85 kB)
     |████████████████████████████████| 85 kB 2.3 MB/s 
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from pyudev>=0.16->rshell) (1.14.0)
Building wheels for collected packages: rshell, pyudev
  Building wheel for rshell (setup.py) ... done
  Created wheel for rshell: filename=rshell-0.0.30-py3-none-any.whl size=52770 sha256=69461b75172bb35e222ba9bfd46158ac9463367a21b39f76cc59b930ecf91e60
  Stored in directory: /root/.cache/pip/wheels/e4/ac/b5/2937f0e9ff638dc7ee71168edfa9245ca968438f4a3f7dff9d
  Building wheel for pyudev (setup.py) ... done
  Created wheel for pyudev: filename=pyudev-0.22.0-py3-none-any.whl size=63469 sha256=fad8e733a62171573d784a43062b27df75b2d4117cd364e446804b9210c93b2b
  Stored in directory: /root/.cache/pip/wheels/8b/d1/11/6a9855487e4bba54c63dfb07a09505787d50a5e27f90b0af33
Successfully built rshell pyudev
Installing collected packages: pyserial, pyudev, rshell
Successfully installed pyserial-3.5 pyudev-0.22.0 rshell-0.0.30

$ sudo rshell
Connecting to /dev/ttyACM0 (buffer-size 128)...
Trying to connect to REPL  connected
Retrieving sysname ... rp2
Testing if sys.stdin.buffer exists ... Y
Retrieving root directories ... 
Setting time ... Jun 24, 2021 12:31:53
Evaluating board_name ... pyboard
Retrieving time epoch ... Jan 01, 1970
Welcome to rshell. Use Control-D (or the exit command) to exit rshell.
/home/minimonk> ls -al main.py
   166 Jun 24 12:31 main.py
/home/minimonk> ls -al /pyboard/
/home/minimonk> mount
Unrecognized command: mount
/home/minimonk> cp main.py /pyboard/main.py
Copying '/home/minimonk/main.py' to '/pyboard/main.py' ...
/home/minimonk> exit

$

 

+

thonny 를 윈도우에 깔고 시작!

음.. initial settings에 standard와 raspberry pi가 있는데 일단은.. pico가 라즈베리일려나?

 

Switch to regular mode 버튼을 눌러보면

 

tools - options - general 에 가서 바꿀수 있다는데 라즈베리 파이 모드에서는 안뜨는 메뉴인듯

재시작해보면 달라지긴 한데.. 

 

UI만 달라졌을뿐 큰 차이는 없는 듯?

 

암튼 우측 하단에 Python 이라고 된 걸 클릭해서

MicroPython (Raspberry Pi Pico) 로 바꾸면 설정 끝

 

빈걸 저장 눌러보니 어디다 저장할지 물어보는데 "Raspberry Pi Pico"를 누르면

 

라즈베리 내의 저장된 파일 목록이 뜬다. (오오 신기 -_-)

 

main.py로 하면 리부팅시 작동하는 걸 확인할 수 있다.

일단은 이런 프로그램을 거치지 않으면.. 올릴수도 없는건가?

[링크 : https://thonny.org/]

[링크 : https://www.digikey.be/en/maker/projects/raspberry-pi-pico-and-rp2040-micropython-part-1-blink/...]

[링크 : https://www.electronicshub.org/raspberry-pi-pico-micropython-tutorial/]

'embeded > raspberry pi' 카테고리의 다른 글

rpi pico USB OTG를 이용한 오실로스코프  (0) 2021.06.27
rpi pico usb 저장소  (0) 2021.06.24
uf2 - USB Flash Format  (0) 2021.06.23
rpi pico micropython  (0) 2021.06.23
rpi pico - RP2040  (0) 2021.06.23
Posted by 구차니