Jump to content

cridarco

EstablishedMember
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About cridarco

  • Rank
    Newbrie

Profile Information

  • Location
    Italy
  1. GP0 and GP1 are inputs of the internal comparator. If you want to use them as digital I/O you must disable comparator setting cmcon0=0x07; GP0 and GP1 are also used for ICSP. If you use a demo board like low pin count and pickit2 from microchip to program it, these two pins remains connect to programmer. If you want to use them, you must review your project as explained in microchip 12F683 datasheet, chapter 12.10, page 100. Regards. Cridarco
  2. I tried ver. 6.84 and it works! No more problems. THANKS PAVEL, AND THANKS TO ALL SOURCEBOOST TEAM! Regards. Cridarco
  3. Yes, I do so. The previous answer convinced me that this way is the best. I use the interrupt only to set flag. Thanks. Cridarco
  4. Thanks to all for answers. Your comments have cleared my doubt and convinced me that the best way is to deal with the event in the main loop. Regards. Cridarco
  5. Hi, this is what BOOST C Compiler Reference Manual, PAG.64, says: General functions and interrupts Standard user functions are not thread-safe: their local variables are not saved when function execution gets interrupted by an interrupt. This can lead to very hard to trace errors. To prevent this pitfall, the linker does not allow to call a given function from both main() and interrupt threads. If you really need to use same function in both threads, you need to duplicate its code and assign a different name to the second copy. I tried to build a file, that has a main function and
  6. Hi, Pavel, thanks for help. I sent you the code at support@sourceboost.com. Regards. Cridarco
  7. hi, Orin. I try to substitute "switch" code with "if" code, as you said, and there are not differences . I dowloaded demo version of another compiler, and I will try to compile my code with it. If the same problems appens, I think it's my code to be reviewed, and I can clear any doubt about the compiler. After that test, I will write in this thread the results. Cridarco
  8. You can see the .asm translation of your code. The base time is clock. One instruction cycle consists of four oscillator period. Every instruction needs 1 or 2 cycles for execution (you can see how much in the PIC data sheet). Count assembler instructions of your desired code, and you can calculate the exact time the instructions need to execute. It's a bit difficult method, but if you need precision is the best. Cridarco
  9. thanks for help, Orin. This is the declarations: #define DUTY_MAX 1020 #define DUTY_MIN 4 #define ON_MODE 1 #define OFF_MODE 0 int data_array[4]; int *point_to_data_array=&data_array[0]; bit flag_on_off; Don't care the possible over/underflow because the duty range is 0 to 1023 (decimal). The application is a light dimmer with three pwm channel. I use a PIC16F737. In the OFF_MODE case (that is the one that don't work), if I use only *(point_to_data_array+i)-=2; inside the for loop (without the "if...else") it works. But I haven't the check for DUTY_MIN. It's
  10. I have the following switch inside a timer interrupt routine; the first case works, the second don't. switch (flag_on_off){ case ON_MODE: //THIS CASE WORKS for (i=1; i<4; i++) { if (*(point_to_data_array+i)< DUTY_MAX) *(point_to_data_array+i)+=2; else *(point_to_data_array+i)= DUTY_MAX; } break; case OFF_MODE: for (i=1; i<4; i++) { //THE FOLLOWING IF STATEMENT DON'T WORKS!!!! //IT EVER JUMP TO else CASE, ALSO WHEN DATA>DUTY_MIN!! if (*(point_to_data_array+i)> DUTY_MIN) *(point_to_data_array+i)-=2; e
  11. when i try to declare and init a multi-dimension array like: int multi_array [3][2] = {{1,2},{3,4},{5,6}}; the compiler write: "error: missing semicolon" ? thanks for help.
  12. Anyone has developed a dmx512 receiver? I found application note AN1076 on microchip site that describe how implement DMX512 protocol on a PIC, but I was not able to translate in BoostC code. I'm interest on how implement point 1 and 2 at page 7 of this AN. Thanks a lot for help.
×
×
  • Create New...