embeded/raspberry pi2016. 3. 25. 09:35

onvif 지원되는 녀석들도 있으려나...

예전 글에 적어 둔거 같은데.. UI도 괜찮은 녀석 이름이 머였지?


[링크 : https://github.com/BreeeZe/rpos]

[링크 : https://github.com/SonsOfTone/RaspberrIP-Camera]

    [링크 : http://www.sonsoftone.com/?page_id=287]

[링크 : ]

Posted by 구차니
embeded/raspberry pi2016. 3. 21. 11:46

음.. 그런데 2b에서는 멀티코어인데 코어활성화 갯수 조절은 없으려나?



1. USB 허브 끄기(근데.. 유선랜도 꺼지려나?)

2. USB 안꼽기

3. HDMI 출력 끄기 (20mA~30mA ?)

4. 다운클럭하기 (/boot/config.txt)


[링크 : http://babaawesam.com/2014/01/24/power-saving-tips-for-raspberry-pi/]

Posted by 구차니
embeded/raspberry pi2016. 3. 20. 17:37


range는 0x20(32)가 기본이고 32bit까지 사용가능(int)

"PWM_RNG1의 값이 32보다 적다면, 처음 PWM_RNG의 첫번째 비트가 잘려진 비트가 전송되어진다. 만약 32를 넘는 경우 초과된 0 비트는 데이터의 끝에서 부터 붙여진다. 기본값은 32이다."

If the value in PWM_RNGi is less than 32, only the first PWM_RNGi bits are sent resulting in a truncation. If it is larger than 32 excess zero bits are padded at the end of data. Default value for this register is 32.


번역하려고 해도 무슨 의미인지 모르겠네 -_-

32 미만은 LSB가 0으로 보내진다는건가? (즉, 짝수로만 셋팅가능?)

그리고 32 이상은 초과된 0비트에 대해서 끝으로 부터 붙는다는건.. 32 이상에 대해서는 32의 배수로만 적용이 가능하거나 승수로만 가능하다는건가? (예를들어 36이라던가 이런식은 설정 불가)




그리고 클럭은... 기본이 100MHz 이지만 다양하게 들어올 수 있다 정도?


음.. range는 그냥 넣고.. 하드웨어적으로 자르고

클럭은.. int로 받지만 실제로는 12비트만 사용이 가능하고(즉,, 0~4095)

기본값 내용이 없는지라..

void pwmSetRange (unsigned int range)

{

  if ((wiringPiMode == WPI_MODE_PINS) || (wiringPiMode == WPI_MODE_PHYS) || (wiringPiMode == WPI_MODE_GPIO))

  {

    *(pwm + PWM0_RANGE) = range ; delayMicroseconds (10) ;

    *(pwm + PWM1_RANGE) = range ; delayMicroseconds (10) ;

  }

}


void pwmSetClock (int divisor)

{

  uint32_t pwm_control ;

  divisor &= 4095 ;


  if ((wiringPiMode == WPI_MODE_PINS) || (wiringPiMode == WPI_MODE_PHYS) || (wiringPiMode == WPI_MODE_GPIO))

  {

    if (wiringPiDebug)

      printf ("Setting to: %d. Current: 0x%08X\n", divisor, *(clk + PWMCLK_DIV)) ;


    pwm_control = *(pwm + PWM_CONTROL) ;                // preserve PWM_CONTROL


// We need to stop PWM prior to stopping PWM clock in MS mode otherwise BUSY

// stays high.


    *(pwm + PWM_CONTROL) = 0 ;                          // Stop PWM


// Stop PWM clock before changing divisor. The delay after this does need to

// this big (95uS occasionally fails, 100uS OK), it's almost as though the BUSY

// flag is not working properly in balanced mode. Without the delay when DIV is

// adjusted the clock sometimes switches to very slow, once slow further DIV

// adjustments do nothing and it's difficult to get out of this mode.


    *(clk + PWMCLK_CNTL) = BCM_PASSWORD | 0x01 ;        // Stop PWM Clock

      delayMicroseconds (110) ;                 // prevents clock going sloooow


    while ((*(clk + PWMCLK_CNTL) & 0x80) != 0)  // Wait for clock to be !BUSY

      delayMicroseconds (1) ;


    *(clk + PWMCLK_DIV)  = BCM_PASSWORD | (divisor << 12) ;


    *(clk + PWMCLK_CNTL) = BCM_PASSWORD | 0x11 ;        // Start PWM clock

    *(pwm + PWM_CONTROL) = pwm_control ;                // restore PWM_CONTROL


    if (wiringPiDebug)

      printf ("Set     to: %d. Now    : 0x%08X\n", divisor, *(clk + PWMCLK_DIV)) ;

  }


[링크 : http://www.farnell.com/datasheets/1521578.pdf]

2015/10/16 - [개소리 왈왈/라즈베리 파이(rpi)] - bcm2835 pwm 데이터시트

2015/10/16 - [개소리 왈왈/라즈베리 파이(rpi)] - wiringpi pwm 라이브러리 분석?

2015/10/14 - [개소리 왈왈/라즈베리 파이(rpi)] - 라즈베리 파이 GPIO 유틸 PWM


The Raspberry Pi PWM clock has a base frequency of 19.2 MHz. This frequency, divided by the argument to pwmSetClock(), is the frequency at which the PWM counter is incremented. When the counter reaches a value equal to the specified range, it resets to zero. While the counter is less than the specified duty cycle, the output is high, otherwise the output is low.


This means, if you want to set the PWM to have a specific frequency, you can use the following relationship:


pwmFrequency in Hz = 19.2e6 Hz / pwmClock / pwmRange.


pwmSetClock(1); -> 2.342kHz

pwmSetClock(2); -> 4.81MHz

pwmSetClock(3); -> 3.19MHz

pwmSetClock(4); -> 2.398MHz

pwmSetClock(5); -> 1.919MHz

pwmSetClock(6); -> 1.6MHz

pwmSetClock(7); -> 1.3MHz

pwmSetClock(8); -> 1.2MHz

pwmSetClock(9); -> 1.067MHz

pwmSetClock(10); -> 959kHz

pwmSetClock(11); -> 871kHz

pwmSetClock(20); -> 480kHz

pwmSetClock(200); -> 48kHz

pwmSetClock(500); -> 19kHz

pwmSetClock(1000); -> 9.59kHz

pwmSetClock(2000); -> 4.802kHz

pwmSetClock(4000); -> 2.401kHz

pwmSetClock(5000); -> 10.58kHz

[링크 : http://raspberrypi.stackexchange.com/questions/4906/control-hardware-pwm-frequency]



음.. pwmc에 100 넣으면 1/100 으로 DIV 되서 1Mhz 로 작동해야 하는데.. 위에 실험은 출력이 달라서 그럴려나?

   #define PWMCTL (*(volatile uint32_t *)0x2020c000)

   #define PWMSTA (*(volatile uint32_t *)0x2020c004)

   #define PWMDMAC (*(volatile uint32_t *)0x2020c008)

   #define PWMRNG1 (*(volatile uint32_t *)0x2020c010)

   #define PWMDAT1 (*(volatile uint32_t *)0x2020c014)

   #define PWMFIF1 (*(volatile uint32_t *)0x2020c018)

   #define PWMRNG2 (*(volatile uint32_t *)0x2020c020)

   #define PWMDAT2 (*(volatile uint32_t *)0x2020c024)


   #define CM_PWMCTL (*(volatile uint32_t *)0x201010a0)

   #define CM_PWMDIV (*(volatile uint32_t *)0x201010a4)


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

Posted by 구차니
embeded/raspberry pi2016. 3. 19. 20:39

그냥 pc 스피커 굴러 다니는게 있길래

마침 4핀 짜리고 해서 꽂아서 pwm으로 해보니 소리가 난다 -ㅁ-!?


아무튼.. pwm-ms와 pwm-bal의 출력방식이 다르니 소리가 다르게 난다.


$ gpio mode 1 pwm

$ gpio pwm-ms

$ gpio pwm 1 7


$ gpio pwm-bal 

$ gpio pwm 1 7




+

2016.04.13

미친척 오실로 스코프로 찍어보니..

$ gpio mode 1 pwm

$ gpio pwm 1 512

$ gpio pwmc 10



7  2680 Hz

8  2343 Hz

9  2083 Hz

10 1875 Hz

11 1704 Hz

12 1562 Hz

13 1443 Hz

14 1339 Hz

15 1250 Hz

16 1172 Hz

17 1103 Hz

18 1042 Hz





클럭을 가지고 하기에는 좀 그렇고... 어떻게 해야 하려나?

[링크 : http://thomson.tistory.com/638]

Posted by 구차니
embeded/AVR (ATmega,ATtiny)2016. 3. 16. 16:11


[링크 : http://blog.naver.com/rk756/100133481427] BASCOM으로 AVR 소리내기

[링크 : http://www.mcselec.com/] BASCOM - BASic COMpiler for AVR


[링크 : http://www.maicom.co.kr/xe/3000]


[링크 : http://www.ermicro.com/blog/?p=580] c버전/ 반짝반짝 작은별


http://extremeelectronics.co.in/avr-tutorials/sound-generation-by-avr-micro-tutorial-i/ 

http://tahmidmc.blogspot.kr/2013/02/sine-wave-generation-with-fast-pwm-mode_2525.html

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

avr pwm timer 계산기  (0) 2016.04.14
atmega sram external  (0) 2016.04.12
클론 avrisp avr studio 6 호환성(?)  (0) 2016.03.07
AVR ISP 부활의 조짐?!  (0) 2016.03.05
보유중인 avr 보드목록  (0) 2016.03.05
Posted by 구차니
embeded2016. 3. 16. 15:15

데이터 시트

[링크 : http://gongnoob.blog.me/123329737]


AVR 소스(심플)

[링크 : http://pilgoo.tistory.com/50]


+

웬지.. z80이 아니라 intel 808x 시리즈의 80 system?


2014/02/07 - [embeded/AVR (ATmega/ATtiny)] - COM26T2844VTX 컨트롤러 HD66781

2013/07/23 - [embeded/AVR (ATmega/ATtiny)] - COM26T2844VTX LCD 데이터 시트

2014/01/27 - [embeded] - Z80 M6800


- M68 system interface with 8-/ 9-/16-/18-bit bus width

- i80 system interface with 8-/ 9-/16-/18-bit bus width


[링크 : http://www.ampdisplay.com/technology.php?c=tech_lcd_interface]



[링크 : https://www.adafruit.com/datasheets/ILI9325.pdf]

'embeded' 카테고리의 다른 글

프로세서별 연산량 벤치마크(float)  (0) 2017.04.19
PCB 마킹 의미  (0) 2016.07.28
링커 스크립트 문법(ld syntax)  (0) 2015.12.17
시리얼 저항 / 직렬 저항 / 댐핑 저항  (0) 2015.12.17
microchip PIC  (0) 2015.09.08
Posted by 구차니
embeded/raspberry pi2016. 3. 15. 10:40

똥강아지와 똥개 감시용(?)으로 대충 만들어 본 녀석

천원짜리 다이소에서 종이박스 사고

굴러다니던 핸드폰 보조배터리 하나로 끝!




대역폭의 문제로 640x480 @ 15fps인데

좀 다르게 셋팅해봐야지..



보조 배터리 2500mA 짜리인데

3시간은 버텨주네(접속시 + 무선) 올

샤오미 10500 쓰면 그럼 15시간?! ㅋㅋ


Posted by 구차니
embeded/raspberry pi2016. 3. 14. 09:18

유리 나가서 어떻게 잘 살릴수있나 했더니

SYSTEM : 장비가 파괴되었습니다!


분해된 잔해

LCD/백라이트 유닛 / 터치 하판 / 터치 상판


음.. 아무튼 터치상판인데 가로려나 세로이려나...


하판.. 커넥터 방식이 아니라 과감하게 끊어내고!!



아무튼.. 라즈베리 jessie 버전에서

클럭을 65MHz로 설정해주니 노이즈 생겨서 fps=25 옵션만 주고 사용

그나저나.. 터치가 안되니 계륵이네... ㅠㅠ

Posted by 구차니
embeded/raspberry pi2016. 3. 13. 23:26

음.. mmal 어쩌구 로그에 뜨는데

cpu 사용량을 보면 100% 인걸 봐서는 제대로 적용 안되거나

그게 한계일지도?



재기동

sudo nano /etc/init.d/motion

sleep 30

[링크 : http://www.codeproject.com/Articles/665518/Raspberry-Pi-as-low-cost-HD-surveillance-camera]

<< 많이 달라졌고, 안해도 문제 없음 단, 모션 저장이나 상시 녹화 쪽 문제로 보임


모션디텍트 끄기

http://raspberry:8081/0/detection/pause

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?f=48&t=70917]


led끄기

/boot/config.txt

disable_camera_led=1

[링크 : http://www.raspberrypi-spy.co.uk/2013/05/how-to-disable-the-red-led-on-the-pi-camera-module/]

>> 안되네.. 내꺼는 안되나... ㅠㅠ

Posted by 구차니
embeded/raspberry pi2016. 3. 12. 11:37

왜이렇게 cpu를 조금 먹나 했더니.. MMAL 쓴건가?


[링크 : https://github.com/raspberrypi/userland/tree/master/host_applications/linux/apps/raspicam]


아.. 헷갈리네..

MMAL은 원래 있던거고 rpi videocore용으로 포팅한건가?

[링크 : http://www.jvcref.com/files/PI/documentation/html/]


아무튼.. mmal 사용하면 cpu 확 줄어 들려나..

v4l 통해서 받는 비디오는 너무 느려..

Posted by 구차니