Jump to content

Christian Faure

EstablishedMember
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Christian Faure

  • Rank
    Newbrie
  1. Hi Dave, I've flashed my pic WITHOUT bootloader (from www.microchipc.com) and now IT WOK FINE!!! Please excuse me for your time lost. But, if you know another bootloader, please let me know it Thanks Christian
  2. Thanks Dave, I've compiled and tested this code with my hardware The same result: it hang On reset : Sometime a led on (not flashing verified with the soundcard as oscilo), Sometime 2 leds on, not flashing, Sometime 2 led off, Sometime 1 led flash once, i've other chip, a 16f877a, but i'm not sure to have a bootloader on it, and a this moment dont have a hardware for flashing the chip. I' try with this other and send results. Regards, Christian
  3. Just more info: I've tried a dummy (empty) timer interrupt enabled, without calling SysTimerUpdate() from interrupt (calling it from main loop), and get same result: hang Regards, Christian
  4. Thanks Dave, But no, when i disable Novo (comment), interrupts are ok, (with or without a complete initialization code) When i enable Novo (comment out) then is unpredictable, sometimes interrupts work few seconds, then hang sometimes interrupts dont work but never run more than once time a task. When i disable interrupts and move the SysTimerUpdate() to the main loop, then always run ok, so i think that isn't a circuit problem, nor a logic problem in the sample code... Are someone using the pic16F877 with Novo and interrupts enabled? I need to change to pic18 branch? Another idea? Thanks Christian
  5. Hi, Thanks for this excelent work with BoostC and Novo. Now i'm trying to run examples of NOVO (NovoLedFlash), but this example only work (for me) with interrupts disabled, and moving the code of interrupt to main loop. I'm using a pic 16f877 whith bootloader, WatchDog disabled, 20Mhz +BoostC 6.8 Any idea? My modified code: #include <system.h> #include <novocfg_pic16t3e5ts1.h> #include <novo.h> #pragma DATA _CONFIG, _PWRTE_ON & _BODEN_ON & _WDT_OFF & _LVP_ON & _CPD_OFF & _DEBUG_OFF & _HS_OSC & _CP_OFF #pragma CLOCK_FREQ 18432000 #define hTask0 0 #define hTask1 1 void interrupt( void ) { if( intcon.T0IF ) { // update system time every 1ms (actually is 204.8us x 5 = 1.024ms) static BYTE intDivider; if( ++intDivider == 5 ) { intDivider = 0; SysTimerUpdate(); } intcon.T0IF = 0; //clear TMR0 overflow flag } } void InitTimer() { // configure Timer0 option_reg.T0CS = 0; // use internal clock option_reg.PSA = 0; // use prescaler form timer 0 // so we get an interrupt around every 204.8us with 20MHz Clock // set prescaller to divide by 4 option_reg.PS0 = 1; option_reg.PS1 = 0; option_reg.PS2 = 0; // enable interrupts ---------> DISABLED //intcon.T0IE = 1; //enable TMR0 overflow bit //intcon.GIE = 1; } void Task0() { while( 1 ) { porta.0 = 0; Sys_Sleep( 100 ); porta.0 = 1; Sys_Sleep( 100 ); } } void Task1() { while( 1 ) { porta.1 = 0; // 500ms delay Sys_Sleep( 250 ); // can only sleep for a maximum of 255 with 8 bit timers Sys_Sleep( 250 ); porta.1 = 1; // 500ms delay Sys_Sleep( 250 ); Sys_Sleep( 250 ); } } void main() { //ansel = 0; trisa = 0x00; //Configure A/D pins adcon1 = 0x06; //Initialize port A porta = 0x00; //InitTimer(); SysInit(); SysCreateTask( hTask0, 2, Task0 ); SysCreateTask( hTask1, 2, Task1 ); SysStartTask( hTask0 ); SysStartTask( hTask1 ); while( 1 ) { //-------- CODE FROM INTERRUPT static BYTE intDivider; if( ++intDivider == 5 ) { intDivider = 0; SysTimerUpdate(); } //----------- Sys_Yield(); } }
×
×
  • Create New...