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

 
 
> помогите запустить модель PIC24f16ka101 в Proteus, проблема запуска модели PIC24f16ka101 в Proteus
csm7
сообщение Jan 30 2018, 08:17
Сообщение #1


Участник
*

Группа: Участник
Сообщений: 63
Регистрация: 22-12-08
Пользователь №: 42 674



Доброго времени суток
Необходимо запустить модель PIC24f16ka101 в Proteus

Все время выдает ошибку

[PIC24KA SETUP] PC=0x000002. Clock 16.0MHz specified in schematic component is ignored for oscillator mode 'FRCDIV'. [U1]
[PIC24KA SETUP] PC=0x000002. Input clock frequency (1.00MHz) for clock type FRCDIV is not in range 8.00M-32.0MHz. [U1]


Спасибо
Разобрался Необходимо подтянуть MCLR к питанию
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
csm7
сообщение Feb 1 2018, 14:13
Сообщение #2


Участник
*

Группа: Участник
Сообщений: 63
Регистрация: 22-12-08
Пользователь №: 42 674



Доброго времени суток!
Появилась проблема при работе с реальным PIC24f16ka101 Не могу включить прерывания по UART2
прописал
Код
void intUART2() iv IVT_ADDR_U2RXINTERRUPT ics ICS_AUTO {
  if (U2RXIF_bit == 1) {           // If interrupt is generated by RCIF
    txt[i] = UART2_Read();         // Read data and store it to txrt string
    i++;                           // Increment string index
    if (i > 100) {                // If index = 768,
      i = 0;                       //   set it to zero
      ready = 1;                   // Ready for parsing GPS data
    }
    U2RXIF_bit = 0;                // Set RCIF to 0
  }
}

void main()
{
         AD1PCFG = 0xffff; // initialize all A/D pins as Digital pins
         //CLKdiv.RCDIV_0_bit = 0;
          CM1CON = 0;
          CM2CON = 0;
          CLKDIV &= 0xF800;  //äåëèòåëü â 0

          TRISA =  0x0000; // Initial port A how output
          TRISB =  0x0000; // Initial port B how output
          LATA = 0;
          LATB = 0;
          TRISBbits.TRISB0 = 0;  // Pin 1 RB0 U2TX Output GPS
          TRISBbits.TRISB1 = 1; //Pin 2 RB1 U2RX Input    GPS
          TRISBbits.TRISB2 = 1; // Pin 3 RB2 U1RX Input GSM   Ïîìåíÿòü ìåñòàìè Pin3 Pin8
          TRISBbits.TRISB7 = 0; //Pin 8 RB7 U2TX Output    GSM

          UART1_Init(4800); // GSM
            Delay_ms(1);
              UART2_Init(4800); // GPS
                Delay_ms(1);
           //U1MODEbits.ALTIO = 1;

          LATA.B1 ^= 1;
            Delay_ms(5);
              LATA.B1 ^= 1;

  URXISEL_1_U2STA_bit = 0;
    NSTDIS_bit = 1;                  // no nesting of interrupts
      U2RXIF_bit = 0;                    // ensure interrupt not pending
        U2RXIE_bit = 1;                  // Enable USART Receiver interrupt


                     while(1)
                     {
                         OERR_bit = 0;                  // Set OERR to 0
                           FERR_bit = 0;                  // Set FERR to 0

                     if (ready == 1)
                        {
                        ready = 0;
                              string = strstr(txt,"$GPGGA");   //NMEA message with coordinates is "$GPGGA" /see datasheet
                                    if(string != 0) {                // If txt array contains "$GPGGA" string we proceed...
                                       //     if(string[43] == '1') {        // If "$GPGGA" NMEA message have '1' sign in the 43-th
                                      // position it means that the GPS receiver has FIXed position!
                                                  latitude = (string[18]-48)*10 + (string[19]-48);
                                                  longitude = (string[30]-48)*100 + (string[31]-48)*10 + (string[32]-48);

                                                  if(string[28] == 'S') {           // if the latitude is in the South direction it has minus sign
                                                                latitude = 0 - latitude;
                                                                         }
                                                  if(string[41] == 'W') {           // if the longitude is in the West direction it has minus sign
                                                                longitude = 0 - longitude;
                                         //                                }

                                                                         }
                                      //UART1_Write_Text("Test GPS Ok");   // Latitude
                                     UART2_Write_Text(latitude);   // Latitude
                                     UART2_Write_Text(longitude);   // Longitude
                                                     }
                                      UART1_Write_Text("Test GPS Ok");
                        }
                     }
}


где грабли
Go to the top of the page
 
+Quote Post
Baser
сообщение Feb 1 2018, 16:43
Сообщение #3


Просто Che
*****

Группа: Свой
Сообщений: 1 567
Регистрация: 22-05-07
Из: ExUSSR
Пользователь №: 27 881



Цитата(csm7 @ Feb 1 2018, 16:13) *
Появилась проблема при работе с реальным PIC24f16ka101 Не могу включить прерывания по UART2
где грабли

Конфигурационный регистр FICD правильно установлен?
По умолчанию ножки U2TX/U2RX заняты под PGC1/PGD1

Ну и UART2_Init(4800) отсутствует. Может там чего не хватает.
Go to the top of the page
 
+Quote Post



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

 


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


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