Помощь - Поиск - Пользователи - Календарь
Полная версия этой страницы: Выставить SPIX2 на MEGA16
Форум разработчиков электроники ELECTRONIX.ru > Микроконтроллеры (MCs) > AVR
Склихасовский
Ребята че я не правильно сделал?
хоть ты тресни SPI2x бит как был нуль так и остался...
Код
    LDI        TEMP,(1<<SPIE)|(1<<SPE)|(0<<DORD)|(1<<MSTR)|(0<<CPOL)|(0<<CPHA)|(0<<SPR1)|(0<<SPR0)
    OUT        SPCR,TEMP
    SBI        SPSR,SPI2X

Наблюдаю через JTAG iCE..
aaarrr
А если OUT'ом записать? И, главное, на скорости-то эффект есть?
defunct
может дело в этом?

Цитата
If SS is an input and is driven low
when the SPI is in Master mode, this will also set the SPIF flag. SPIF is cleared by hardware
when executing the corresponding interrupt handling vector.

Попробуйте переключить SS на вывод
alkaes
Все нормално. Просто JTAG не показывает все регистры.
Взято из хелпа АВР Студио:
Цитата
Accessing IO Registers
Some registers cannot be read without affecting the state of the microprocessor. The changed state could be caused by setting or clearing status bits, or destroying the contents of the register. In this case, reading out the contents would result that further emulation of the device would be erroneous. The following registers are not directly accessible using the JTAG ICE. Grouped by AVR device.
ATmega323, and ATmega16 :
UDR, SPSR, UCSRC/UBRRH, TWCR
Склихасовский
out SPSR - тот же эффект
SS - как вывод
Насчет не показывает - скорее всего...
Спасибо друзья..
Для просмотра полной версии этой страницы, пожалуйста, пройдите по ссылке.
Invision Power Board © 2001-2025 Invision Power Services, Inc.