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 구차니
Programming/C Win32 MFC2016. 3. 18. 20:49



[링크 : https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html]

[링크 : https://msdn.microsoft.com/ko-kr/library/ms177415.aspx]

'Programming > C Win32 MFC' 카테고리의 다른 글

MFC UpdateData()  (0) 2016.12.16
윈도우에서 dll 동적 라이브러리 사용하기  (0) 2016.04.04
#import ?  (0) 2015.12.21
"\n" 의 cpu 점유율?  (0) 2015.10.12
rand()와 RAND_MAX  (0) 2015.10.05
Posted by 구차니

...?!?!?!?




'게임 > 오리진&스팀&유플레이' 카테고리의 다른 글

tropico 4 무료  (0) 2016.09.09
오리진의 선물!  (0) 2016.03.26
오리진의 선물 - NFS 모스트 원티드  (0) 2016.02.03
스팀 195개.. 오리진 45개?  (0) 2016.01.12
인디갈라 획득 실패 ㅠㅠ  (0) 2015.12.18
Posted by 구차니

locky에 당한거라 그런지.. CryptoLocker로는 탐지가 안되네


$ sudo apt-get install python python-pycryptopp

$ git clone https://github.com/kyrus/crypto-un-locker

$ cd crypto-un-locker/

$ ./CryptoUnLocker.py --detect ../locky/ -v -r

[.] Not a CryptoLocker file: ../locky/93884EE06F58D7ED0D84C61528753B96.locky

[.] Not a CryptoLocker file: ../locky/_Locky_recover_instructions.bmp

[.] Not a CryptoLocker file: ../locky/93884EE06F58D7EDCEFB320EC0C56FAF.locky

[.] Not a CryptoLocker file: ../locky/93884EE06F58D7ED2D945114FFCD5746.locky

[.] Not a CryptoLocker file: ../locky/93884EE06F58D7ED71B7B22B28863630.locky

[.] Not a CryptoLocker file: ../locky/93884EE06F58D7ED087EB261AF14131B.locky

[.] Not a CryptoLocker file: ../locky/_Locky_recover_instructions.txt


[링크 : https://github.com/kyrus/crypto-un-locker]



'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

다음 약도만들기 서비스  (0) 2016.03.31
po지름wer!!!  (0) 2016.03.24
망할 locky 랜섬웨어 -_-  (3) 2016.03.16
아.. 멀 사지.. 멀 사면 행복할까?  (0) 2016.03.05
야근야근 열매  (0) 2016.03.01
Posted by 구차니

암튼 걸리면 이렇게 쫘르륵 *.locky로 바뀌고


바탕화면은 이런걸로 뜬다.


저 망할 주소는 _Locky_recover_instructions.txt 파일에 친절하게 있으니 복붙해서 가면

아놔 친절한척 하지 말라고 ㅋㅋㅋ 모든 암호화 된 파일을 해독 하고 조정할 수 있는 특별한! 이라니 -_-+

0.5 BTC?

[링크 : http://nabzsoftware.com/types-of-threats/locky-file]


지금 현재 환율로.. 대략 25만... ㄷㄷㄷ

[링크 : http://currency.wiki/currencytools?sum=0.5&from=BTC&to=KRW]


[링크 : https://nakedsecurity.sophos.com/2016/02/17/locky-ransomware-what-you-need-to-know/]

[링크 : http://remove-spyware.removemalwarevirus.com/삭제하는-방법-locky-extension-rsa-2048-and-aes-128-ciphers]

[링크 : http://intumyself.tistory.com/2304]

[링크 : http://blog.alyac.co.kr/539]

    [링크 : http://blog.alyac.co.kr/240]

[링크 : http://www.clien.net/cs2/bbs/board.php?bo_table=kin&wr_id=3679319]


나온지 한달 밖에 안된 따끈따끈한 망할녀석.

invoice 키워드로 워드랑 이메일로 보내, 구매 관리자는 잘 낚일 녀석..

[링크 : https://www.rancert.com/bbs/bbs.php?bbs_id=notice&mode=view&id=29]

[링크 : https://www.rancert.com/bbs/bbs.php?mode=view&id=27&bbs_id=case&page=1&part=&keyword=]

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

po지름wer!!!  (0) 2016.03.24
망할 locky... cryptowall 계열...  (0) 2016.03.17
아.. 멀 사지.. 멀 사면 행복할까?  (0) 2016.03.05
야근야근 열매  (0) 2016.03.01
힘들다 지친다..  (0) 2016.02.27
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 구차니
파일방2016. 3. 15. 10:32

라이센스가 안보이네.

구매버전도 있으니 그냥 막 쓰긴 힘들지도..


[링크 : https://www.photostitcher.com/]

'파일방' 카테고리의 다른 글

avidemux 간단한 사용법 / 리눅스가 낫네!  (0) 2016.03.28
notepad++ for linux?  (0) 2016.03.22
Avidemux & Free Video Editor  (0) 2016.03.04
스크롤 캡쳐  (0) 2016.02.15
playonlinux - 플레이온 리눅스  (0) 2016.02.02
Posted by 구차니