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

 
 
 
Reply to this topicStart new topic
> Проблемы с TMR2
loghir
сообщение May 9 2011, 07:28
Сообщение #1


Участник
*

Группа: Участник
Сообщений: 63
Регистрация: 13-03-11
Пользователь №: 63 577



Доброго времени суток!
при попытке откомпилить код
Код
void init (void)        // настройка TMR2 на 100 Hz.
{                
INTCON.GIE = 1;             // разрешены все немаскированные прерывания
T2CON.TOUTPS3 = 1;        // выбор коэф. выходного делителя TMR2
T2CON.TOUTPS2 = 1;        // выбор коэф. выходного делителя TMR2
T2CON.TOUTPS1 = 1;        // выбор коэф. выходного делителя TMR2
T2CON.TOUTPS0 = 1;        // выбор коэф. выходного делителя TMR2
T2CON.T2CKPS1 = 1;        // выбор коэф. предделителя TMR2
T2CON.T2CKPS0 = 0;        // выбор коэф. предделителя TMR2
PR2 = 195;                          // предустановка TMR2
T2CON.TMR2ON  = 1;        // включение TMR2
}

PICC 8.05pl2 выдает ошибки на всех битах настройки:
Error [196] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 55.12 struct/union required
Error [182] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 55.15 illegal conversion between types
Error [196] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 56.15 struct/union required
Error [182] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 56.18 illegal conversion between types
Error [196] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 57.15 struct/union required
Error [182] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 57.18 illegal conversion between types
Error [196] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 58.15 struct/union required
Error [182] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 58.18 illegal conversion between types
Error [196] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 59.15 struct/union required
Error [182] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 59.18 illegal conversion between types
Error [196] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 60.15 struct/union required
Error [182] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 60.18 illegal conversion between types
Error [196] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 61.15 struct/union required
Error [182] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 61.18 illegal conversion between types
Error [196] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 63.14 struct/union required
Error [182] D:\!!!!!!!!!!\Books_TXT_2\book_program\PIC_CI\My_program\work_program_timer_dima\1.c; 63.17 illegal conversion between types

что ему не так?!
Go to the top of the page
 
+Quote Post
sargein
сообщение May 9 2011, 07:49
Сообщение #2


Участник
*

Группа: Свой
Сообщений: 72
Регистрация: 31-01-10
Из: Минск
Пользователь №: 55 176



Уберите названия регистров с точками:
Код
void init (void)        // настройка TMR2 на 100 Hz.
{                

GIE = 1;             // разрешены все немаскированные прерывания
TOUTPS3 = 1;        // выбор коэф. выходного делителя TMR2
TOUTPS2 = 1;        // выбор коэф. выходного делителя TMR2
TOUTPS1 = 1;        // выбор коэф. выходного делителя TMR2
TOUTPS0 = 1;        // выбор коэф. выходного делителя TMR2
T2CKPS1 = 1;        // выбор коэф. предделителя TMR2
T2CKPS0 = 0;        // выбор коэф. предделителя TMR2
PR2 = 195;                          // предустановка TMR2
TMR2ON  = 1;        // включение TMR2
}



PS. Я бы еще компилировал в папке с названием, отличающимся от "!!!!!" на всякий случай sm.gif
Go to the top of the page
 
+Quote Post
loghir
сообщение May 10 2011, 09:44
Сообщение #3


Участник
*

Группа: Участник
Сообщений: 63
Регистрация: 13-03-11
Пользователь №: 63 577



sargein
Спасибо! Перенос в другой каталог помог. Без названий регистров с точками я пробовал.
Go to the top of the page
 
+Quote Post

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

 


RSS Текстовая версия Сейчас: 25th July 2025 - 11:36
Рейтинг@Mail.ru


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