Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by drumanart

  1. Hello I use since ages Sourceboost with Linux and MPLAB IDE 8,90 under wine (OS UBUNTU). Recently I migrated to MPLABX (Linux version) using the free version of MPLABXC8 compiler. As I have good experiences with SourceBoost I'd would like to go ahead with this complier and purchase the newest version 7.43 and use it with MPLABX IDE under Linux. Did any body make it work? Kind regards Martin
  2. Hello. I use since a couple of years a licensed version of BoostC C Compiler (Version 6.95). Now, as a plan to upgrade to a newer, actual, version and also to migrate to MPLAB-X (I use still MAPLAB 8.5 with LINUX and wine what works like a charm) I have a doubt: If I buy the C++ Compiler can I compile (re-use) code written for the BoostC C compiler version? In any case as I plan to go on with LINUX I suppose that I will have some issues to make SourceBoost work. Thanks Martin
  3. Hello. Code for 18F4420 At the beginning of my code I tell the preprocessor to activate the watch dog. #pragma DATA _CONFIG2H, _WDT_ON_2H & _WDTPS_2048_2H // WDTON, prescaler 1/2024. Is there a possibility to deactivate the watchdog while the code is running but not with _asm clrwdt? Thanks Martin
  4. Thanks for the LUT solution. As the compass works with 16bit resolution and I have to calculate, beside the heading, also pitch and roll (with an incorporated accelerometer) I thinks the easiest way is to send all raw data (6 bytes for the magnetometer and 6 bytes for the accelerometer) to the computer and solve the "big" calculation with the PC. I can do this quite straight forward with SuperCollider. The other thing is, as I mentioned above, that my browser shows rare signs if I lock at other threads: so, for example: ( for ( // ( for ) // &#41 for "; Any succestio
  5. Hello, I made a small PCB for the LSM303 electronic compass. The unit communicates with a I2C protocol and I made my one software functions to communicate with the unit what works great. Now, to get something useful out of the row data I have to use some math. Following the app notes of the LSM303 I have to calculate: Heading = arctan (Yh/Xh) Is there a mathematic library in SourceBoost. I work with a licend 6,95 Version. The other thing is that my browser (Chromium with Linux) want show the special signes from other threads correctly. My browser shows: ( for ( // &
  6. Ok, I respond to myself: As nobody in the forum seems to run MPLABX IDE under Linux (UBUNTU) and before inverting for a new programmer ICD3 (ICD2 want work with MPLABX IDE ) and before purchasing a new version of SourceBoost (with drivers for MPLABX IDE) I installed PIKLAB IDE. IT WORKS GREAT and my ICD2 clone runs even faster then ever in MPLAB IDE under WIndows. Martin
  7. Hello. I use UBUNTU (LINUX) as an OS and run, using wine, MPLAB IDE 8.5 with a licensed SourceBoost v.6.95 This works fine but is a little slow. No, since Microchip lanced the MPLAB X IDE there is also a version for LINUX and I red that SourceBoost v.7.05 has the drivers to run the program with the new environment. Does this works also on a LINUX (UBUNTU) without fiddling with wine, and did someone install it successfully? ( I can't find any topics). Thanks Martin
  8. Jorge, I found the bug, I had the T1CON, 3 (T1OSCEN) flag enabled. This is why the program always jumped to the void interrupt(void ) function. Both, the TMR0 and TMR1 timers, as well as the SSPIF flag are set as high priority and I handle them using the void interrupt(void ) function and the program works great. If I put an oscilloscope at the PW output, even in receiving continuous data stream from the wireless SPI unit (nRF24L01 is great), the puls-with is not affected at all. I did a little trial to manage the SPI in pooling the BF flag and also this works. As I have now the abiliti
  9. Oh yes, the SSPIP is flag is the PIR1,3 and the TMR1F the PIR1,0. Yesterday I tried to find the failure of my interrupt mess without having success. Still, as soon as I start the timers (TMR0, TMR1) fto run the PW the communication with the SPI unit fails. Today I will handle the SPI pooling the SSPIF in the main function. Would it be also possible to use the SSPSTAT, BF (buffer full) flag to handle the SPI module? Thanks for your passion. Martin
  10. Yeep Jorge. Thanks for the advise of the AND and OR gates graphics at page 92 of the 18Fxx data-sheet this is helpful for understanding of interrupts. As I had the PW for two servos with TMR0, TMR1 working really nicely and on the other hand the SPI unit (the Nordic 24L01 wireless radio) ) using another program was working fantastic (in my opinion) I didn't expect to have this troubles. I'm sure the mess is already at the SPI interrupt PIR1,SSPIF. Probably I forgot to clear somewhere the SSPIF as I did with the TMR1IF flag (this is why I forced the GIE flag to 1) . I suppose this messes
  11. Hi Jorge. So, I assume only if the IPEN of the RCON register is set the High/Low priority bits are valid and an interrupt_low function is activated. Now, could I handle the PW routine with the TMR0 and TMR1 flags as low priority interrupts in the interrupt_low function and handle the INT2IF and the SSPIF for the ISP unit as high priority interrupts? ( I don't find a way to set TMR1 as low priority, nor the SSPIF) Or is it easier to set the RCON bit as 0 and work in PIC16CXXX Compatibility mode. What is the standard way if one creates PW with timers and have a ISP unit connected.
  12. The thing is slightly more complex, as the program creates two PW, with timer0 and timer1. At start up I have to set the GIE & PEIE to configure the ISP module (wirless radio nRF24L01). I changed the messy code following your advice and I can receive wireless data from the nRF24L01, but as soon as I start the timers (the disabled code underneath) the INT2IF want get high anymore and I can't receive wireless data any more. So, either the PW works or the nRF24L01 works. Still there is a missmatch. Thanks Martin void interrupt(void){ if (spi_interrupt){ spi_handle_interrup
  13. Hello. I spent a entire afternoon in trying to get en interrupt on a PIC18F4420 on portb,2 working. At portb,2 I have the IRQ pin of an nRF24L01 attached. So, this pin drives low when data is received and I would like that the program jumps to the void interrupt(void) routine. For test purpose the program stays for ever in the interrupt function. With my code the int2if flag gets high before a change of portb,2 occurs, but the idea is that the interrupt happens if the pin is pulled down. To configure the PIC I made an init function: . void init(){ osccon = 01110000b; // interna
  14. Hi Jorge. I have seen that you handle the RX data also in the ISR. Unfortunately your code want run in Sourceboost neither in MPLAB so (for me) it is not so easy to follow entirely your ideas. Somehow I understand that you resend data to the servos every 20ms, but I can't find where you handle the "Elapsed20ms" variable. Thanks Martin
  15. This is great, I just printed the code and I go into it this days. My two SERVOS work now quite nice, but still, my main problem is the data transmission. With my Easy Radio(ER400TRS) I have some problem to send packages of three bytes: "header" 0xFF; "channel" 0x00/0x01) and "data" 0x00 to 0xFF. So, the past weekend I made a new protocol sending only two bytes. 10 bits for the SERVO data and 6 bites for addressing. This works best until know. Probably I forget the EASY RADIO and do the wireless transfer with the NORDIC 24L01. This units allow sending packages until 32 bytes. Two
  16. Hello Jorge. Yes, as I use a wireless module (Easy Radio ER400TRS) at a baudrate of 38400 a have to investigate first whether the data arrive correctly or if I have already bytes missing during data transfer. May I'm in the right in thinking to create an array for the incoming data (as a buffer) and adjust the SERVOS as fast as possible to the target value afterwards? PS. Last night when I was already in bed I had the flash that I don't have to handle the RCIF flag in the ISR. So I got up again and I moved it to the main function. Uff, this was a long one ..... Thanks very much for yo
  17. Sorry the code was wrong pasted, here again: void main(void) { osccon = 01110000b; // OSCCON int Osc, 8 Mhz. while (!iofs); // DEBUG without iofs OSCCON stable bit. init(); // Port settings etc. //short pw_data = 120; // Servo middle position. char count_aux; while(1){ _asm clrwdt; // The watchdog. if (header == 0xFF){ header = 0x00; // set header back. switch (ch){ case 0: TIME_ON1 = pw_data; break; case 1: TIME_ON2 = pw_data; } } } } // // void interrupt(void){
  18. Yeep Jorge, So I did and I get a continuous puls for both SERVOS. Only when I set the INTCON GIE and PEIE bit high also the pie1.RCIE jumps to the ISR. Now, what I did is, I handle the RCIE data also in the ISR. My main code only assigns the incoming data with global variables to its corresponding SERVOS. Uff, it works and connecting a oscilloscope, the PWM locks stable and continuous and incomming data, as far as I can see it, want affect it's flow, but still, if I turn the slider my SERVO jumps. I suppose if I get it work to seperate the RCIE from the ISR the result will by finally how
  19. Hello very patiently Jorge. Yes I understand your advise, but my problem is, to make that a TMR1 overflow jumps to the ISR I have to set the RCON ipen bit (I could not yet find an other solution). So if I set the ipen bit, data received indicated by the rcif bit jumps also to the ISR. I would have to put mostly of my code to the ISR, right? Kind regards Martin
  20. Hi Jorge. I was for two ill, but yesterday I went ahead with the program. As I can't make the TMR1 jumping into the ISR routine without setting the RCON ispen flag Hi, I did the program flow the following way. I start (enable) the TMR1 in the ISR routine and handle the rest in the main routine, and then, after the second Servo pulse is executed, I disable the TMR1. This works but with durty jumps when I fiddle with the sliders (not smooth enough). If I set the RCON ispen bit, the receiver flag rcif is also handled in the isr ROUTINE. Do I have to handle the receiving data and the PWM
  21. Thanks for the helpful advice and I'll have a more careful lock at the interrupt handling to not complicate live more than necessary. Kind regards Martin
  22. Uff, there we are. I had the ipen RCON,7 bit not set. The bit enables together with the gie INTCON,7 the high-priority interrupts (as you know of course). Until know a Timer1 overflow never jumped to the ISR routine, this is why I tried all this funny tricks with time-loops etc. what, made the CPU running for only one task. The (hopefully) very last question: In your LED code I learned that you configure several registers with marcos. Until know I used #define Registor 00000000b to configure the right value. Is the use of marcos better? Thanks a lot for wasting so mach time Martin
  23. Hello Jorge. I just made an project in MPLAB with your code and I can't find the functions below. Is there code missing? InitLeds(); // Set Leds control initial status InitBugFlags(BugFlags); // Init flags that signal abnormal rpogram behaviour Timer0_Config(); // Configure Timer 0 ADC_Config(); // Configure ADC ADC_On(); // Turn ADC On to start sampling Load_ADC_Delay(); // Start a delay before first ADC convertion Enable_Tmr0_Int(); // Enable Timer0 interrupts Enable_Interrupts(); // Enable global interrupts to start timing Timer0_On(); // Start Timer0 Yesterday I made an ot
  24. Your advice is very, very helpful, I'm learning a lot. This weekend I try to follow your recommendations and hopefully I'll get there ..... Thanks Martin
  • Create New...