'embeded > ARM' 카테고리의 다른 글
| jtag/swd pullup & pulldown (0) | 2015.12.17 |
|---|---|
| jtag과 swd (0) | 2015.12.14 |
| arm9 dsp / arm11 simd instuction 비교? (0) | 2015.10.01 |
| arm11 simd instruction (0) | 2015.10.01 |
| cortex-A5/A7 (0) | 2015.09.21 |
| jtag/swd pullup & pulldown (0) | 2015.12.17 |
|---|---|
| jtag과 swd (0) | 2015.12.14 |
| arm9 dsp / arm11 simd instuction 비교? (0) | 2015.10.01 |
| arm11 simd instruction (0) | 2015.10.01 |
| cortex-A5/A7 (0) | 2015.09.21 |
이게 정말 효율적일까? 라는 의문이 새록새록
일단.. 주소 연산하려면
* 2번(혹은 << 2번)
+ 1번
3번의 연산
만약 1비트를 조작하기 위해서 저 연산을 해야 하는데...
negation 과 and 연산이면 충분한데.. 오히려 연산량이 더 필요할 지도?
stellarisware의 bitband.c 예제
#define HWREGBITW(x, b) \ HWREG(((unsigned long)(x) & 0xF0000000) | 0x02000000 | \ (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2)) for(ulIdx = 0; ulIdx < 32; ulIdx++) { HWREGBITW(&g_ulValue, 31 - ulIdx) = (0xdecafbad >> (31 - ulIdx)) & 1; PrintValue(g_ulValue); Delay(1); } |
32비트 주소체계라 4바이트 씩 띄엄띄엄 값이 들어있다.
[링크 : http://www.ti.com/lit/ds/symlink/lm3s1968.pdf]
2013/08/16 - [embeded/Cortex-M3 Ti] - bitband / cortex-m3
| axf to bin (6) | 2015.11.11 |
|---|---|
| lm3s1607 / lm3s811 비교 (0) | 2015.11.03 |
| lm3s617 stepper rdk (0) | 2015.10.13 |
| lm3s spi / ssi (0) | 2015.10.06 |
| lm3s stellarisware SPI (0) | 2015.10.05 |
balanced 모드(기본값)에서는 N/M (date / range)
When MSEN=0, which is the default mode, data to be sent is interpreted as the value N of the algorithm explained above. Number of clock cycles (range) used to send data is the value M of the algorithm. Pulses are sent within this range so that the resulting duty cycle is N/M. Channel sends its output continuously as long as data register is used, or buffer is used and it is not empty.
mark-space 모드에서는 M/S (data / range)
When MSEN=1, PWM block does not use the algorithm explained above, instead it sends serial data with the M/S ratio as in the picture below. M is the data to be sent, and S is the range. This mode may be preferred if high frequency modulation is not required or has negative effects. Channel sends its output continuously as long as data register is used, or buffer is used and it is not empty.
[링크 : http://www.farnell.com/datasheets/1521578.pdf] 139page
| clcd - bona cm04075 / lc1628 (0) | 2015.11.04 |
|---|---|
| 라즈베리 파이 CLCD 라이브러리 (0) | 2015.11.03 |
| wiringpi pwm 라이브러리 분석? (0) | 2015.10.16 |
| 라즈베리 파이 GPIO 유틸 PWM (0) | 2015.10.14 |
| DHT-11 DHT-22 RHT-03 (0) | 2015.10.14 |
데이터 시트상으로는 PWM 1과 PWM 2 채널 독립적으로
모드를 설정하여 사용이 가능해야 하나...
wiringPi에서는 편의상.. 걍 묶어 버렸다!!!!
wiringPi/wiringPi $ vi wiringPi.c
void pwmSetMode (int mode) { if ((wiringPiMode == WPI_MODE_PINS) || (wiringPiMode == WPI_MODE_PHYS) || (wiringPiMode == WPI_MODE_GPIO)) { if (mode == PWM_MODE_MS) *(pwm + PWM_CONTROL) = PWM0_ENABLE | PWM1_ENABLE | PWM0_MS_MODE | PWM1_MS_MODE ; else *(pwm + PWM_CONTROL) = PWM0_ENABLE | PWM1_ENABLE ; } } 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)) ; } } |
| 라즈베리 파이 CLCD 라이브러리 (0) | 2015.11.03 |
|---|---|
| bcm2835 pwm 데이터시트 (0) | 2015.10.16 |
| 라즈베리 파이 GPIO 유틸 PWM (0) | 2015.10.14 |
| DHT-11 DHT-22 RHT-03 (0) | 2015.10.14 |
| dSPIN_raspi / L6470 / sparkfun (0) | 2015.10.12 |
1024 로 설정되면
30 ~ 110 범위로 180도를 오가는지라 해상도가 낮아졌는데
100으로 설정하고 range를 키워주면 상당부분 해소 될듯
기존의 80/180=2.25도에서 320/180=0.56도로 4배 정도 해상도가 향상된다.
$ gpio mode 1 pwm
$ gpio pwm-ms
$ gpio pwmc 400
$ gpio pwmr 1024
$ gpio pwm 1 30
$ gpio pwm 1 70
$ gpio pwm 1 110
$ gpio pwmc 200
$ gpio pwmr 2048
$ gpio pwm 1 60
$ gpio pwm 1 140
$ gpio pwm 1 220
$ gpio pwmc 100
$ gpio pwmr 4096
$ gpio pwm 1 120
$ gpio pwm 1 280
$ gpio pwm 1 440
2015/06/22 - [개소리 왈왈/라즈베리 파이(rpi)] - 라즈베리 파이 2 PWM-MS 모드 servo 제어
| bcm2835 pwm 데이터시트 (0) | 2015.10.16 |
|---|---|
| wiringpi pwm 라이브러리 분석? (0) | 2015.10.16 |
| DHT-11 DHT-22 RHT-03 (0) | 2015.10.14 |
| dSPIN_raspi / L6470 / sparkfun (0) | 2015.10.12 |
| 라즈베리 파이 홈페이지 내용 업데이트 - pi 2b (0) | 2015.10.09 |
온도/습도 센서 인데..
검색하다 보니 차이가 있... 다?
DHT11
Ultra low cost
3 to 5V power and I/O
2.5mA max current use during conversion (while requesting data)
Good for 20-80% humidity readings with 5% accuracy
Good for 0-50°C temperature readings ±2°C accuracy
No more than 1 Hz sampling rate (once every second)
Body size 15.5mm x 12mm x 5.5mm
4 pins with 0.1" spacing
DHT22
Low cost
3 to 5V power and I/O
2.5mA max current use during conversion (while requesting data)
Good for 0-100% humidity readings with 2-5% accuracy
Good for -40 to 125°C temperature readings ±0.5°C accuracy
No more than 0.5 Hz sampling rate (once every 2 seconds)
Body size 15.1mm x 25mm x 7.7mm
4 pins with 0.1" spacing
[링크 : https://learn.adafruit.com/dht/overview]
[링크 : http://cdn.sparkfun.com/datasheets/Sensors/Weather/RHT03.pdf]
RHT03 (also known by DHT-22)
[링크 : https://www.sparkfun.com/products/10167]
AM2302가 DHT22 대응인 듯
그냥 .. DHT11만 보더라도 상당히 불안정하게 값이 읽혀온다.
[링크 : http://www.kandrsmith.org/RJS/Misc/calib_dht22_dht11_sht71.html] 벤치마크?
아무튼.. DHT-11은 저가형에 정밀하지 못한 녀석
DHT-22/RHT03은 정밀한 녀석으로 결론...
| wiringpi pwm 라이브러리 분석? (0) | 2015.10.16 |
|---|---|
| 라즈베리 파이 GPIO 유틸 PWM (0) | 2015.10.14 |
| dSPIN_raspi / L6470 / sparkfun (0) | 2015.10.12 |
| 라즈베리 파이 홈페이지 내용 업데이트 - pi 2b (0) | 2015.10.09 |
| openCV 3.0.0 on 라즈베리 파이 2 (0) | 2015.10.06 |
lm3s617외에 같은 클래스에서도 동일한 녀석으로 쓸수 있으려나?
코드를 보니.. 메인을 장악해버려서 다른 프로그램의 하위 시스템으로 넣기에는 엄청난 수정이 필요 할지도..
[링크 : http://www.ti.com/lit/ug/spmu026a/spmu026a.pdf] Stellaris® Stepper Motor Reference Design Kit
[링크 : http://www.ti.com/lit/ds/symlink/lm3s617.pdf] LM3S617
[링크 : http://www.ti.com/product/LM3S617/description]
| lm3s1607 / lm3s811 비교 (0) | 2015.11.03 |
|---|---|
| bitband 고찰.. (0) | 2015.10.23 |
| lm3s spi / ssi (0) | 2015.10.06 |
| lm3s stellarisware SPI (0) | 2015.10.05 |
| cortex-m3 ROM direct call (0) | 2015.09.25 |
sparkfun의 아두이노용 드라이버를 라즈베리 파이/wiring pi로 포팅한 버전
[링크 : https://github.com/blerchin/dSPIN_raspi]
[링크 : https://github.com/sparkfun/L6470-AutoDriver/]
몰랐는데...
wiringpi가 아두이노를 닮은건가.. 그 반대일려나?
함수가 상당수 호환된다?
아두이노가.. 2005년 wiring 이라는 보드로 시작해서..
거기껄 끌어 온거니.. wiringpi가 더 나중일 것으로 생각된다.
---
void digitalWrite (int pin, int value) ;
[링크 : http://wiringpi.com/reference/core-functions/]
digitalWrite(pin, value)
| 라즈베리 파이 GPIO 유틸 PWM (0) | 2015.10.14 |
|---|---|
| DHT-11 DHT-22 RHT-03 (0) | 2015.10.14 |
| 라즈베리 파이 홈페이지 내용 업데이트 - pi 2b (0) | 2015.10.09 |
| openCV 3.0.0 on 라즈베리 파이 2 (0) | 2015.10.06 |
| opencv 템플릿 매칭 / wiring pi PWM ing.. (0) | 2015.10.05 |
드디어!!! 라즈베리 2B용 데이터 시트가 올라왔구나!!!
(근데 봐도 쓸데는 없....)
[링크 : https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2836/README.md]
| DHT-11 DHT-22 RHT-03 (0) | 2015.10.14 |
|---|---|
| dSPIN_raspi / L6470 / sparkfun (0) | 2015.10.12 |
| openCV 3.0.0 on 라즈베리 파이 2 (0) | 2015.10.06 |
| opencv 템플릿 매칭 / wiring pi PWM ing.. (0) | 2015.10.05 |
| webiopi - rpi IoT (2) | 2015.10.01 |
Freescale(구 motorola) / Ti / Microwire(구 National Semiconductor) 포맷?
[링크 : https://engineering.purdue.edu/.../LM4F-LaunchPad-11%20-%20SPI.pdf]
The interface was developed by Motorola and has become a de facto standard.
SCLK : Serial Clock (output from master).
MOSI : Master Output, Slave Input (output from master).
MISO : Master Input, Slave Output (output from slave).
SS : Slave Select (active low, output from master).
SCLK : SCK, CLK.
MOSI : SIMO, SDI(for slave devices), DI, DIN, SI, MTST.
MISO : SOMI, SDO (for slave devices ), DO, DOUT, SO, MRSR.
SS : nCS, CS, CSB, CSN, EN, nSS, STE, SYNC.
[링크 : https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus]
[링크 : http://irmus.tistory.com/61]
| bitband 고찰.. (0) | 2015.10.23 |
|---|---|
| lm3s617 stepper rdk (0) | 2015.10.13 |
| lm3s stellarisware SPI (0) | 2015.10.05 |
| cortex-m3 ROM direct call (0) | 2015.09.25 |
| LM3S Stellarisware - GPIOIntTypeSet (0) | 2015.08.03 |