5277 (5277) wrote,
5277
5277

core5277, примеры использования

Просто пара примеров задач.

Прример 1:
SIM_LEDS_INIT:
    LDI TEMP_H,PORTC
    LDI TEMP_L,(1<<PC1)
    CALL CORE5277_PORTS__MODE_OUT
    CALL CORE5277_PORTS__SET_LO
    CALL CORE5277_TASK_READY
;--------------------------------------------------------
SIMS_LEDS_INFINITE_LOOP:
    RCALL CORE5277_PORTS__SET_HI
    LDI TEMP,1
    CALL CORE5277_TASK_WAIT_1S

    RCALL CORE5277_PORTS__SET_LO
    LDI TEMP,1
    CALL CORE5277_TASK_WAIT_1S
    RJMP SIMS_LEDS_INFINITE_LOOP

Пример 2:
TEMPERATURE_INIT:
    CALL CORE5277_TASK_READY
;--------------------------------------------------------
    MOV TEMP,TASK_ID
    RCALL CORE5277_VARS_GET_OFFSET
    MOV YH,ZH
    MOV YL,ZL
;--------------------------------------------------------
TEMPERATURE_INFINITE_LOOP:
    LDI TEMP,1
    CALL CORE5277_TASK_WAIT_1S

    LDI TEMP,TID_DS18B20_DRV
    CALL CORE5277_DRIVER_EXEC
    CPI TEMP_L,0xff
    BRNE TEMPERATURE_NO_T_ERROR
   LOG_MARK_R 'E',TEMP_H,TEMP_L
    RJMP TEMPERATURE_INFINITE_LOOP
TEMPERATURE_NO_T_ERROR:
    CALL CORE5277_CONV__SDNF_TO_STR
    CALL CORE5277_LOG
    RJMP TEMPERATURE_INFINITE_LOOP


Обе задачи выполняются, в основном, независимо.
Tags: core5277, примеры использования
Subscribe
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments