embeded/ARM2015. 7. 28. 17:53

CPU 패밀리(?)는 EJ

아키텍쳐는 TE


ARM926EJ-S

Architecture ARMv5TE

The ARM926EJ-S processor implements the ARMv5TEJ instruction set 

[링크 : http://www.arm.com/products/processors/classic/arm9/arm926.php]

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


근데 ARM 홈페이지에서도 페이지 별로 ARMv5TE와 ARMv5TEJ 를 섞어 쓰는건 함정.. ㄷㄷㄷ



TEJ라는 녀석도 구글에서 검색은 되는데 레퍼런스로 쓸만한건 안보이는 듯..


Integrated Modem + Applications

OMAP710 ‐ ARM925 + GSM/GPRS

OMAP730 ‐ ARM926TEJ + GSM/GPRS

OMAP733 ‐ ARM926TEJ + GSM/GPRS

OMAP750 ‐ ARM926TEJ + GSM/GPRS

OMAP850 ‐ ARM926TEJ + EDGE

OMAPV1030 ‐ ARM926TEJ + GSM/GPRS/EDGE

OMAPV1035 ‐ ARM926EJ + GSM/GPRS/EDGE

[링크 : http://www.wdic.org/w/WDIC/OMAP]

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

cortex-A5/A7  (0) 2015.09.21
cortex-m 시리즈와 포화연산  (0) 2015.08.26
Jazelle 관련 검색  (0) 2015.04.28
ltib 패키지 요구사항  (0) 2015.04.13
jffs2 on sd card  (0) 2015.04.09
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2015. 7. 28. 14:40

ㄷㄷㄷ 한번 돌려볼까?


Can I use C++ on the AVR?

Basically yes, C++ is supported (assuming your compiler has been configured and compiled to support it, of course). Source files ending in .cc, .cpp or .C will automatically cause the compiler frontend to invoke the C++ compiler. Alternatively, the C++ compiler could be explicitly called by the name avr-c++.

However, there's currently no support for libstdc++, the standard support library needed for a complete C++ implementation. This imposes a number of restrictions on the C++ programs that can be compiled. Among them are:

Obviously, none of the C++ related standard functions, classes, and template classes are available.

The operators new and delete are not implemented, attempting to use them will cause the linker to complain about undefined external references. (This could perhaps be fixed.)

Some of the supplied include files are not C++ safe, i. e. they need to be wrapped into

extern"C" { . . . } 

(This could certainly be fixed, too.)

Exceptions are not supported. Since exceptions are enabled by default in the C++ frontend, they explicitly need to be turned off using -fno-exceptions in the compiler options. Failing this, the linker will complain about an undefined external reference to __gxx_personality_sj0.

Constructors and destructors are supported though, including global ones.

When programming C++ in space- and runtime-sensitive environments like microcontrollers, extra care should be taken to avoid unwanted side effects of the C++ calling conventions like implied copy constructors that could be called upon function invocation etc. These things could easily add up into a considerable amount of time and program memory wasted. Thus, casual inspection of the generated assembler code (using the -S compiler option) seems to be warranted.


[링크 : http://www.atmel.com/webdoc/AVRLibcReferenceManual/FAQ_1faq_cplusplus.html]


AVR용 STL ㄷㄷㄷ

[링크 : http://andybrown.me.uk/wk/2011/01/15/the-standard-template-library-stl-for-avr-with-c-streams/]

Posted by 구차니
embeded/AVR (ATmega,ATtiny)2015. 7. 19. 22:25

어드레스 맵 구조 까지 나오는 예제가 있으면 좋으련만...

그나저나 SDA, SCL에 풀업을 꼭 달으라네..


[링크 : http://electronicsdo.tistory.com/entry/I2C-The-I2C-of-ATmega128]

SCL 과 SDA 단자는 오픈 콜렉터 또는 오픈 드레인 방식으로 되어 있어 Wired-AND 기능을 합니다. 이 단자는 외부에 풀업 저항(수 K 오옴) 을 연결해 주어야 합니다.

[링크 : http://cafe.daum.net/_c21_/bbs_search_read?grpid=lH2L&fldid=GSYT&datanum=85]


SDA,SCL핀에 풀업저항을 꼭 달아줍니다.

[링크 : http://openctrl.tistory.com/entry/I2C-TWI]


자체 Pull-Up 저항은

30-50kΩ 정도로 저항치가 좀 높은 편이라서, 실제로 Data 와 Clock 라인에는

4.7kΩ 정도로 따로 Pull-Up 저항을 걸어두는 편이 좋습니다.

[링크 : http://egloos.zum.com/bellona/v/1345440]

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

USART UBRR error rate  (0) 2015.07.29
avr-libc 8bit AVR C++  (0) 2015.07.28
atmega128 gpio 인터럽트 데이터시트 내용  (0) 2015.07.18
AVR Studio / AVRdude 연동  (0) 2015.03.12
AVRISP 호환 제품 ?  (0) 2015.03.11
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2015. 7. 18. 22:29


PE4/PE5 는 Output Compate (OC3)

PE6은 Timer/counter 3 clk input(T3)

PE7은 Input Capture (IC)

PD쪽은.. 통신을 쓰면 4개 선을 쓰지 못하니

실질적으로 사용가능한 falling edge / rising edge 탐지는 2개 정도 일려나?


결론은.. 핀하나하나 while로 감지 하지 않으려면...

tie-up해서 잡는 수 밖에 없을 것으로 보이네..






External Interrupts

The External Interrupts are triggered by the INT7:0 pins. Observe that, if enabled, the interrupts will trigger even if the INT7:0 pins are configured as outputs. This feature provides a way of generating a software interrupt. The External Interrupts can be triggered by a falling or rising edge or a low level. This is set up as indicated in the specification for the External Interrupt Control Registers – EICRA (INT3:0) and EICRB (INT7:4). When the external interrupt is enabled and is configured as level triggered, the interrupt will trigger as long as the pin is held low. Note that recognition of falling or rising edge interrupts on INT7:4 requires the presence of an I/O clock, described in “Clock Systems and their Distribution” on page 35. Low level interrupts and the edge interrupt on INT3:0 are detected asynchronously. This implies that these interrupts can be used for waking the part also from sleep modes other than Idle mode. The I/O clock is halted in all sleep modes except Idle mode. Note that if a level triggered interrupt is used for wake-up from Power-down mode, the changed level must be held for some time to wake up the MCU. This makes the MCU less sensitive to noise. The changed level is sampled twice by the Watchdog Oscillator clock. The period of the Watchdog Oscillator is 1µs (nominal) at 5.0V and 25°C. The frequency of the Watchdog Oscillator is voltage dependent as shown in the “Electrical Characteristics” on page 318. The MCU will wake up if the input has the required level during this sampling or if it is held until the end of the start-up time. The start-up time is defined by the SUT fuses as described in “Clock Systems and their Distribution” on page 35. If the level is sampled twice by the Watchdog Oscillator clock but disappears before the end of the start-up time, the MCU will still wake up, but no interrupt will be generated. The required level must be held long enough for the MCU to complete the wake up to trigger the level interrupt.


EICRA와 EICRB는 조금 다르게 설명이 적혀있으니 자세히 읽어 봐야 할 듯..

[링크 : http://www.atmel.com/images/doc2467.pdf]

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

avr-libc 8bit AVR C++  (0) 2015.07.28
avr twi / i2c 예제 및 풀업관련  (0) 2015.07.19
AVR Studio / AVRdude 연동  (0) 2015.03.12
AVRISP 호환 제품 ?  (0) 2015.03.11
SED1520 데이터시트 / Page, Line, Column  (0) 2014.03.27
Posted by 구차니
embeded/raspberry pi2015. 7. 18. 22:16

초음파 관련 루틴을 while로 처리해서

오차가 있을것으로 생각되다 보니..

인터럽트 처리방식 검색...


gpio 유틸에도 존재는 한다.

gpio edge <pin> rising/falling/both/none

This enables the given pin for edge interrupt triggering on the rising, falling or both edges. (Or none which disables it)

[링크 : http://wiringpi.com/the-gpio-utility/] 


python 버전

GPIO.add_event_detect(17, GPIO.FALLING, callback=my_callback, bouncetime=300)  GPIO.add_event_detect(23, GPIO.FALLING, callback=my_callback2, bouncetime=300)  

[링크 : http://raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-gpio-part-3] 


c 버전

void myInterrupt(void) {

   eventCounter++;

}


int main(void) {

  if (wiringPiSetup () < 0) {

      fprintf (stderr, "Unable to setup wiringPi: %s\n", strerror (errno));

      return 1;

  }


  // set Pin 17/0 generate an interrupt on high-to-low transitions

  // and attach myInterrupt() to the interrupt

  if ( wiringPiISR (BUTTON_PIN, INT_EDGE_FALLING, &myInterrupt) < 0 ) {

      fprintf (stderr, "Unable to setup ISR: %s\n", strerror (errno));

      return 1;

  }


  // display counter value every second.

  while ( 1 ) {

    printf( "%d\n", eventCounter );

    eventCounter = 0;

    delay( 1000 ); // wait 1 second

  }


  return 0;

}

[링크 : http://cs.smith.edu/dftwiki/index.php/Tutorial:_Interrupt-Driven_Event-Counter_on_the_Raspberry_Pi] 



Posted by 구차니
embeded/raspberry pi2015. 7. 17. 10:52

전에 쓴적이 있던가?

아무튼.. 지금글을 보고 있노라니..

국제화 관련 설정에서

gb가 기본값이었던거 같은데..

영국에서 만든게 왜...중국이 기본값이 된걸까?

+

2017.09.12

gb는 영국임. Great Britain



키보드 레이아웃은 집에가서 테스트 해봐야지 ..



[링크 : http://raspberrypi.stackexchange.com/questions/1042/why-is-my-symbol-not-working]


~!@#$%^&*()_+| 를 입력한 화면 확실히 먼가 이상하게 나온다.

프랑이라던가? 이.. 미묘한 기호순서라니!

XKBLAYOUT을 gb에서 us로 바꾸고

pi@raspberrypi ~ $ sudo cat /etc/default/keyboard

# KEYBOARD CONFIGURATION FILE


# Consult the keyboard(5) manual page.


XKBMODEL="pc105"

XKBLAYOUT="gb"

XKBVARIANT=""

XKBOPTIONS=""


BACKSPACE="guess" 


setupcon을 해주면 빠르게 설정이 된다는데 ssh나 터미널로는 안된다

pi@raspberrypi ~ $ sudo setupcon

We are not on the console, the console is left unconfigured. 


pi@raspberrypi ~ $ sudo service lightdm stop

ctrl -alt - f1

pi@raspberrypi ~ $ sudo setupcon


아무튼 리부팅 하고 오니

~!@#$%^&*()_+| 

원하는대로 잘 나온다.



Posted by 구차니
embeded/raspberry pi2015. 7. 13. 23:44

음.. 막상해보려니 125KHz 카드가 없다...

신용카드의 교통카드는.. 125KHz가 아니라 무리려나?

나중에 다른 카드 생기면 해봐야 할 듯.. ㅠㅠ


Voltage: 4.75-5.25V

Working Frequency: 125 KHz

Sensing Distance(Max): 70mm

TTL Output: 9600 baudrate, 8 data bits, 1 stop bit, and no verify bit

Wiegand Output: 26 bits Wiegand format, 1 even verify bit, 24 data bits, and 1 odd verify bit

[링크 : http://www.seeedstudio.com/wiki/Grove_-_125KHz_RFID_Reader] 


125Khz  EM카드

저렴하고 광범위하게 사용되고 있는카드


13.56Mhz MF카드

카드의 데이터값을 수정할 수 있으며

교통카드가 대표적인 MF카드임.

[링크 : http://korearfidtag.com/] 


+

2015.07.14

9600bps로 UART 모드 설정시 그냥 읽히는데..

putty 특성상 출력 안되는건 패스하니까 log로 분석


위는 카드에 써있는 숫자

아래는 읽힌 데이터

일치하진 않네...


인식해서 날아오는데 까지 약 1초 정도 소요되는 듯.



카드에 기재된 거랑 동일하게 읽히진 않네...



Posted by 구차니
embeded/raspberry pi2015. 7. 13. 23:27

릴레이는 단순하게 HI/LO 입력에 따라 on/off 스위치라 별거 없으니 대충~

당연히(!) 귀차니즘으로 wiring pi 기준 1번 / GPIO18번에 연결


$ gpio mode 1 output

$ gpio write 1 1


$ gpio write 1 0



[링크 : http://www.seeedstudio.com/depot/Grove-Relay-p-769.html]

Posted by 구차니
embeded/raspberry pi2015. 7. 13. 23:14

3.3-5V 이나 5V추천

탐지거리 3cm-4m

[링크 : http://www.seeedstudio.com/depot/Grove-Ultrasonic-Ranger-p-960.html]


다른 소스들의 예제와 다르게 이녀석...

Trigger / Echo가 아닌 Signal 하나 뿐이다


그래서 Trigger로 output 모드 설정후 전송하고 재빠르게

Echo로 input 모드로 설정후 받아 시간을 재도록 수정해야 한다.


포트는 만만한(?) GPIO18번 PWM 포트(wiring pi 기준 1번)으로 설정

흰색 - 5V

검정 - GND

보라 - GPIO18 ->A0




$ cat ultrasonic_1.py

#!/usr/bin/python

#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

#|R|a|s|p|b|e|r|r|y|P|i|-|S|p|y|.|c|o|.|u|k|

#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

#

# ultrasonic_1.py

# Measure distance using an ultrasonic module

#

# Author : Matt Hawkins

# Date   : 09/01/2013

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


# Import required Python libraries

import time

import RPi.GPIO as GPIO


# Use BCM GPIO references

# instead of physical pin numbers

GPIO.setmode(GPIO.BCM)


# Define GPIO to use on Pi

GPIO_TRIGGER = 18

GPIO_ECHO    = 18


print "Ultrasonic Measurement"


# Set pins as output and input

GPIO.setup(GPIO_TRIGGER,GPIO.OUT)  # Trigger


# Set trigger to False (Low)

GPIO.output(GPIO_TRIGGER, False)


# Allow module to settle

time.sleep(0.5)


# Send 10us pulse to trigger

GPIO.output(GPIO_TRIGGER, True)

time.sleep(0.00001)

GPIO.output(GPIO_TRIGGER, False)

start = time.time()


GPIO.setup(GPIO_ECHO,GPIO.IN)      # Echo

while GPIO.input(GPIO_ECHO)==0:

  start = time.time()


while GPIO.input(GPIO_ECHO)==1:

  stop = time.time()


# Calculate pulse length

elapsed = stop-start


# Distance pulse travelled in that time is time

# multiplied by the speed of sound (cm/s)

distance = elapsed * 34300


# That was the distance there and back so halve the value

distance = distance / 2


print "Distance : %.1f" % distance


# Reset GPIO settings

GPIO.cleanup() 


자가 없어서 대충 한뼘(21cm)로 해봤는데 얼추 맞는 기분

pi@raspberrypi ~/src/sonic $ sudo python ultrasonic_1.py

Ultrasonic Measurement

Distance : 154.8

pi@raspberrypi ~/src/sonic $ sudo python ultrasonic_1.py

Ultrasonic Measurement

Distance : 3.0

pi@raspberrypi ~/src/sonic $ sudo python ultrasonic_1.py

Ultrasonic Measurement

Distance : 9.1

pi@raspberrypi ~/src/sonic $ sudo python ultrasonic_1.py

Ultrasonic Measurement

Distance : 26.3 


대충 소스 받아서 수정

[링크 : http://www.raspberrypi-spy.co.uk/2012/12/ultrasonic-distance-measurement-using-python-part-1/]

Posted by 구차니
embeded/raspberry pi2015. 7. 7. 06:54

그냥 쏘고 받고

그 시간 간격재고 끝인가? 굳이.. 몇개의 파형을 안보내는 되는 걸려나..


[링크 : http://www.modmypi.com/blog/hc-sr04-ultrasonic-range-sensor-on-the-raspberry-pi]

[링크 : http://www.raspberrypi-spy.co.uk/2012/12/ultrasonic-distance-measurement-using-python-part-1/]

Posted by 구차니