реклама на сайте
подробности

 
 
> Mega1281. Адресация памяти.
adc
сообщение Jun 8 2008, 06:10
Сообщение #1


Местный
***

Группа: Свой
Сообщений: 409
Регистрация: 29-10-07
Пользователь №: 31 836



Ув. форумчане прошу помочь с вопросом: Почему в даташите на M1281 инициализация вачдоктаймера выглядит так:
Код
WDT_off:
; Turn off global interrupt
cli
; Reset Watchdog Timer
wdr
; Clear WDRF in MCUSR
in r16, MCUSR
andi r16, (0xff & (0<<WDRF))
out MCUSR, r16
; Write logical one to WDCE and WDE
; Keep old prescaler setting to prevent unintentional time-out
in r16, WDTCSR
ori r16, (1<<WDCE) | (1<<WDE)
out WDTCSR, r16
; Turn off WDT
ldi r16, (0<<WDE)
out WDTCSR, r16
; Turn on global interrupt
sei
ret

А студия ругается на операнды в команде "out"?
Код
(614): error: Operand 1 out of range: 0x60


--------------------
Умный программист пишет тупым кодом гениальные вещи, а не наоборот...
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
aesok
сообщение Jun 8 2008, 07:50
Сообщение #2


Знающий
****

Группа: Участник
Сообщений: 596
Регистрация: 26-05-06
Из: Москва
Пользователь №: 17 484



В даташите есть такая глава:
Цитата
5. About Code Examples
This documentation contains simple code examples that briefly show how to use various parts of
the device. Be aware that not all C compiler vendors include bit definitions in the header files
and interrupt handling in C is compiler dependent. Please confirm with the C compiler documentation
for more details.
These code examples assume that the part specific header file is included before compilation.
For I/O registers located in extended I/O map, "IN", "OUT", "SBIS", "SBIC", "CBI", and "SBI"
instructions must be replaced with instructions that allow access to extended I/O. Typically
"LDS" and "STS" combined with "SBRS", "SBRC", "SBR", and "CBR".


Анатолий.
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 21st August 2025 - 04:05
Рейтинг@Mail.ru


Страница сгенерированна за 0.01363 секунд с 7
ELECTRONIX ©2004-2016