embeded/Cortex-M3 Ti2017. 4. 4. 11:41

이걸 샀는데 헉.. 2.54mm 간격이 아니네?!?!

아무튼.. 얘는 Serial Wire Debugger라.. JTAG 핀을 제공하지 않는다.

[링크 : http://www.devicemart.co.kr/1320869]


그림판으로 장난질.

SWD는 SWC SWD SWO 세개 이고

JTAG은 TCK TMS TDI TDO 인데

TDI를 제외한 3개의 핀은 연결이 가능한 듯 하다


데이터시트상 핀 배열은 이런데.. 

핀설명은 아래와 같음

+

[링크 : http://forum.falinux.com/zbxe/?document_srl=796669...readed_count]


+

실험을 해보니 다 필요 없고..

최소사양(?)인 SWCLK +SWDIO(I/O) 딱 두줄이면 끝..

지금까지 JTAG으로 쓴 줄 알았는데 SWD로 쓰고 있었다는거에 한번 더 깜놀..

'embeded > Cortex-M3 Ti' 카테고리의 다른 글

keil sct - 링커 스크립트  (0) 2017.12.11
lm3s 부트로더  (0) 2017.11.21
어? 의외로 RX busy는 없네?  (0) 2017.03.27
lm3s1607 uart pull up 문제  (0) 2017.03.24
ti cortex-m3 driverlib - UARTConfigSetExpClk()  (0) 2017.03.23
Posted by 구차니
embeded/80512017. 3. 27. 15:02


클래식이던 확장이던 IDATA와 DATA는 존재하는데

DATA와  IDATA의 차이에 대해서 keil 사이트에 설명이 모호한데

direct와 indirect의 차이로 설명이 된다. 근데.. 감이 안오는데....


IDATA

This memory is indirectly accessed using 8-bit addresses and is the on-chip RAM of the 8051.


DATA

This memory is directly accessed using 8-bit addresses and is the on-chip RAM of the 8051.

[링크 : http://www.keil.com/support/man/docs/c51/c51_le_memtypes.htm]

    [링크 : http://www.keil.com/support/man/docs/c51/c51_le_data.htm] DATA

    [링크 : http://www.keil.com/support/man/docs/c51/c51_le_idata.htm] IDATA


어라..? IDATA accessed with @R0 or @R1

레지스터에 값을 저장하고 그 값을 통해 간접 접근을 하는 거군?


[링크 : http://measure.feld.cvut.cz/.../A51___Keil_Macro_Assembler_and_Utilities.pdf]

Posted by 구차니
embeded/Cortex-M3 Ti2017. 3. 27. 10:52

UART Flag에 BUSY는

어라? 전송에 대한 것?

UART Busy
When this bit is 1, the UART is busy transmitting data. This bit remains set until the complete byte, including all stop bits, has been sent from the shift register. This bit is set as soon as the transmit FIFO becomes non-empty (regardless of whether UART is enabled).
  




'embeded > Cortex-M3 Ti' 카테고리의 다른 글

lm3s 부트로더  (0) 2017.11.21
JTAG / SWD 핀 연결방법 조사..  (0) 2017.04.04
lm3s1607 uart pull up 문제  (0) 2017.03.24
ti cortex-m3 driverlib - UARTConfigSetExpClk()  (0) 2017.03.23
lm3s1607 uart baudrate runtime change  (0) 2017.03.15
Posted by 구차니
embeded/raspberry pi2017. 3. 25. 15:36

라즈베리 완전체(?) 햇을 만들려고 하다가 망했어 ㅠㅠ


점퍼 연결해서 쓰기 귀찮아서

대충 만능보드 이용해서 만들려고 하다가 또 실패인가...

아무튼 DHT-11은 노릇노릇하게 익어버렸고

머가 문제인지 멘붕..

다행히도 라즈베리 쪽은 손상이 없는거 같긴한데

가속도 센서 / 초음파 거리 센서는 살아있는지 확인을 해야 할 듯 ㅠㅠ




DHT-11 센서 분해하니 안쪽에 이런식으로 온도/습도 센서 부분이 있고

여기를 자세히 보면 강우 센서가 아주 미세한 모양을 한것 처럼 중앙 부분에 있다.


뒤에는 하나도 안써있어서 무슨 칩인지 알수 없으나.. 마이컴이 아닐까 생각된다.


태워먹고는 멘붕와서 만든 보드도 확 버려 버릴까 고민 ㅠㅠ

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

레트로 파이.. 준비(?)  (0) 2017.08.07
rpi pwm markspace balanced mode waveform  (0) 2017.06.29
라즈베리 파이 포트 요약  (0) 2017.03.25
라즈베리 파이 gpio sysfs  (0) 2017.02.15
라즈베리 파이 + 태양전지!  (0) 2017.01.25
Posted by 구차니
embeded/raspberry pi2017. 3. 25. 13:11

예전에 iot로 검색해서 보다 보니 귀찮고 헷갈려서 다시 정리

PWM은 2개 포트뿐이니.. 동시에 두개가 한계겠네..




rpi.pdf


Posted by 구차니
embeded/Cortex-M3 Ti2017. 3. 24. 10:58

얘랑은 좀 다른 이야기인데...

rs232 to rs485로 쓰다 보니

485쪽은 TXEN 하면 RX쪽이 Hi-Z로 설정되면서

아마도 0x00으로 들어 오는 듯?


그리고 driverlib에도 RX만 disable 시키는 건 없으니

함수를 하나 만들어서 RX만 disable enable을 시켜서 일단 우회

void

UARTDisable(uint32_t ui32Base)

{

    //

    // Check the arguments.

    //

    ASSERT(_UARTBaseValid(ui32Base));


    //

    // Wait for end of TX.

    //

    while(HWREG(ui32Base + UART_O_FR) & UART_FR_BUSY)

    {

    }


    //

    // Disable the FIFO.

    //

    HWREG(ui32Base + UART_O_LCRH) &= ~(UART_LCRH_FEN);


    //

    // Disable the UART.

    //

    HWREG(ui32Base + UART_O_CTL) &= ~(UART_CTL_UARTEN | UART_CTL_TXE |

                                      UART_CTL_RXE);


일단 정석(?)적인 해결책은 RX에 pull-up을 달아 주는 것

[링크 : https://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/45318]


OD나 PUD 안먹더라니, 직원이 push-pull로 작동한다고 하면 그런거겠지? ㅠㅠ

[링크 : https://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/88669]



9.2.2.27 GPIOPinTypeUART

Configures pin(s) for use by the UART peripheral.

Prototype:

void

GPIOPinTypeUART(unsigned long ulPort,

unsigned char ucPins)

Parameters:

ulPort is the base address of the GPIO port.

ucPins is the bit-packed representation of the pin(s).

Description:

The UART pins must be properly configured for the UART peripheral to function correctly. This

function provides a typical configuration for those pin(s); other configurations may work as well

depending upon the board setup (for example, using the on-chip pull-ups).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to

be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO

port pin 1, and so on.

Note:

This cannot be used to turn any pin into a UART pin; it only configures a UART pin for proper

operation. 


Posted by 구차니
embeded/Cortex-M3 Ti2017. 3. 23. 14:21

uart의 baudrate를 설정해주는 녀석은

내부적으로 UARTDisable()과 UARTEnable()을 포함하는데

UARTEnable()은 fifo enable을 포함한다.(얘가 악의 축)


그리고 UARTDisable()은 TX 할게 있으면 다 보낼때 까지 기다려주는 역활을 한다.



void

UARTConfigSetExpClk(uint32_t ui32Base, uint32_t ui32UARTClk,

                    uint32_t ui32Baud, uint32_t ui32Config)

{

    // Stop the UART.

    UARTDisable(ui32Base);


    // Set the baud rate.

    HWREG(ui32Base + UART_O_IBRD) = ui32Div / 64;

    HWREG(ui32Base + UART_O_FBRD) = ui32Div % 64;


    // Set parity, data length, and number of stop bits.

    HWREG(ui32Base + UART_O_LCRH) = ui32Config;


    // Clear the flags register.

    HWREG(ui32Base + UART_O_FR) = 0;


    // Start the UART.

    UARTEnable(ui32Base);


void

UARTEnable(uint32_t ui32Base)

{

    //

    // Check the arguments.

    //

    ASSERT(_UARTBaseValid(ui32Base));


    //

    // Enable the FIFO.

    //

    HWREG(ui32Base + UART_O_LCRH) |= UART_LCRH_FEN;


    //

    // Enable RX, TX, and the UART.

    //

    HWREG(ui32Base + UART_O_CTL) |= (UART_CTL_UARTEN | UART_CTL_TXE |

                                     UART_CTL_RXE);

}


void
UARTDisable(uint32_t ui32Base)
{
    //
    // Check the arguments.
    //
    ASSERT(_UARTBaseValid(ui32Base));

    //
    // Wait for end of TX.
    //
    while(HWREG(ui32Base + UART_O_FR) & UART_FR_BUSY)
    {
    }

    //
    // Disable the FIFO.
    //
    HWREG(ui32Base + UART_O_LCRH) &= ~(UART_LCRH_FEN);

    //
    // Disable the UART.
    //
    HWREG(ui32Base + UART_O_CTL) &= ~(UART_CTL_UARTEN | UART_CTL_TXE |
                                      UART_CTL_RXE);
}



근데 도대체!!! 뒤에 0x00은 왜 붙는거야?

Posted by 구차니
embeded/Cortex-M3 Ti2017. 3. 15. 10:07

테스트 코드

19200bps와 38400bps를 오가면서 1바이트씩 보내는 예제


  SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);

GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);


while(1)

{

UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 19200, UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE);

UARTCharPut(UART1_BASE,'A');

MDINDLY_mSec(100);

UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 38400, UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE);

UARTCharPut(UART1_BASE,'B');

MDINDLY_mSec(100);

}



근데 도대체.. 예전에는 왜 안되었던 거지??


+

추가로

FIFO 설정은 UARTConfigSetExpClk 에서 무조건 Enable 시키니 주의

Posted by 구차니
embeded/AVR (ATmega,ATtiny)2017. 2. 17. 20:11

gcc 에서는 설정이 존재하는데

영 찾아도 설정이 안보이네


[링크 : http://www.avrfreaks.net/forum/bootloader-atmega168-using-iar-compiler]


-h 옵션은 XLINK 라는 녀석에게 먹이는건데 도대체 어떻게 주는거야...

[링크 : http://www.atmel.com/Images/doc1079.pdf]

[링크 : http://supp.iar.com/FilesPublic/UPDINFO/005316/xlink.ENU.pdf]



+

_..X_FLASH_BASE 는 링커에서 넘겨주는 것 같은데

아무튼. 이 값을 기준으로 (문제는 0x000 이라는거지만) 세그먼트들의 위치가 정해지는데

문제는

-h(CODE)0-(_..X_INTVEC_SIZE-1) 

를 통해서 0x000 으로 부터 정렬하도록 되어 있어서

?FILL1 세그먼트가 생겨난다는거.. 그래서 홀로 떵그러니 0x0000 에서 존재하는데 문제가 안되려나...

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

avr bod(Brown out Detect)  (0) 2017.08.11
avr pwm 관련  (0) 2017.04.19
avr hex start addres 다시 설정이 가능할까?  (0) 2017.02.12
우리로봇기술 사이트 폐쇄  (0) 2016.08.24
avr iar __flash winavr PROGMEM  (0) 2016.07.06
Posted by 구차니
embeded/raspberry pi2017. 2. 15. 20:30

근데.. gpio 포트번호는 어떻게 매칭이 되는거지?


export에 값을 주어야 노드가 생성된다.

$ echo 11 > /sys/class/gpio/export 

$ echo out > /sys/class/gpio/gpio11/direction

$ echo 1 > /sys/class/gpio/gpio11/value

$ echo 0 > /sys/class/gpio/gpio11/value


$ echo 11 > /sys/class/gpio/unexport  

[링크 : https://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpio]

[링크 : https://www.kernel.org/doc/Documentation/gpio/sysfs.txt]


[링크 : http://elinux.org/RPi_GPIO_Code_Samples]

Posted by 구차니