Jump to content

chief

EstablishedMember
  • Content Count

    19
  • Joined

  • Last visited

Everything posted by chief

  1. Okay, I've sorted it out. I have a license for the C++ compiler. My main source code has an extension .cpp, but the eeprom code I'm using was .c, so MPLAB-X decided to invoke the unregistered C compiler for that one instead of using the C++ compiler. I think in the old MPLAB, I could choose the particular compiler, but in MPLAB-X, you choose the compiler family, and the program picks the compiler based on the extension. Brian
  2. Actually, I spoke too soon. It works for one project, not others. I'll do a search, but I think there's something about if one of the library files was from before the program license was activated, or something like that. Brian
  3. That worked! Thank you Jorge!
  4. Hi Pavel, I have a similar problem - clean installation of BoostC++ in new Windows 7 Pro machine, copied old source files into new project in MPLabX and when compiler runs it says lite (unregistered) version, and build fails because I'm over the max word limit for the free version. I enabled the Administrator account, logged in as administrator, ran Preg, it said it was successful, but I get the same problem. I also tried running the compiler from the command line, but there are spaces in the path, which make that not work. Help! Brian
  5. Hi Pavel, I now have it working using bit masks. It was a learning experience, but that's a good thing - I learned something I didn't know before! (porte & mask) returns the weight of the bit, not 1 or 0. See my changes and comments to your example below. Thanks for your help! #define OUT_MASK 2 // for bit 1 - mask needs to be the WEIGHT of the bit, not the number. Ex: bit 1 is mask 2, bit 2 is mask 4, etc. #define IN_MASK 4 // for bit 2 void read(unsigned char mask) { if (!(porte & mask)) do_something_if_bit_is_lo; // this will test for all mask bit(s) = 0 if ((porte & mask) != mask) do_something_if_mask_bits_don't_match_mask; // this is a more explicit test, and for >1 bit mask if ((porte & mask) == mask) do_something_if_all_mask_bits_match_mask; // this is a test for matching all mask bit(s) or testing even just one bit for 1. ... } //Read inside sensor read( IN_MASK ); //Read outside sensor read( OUT_MASK );
  6. Thank you Pavel for pointing me in the right direction. I don't have it working yet, but I'm reading up on mask operations to figure out where I went wrong. Best regards, Brian
  7. Hi, I have 2) one wire digital sensors, one on Port E.1 and the other on E.2 . I'm calling the read function with argument 1 for inside sensor or 0 for outside sensor. This is just a snippet of the code - If I change sens in the read function to in_sens, so it works for only the inside sensor, it works fine, but I've been trying to figure out how to make the function work for either sensor, and I'm stuck. sens = in_sens didn't work, a pointer didn't work (at least the way I did it). Can anyone offer a suggestion? volatile bit out_sens @ PORTE.1 volatile bit in_sens @ PORTE.2 void read(char n) { if (n == 1) //?? this is where I'm stuck - if n == 1 I need to assign the variable sens to in_sens; if it's 0, assign sens to out_sens. if (!sens) fail(1); //sensor not ready //make sens output, pull down for 1.1mS to trigger sensor if (n == 1) clear_bit(trise,2); else clear_bit(trise,1); sens = 0; delay_ms(1); delay_100us(1); if (n == 1) set_bit(trise,2); else set_bit(trise,1); // set sens back to input do //check for start of acknowledge pulse (spec 20-40us) { if (count > 4) fail(2); //no acknowledge count++; delay_10us(1); }while (sens);
  8. Please zip all files in your project directory and send it along with a note that mentions full path to this project location to support@sourceboost.com We'll try to reproduce the problem. Next thing to do is to move your project to a location that does not have spaces in the path. If this does not help you need to re-create project by first creating an empty project, copying source files from the original project to the new project directory and adding them to the new project. Regards, Pavel Hi Pavel, I just sent a zip of the adc test project, which demonstrates the problem, to support. I did have a space in the path, and I removed it, rebuilt the project from the source code, and the problem is still there. Hopefully you will see the problem. Regards, Brian Thanks Pavel, for looking into this for me. I didn't send the .__w workspace file because it lives in the next higher level directory. You opened the .__c file as a standalone project and it worked for you. I did the same and it works for me also. I tried making a new workspace and adding the project, and the same problem occurs. Maybe it wants to see the project file in the same directory as the workspace file? Whatever it is, v7.02 worked fine with the way I have things set up. Anyway, I need to move on with my project, so thank you for helping me find a workaround - I'll work with it as a standalone project till I have time to try a few things. Best Regards, Brian
  9. Please zip all files in your project directory and send it along with a note that mentions full path to this project location to support@sourceboost.com We'll try to reproduce the problem. Next thing to do is to move your project to a location that does not have spaces in the path. If this does not help you need to re-create project by first creating an empty project, copying source files from the original project to the new project directory and adding them to the new project. Regards, Pavel Hi Pavel, I just sent a zip of the adc test project, which demonstrates the problem, to support. I did have a space in the path, and I removed it, rebuilt the project from the source code, and the problem is still there. Hopefully you will see the problem. Regards, Brian
  10. I have not.If you could zip up and post a project demonstrating the issue we can investigate further. The installer leaves old version in place if you install in a new folder - old and new versions can co-exist. If you install in the same folder then the installer overwrites the older files. The "cleanest" approach is to uninstall the old version first and install the new version in a folder with the same name as the old version. Then any existing projects will use the newer compiler without any changes. Regards Dave Hi Dave, The same project was working w/ v7.02 just before I upgraded to v7.03. I also tried the adc sample project and got the same error when trying to go into debug. I'll try uninstall-delete any remaining files-reboot-install and see what happens. Brian I tried the uninstall-delete any remaining files-reboot-install v7.03 and got the same results - my project builds fine, but when I try to debug, it says it can't load the .cof file. I also found that the goodies library files didn't unpack to the libc and novo directories, even though all indications are that the goodies registration worked fine. I uninstalled again, reinstalled v7.02, plug-ins and goodies, and everything works as it did before I installed v7.03 - the goodies files are there and debug works as it did before. Really - nobody else encountered this? Brian
  11. I have not.If you could zip up and post a project demonstrating the issue we can investigate further. The installer leaves old version in place if you install in a new folder - old and new versions can co-exist. If you install in the same folder then the installer overwrites the older files. The "cleanest" approach is to uninstall the old version first and install the new version in a folder with the same name as the old version. Then any existing projects will use the newer compiler without any changes. Regards Dave Hi Dave, The same project was working w/ v7.02 just before I upgraded to v7.03. I also tried the adc sample project and got the same error when trying to go into debug. I'll try uninstall-delete any remaining files-reboot-install and see what happens. Brian
  12. Hi, I just uninstalled v7.02, installed v7.03 and v7.03 plug-ins and re-registered everything. I cleaned and rebuilt my project and it compiles fine, but I get the following error when I try to go into debug mode: Debugging... Can't load file 'SB Project4a\Debug\PJ4a.cof' The PJ4a.cof file is in the debug folder, was updated with the last build, and is about 60kB. Any suggestions besides going back to v7.02? Has anyone else seen this? BTW, is the installer smart enough to upgrade, or is it better to uninstall/reinstall as I did? Brian
  13. Thank you Reynard, It was a typo in my declarations. That's what I get for writing code on a netbook! Thanks for your help. I'm also changing them from letters to words. Brian
  14. Can anybody tell me why the compiler doesn't like this bit of code? void startup() { while(1)//startup loop - chk subd conn, last_state, pause, check S1 { if(no_conn) //test if PS subd is connected { lcd_gotoxy( 0, 0 ); lprintf("PS not connected"); } else if (last_state == S)//SC {recover_SC();} else if (last_state == L)//NL {recover_NL();} else if (last_state == X)//exit {recover_exit();} else { lcd_gotoxy( 0, 0 ); lprintf("PS connected"); lprintf("\nS1 to start"); } delay_ms(100); if(S1 == 0) { while( S1 == 1) do_next_thing(); } }//end while loop }//end startup I get the message: Building... "C:\Program Files\SourceBoost\boostc++_pic16.exe" bias_burn_nr.cpp -t PIC16F877A -idx 1 -obj Debug -d _DEBUG bias_burn_nr.cpp(75:25): error: unknown identifier 'L' bias_burn_nr.cpp(75:25): error: invalid operand 'L' bias_burn_nr.cpp(75:22): error: failed to generate expression bias_burn_nr.cpp(75:6): error: error in the 'else' body of 'if' expression BoostC++ Optimizing C++ Compiler Version 7.02 (for PIC16 architecture) http://www.sourceboost.com Copyright© 2004-2011 Pavel Baranov Copyright© 2004-2011 David Hobday Licensed to (NAME) under Single user Pro License for 1 node(s) Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited bias_burn_nr.cpp failure error: failed Done
  15. You are right, something is wrong with the simulator.Further investigation is required. Regards Dave Hi Dave, Thanks for the prompt replies! I appreciate the effort that goes into a program like this - the powerful simulator is the main reason I bought SB Boost C++. Since I know my adc code works, I'll continue to use the simulator for the rest of my project. Cheers, Brian
  16. Brian, Another thought: use the digital volt meter in the plugins pack to measure the voltage applied to the analog input. Regards Dave Hi Dave, I found the problem, but I haven't yet found a solution. As I said, my project works on my 16F877A target just fine - I have a 5v reference on AN3 and 1/3 of that on AN0, and I'm reading the correct voltage on my LCD. In SB IDE however, both ADRESL and ADRESH stay at zero and I discovered why. Even though I have ADCON1 PCFG3:PCFG0 set to 0001b for VRef+ on AN3 and analog input on AN0, the IDE is setting them as digital inputs. I know this because I noticed that portb=8 if I have a high on AN3 and =9 if I also have a high on AN0. The same thing happens with your adc sample code. Also, the variable PSU plugin doesn't retain the port settings when closing the IDE program. Regards, Brian
  17. Another thought: use the digital volt meter in the plugins pack to measure the voltage applied to the analog input. Regards Dave Hi Dave, I hadn't looked at your ADC sample and header, I'll do that. I like to do things my own way, so I don't become dependent on one compiler's libraries and my code is more portable. Using the voltmeter sim to measure the output of the voltage source sim is a great idea! I'll try that! Thanks. Regards, Brian
  18. Hi, I bought the pro version of BoostC++, and I have a project using a 16F877a at 20MHz, and after trying to get the adc to work in the sim for some time, and thinking I had the code correct, I tried writing the code to my development board thru MPLAB and it works fine. Any idea why the same code wouldn't work in the SB IDE simulator? I'm using the LCD sim, buttons, analog voltage source and register window. I'm using AN0 for input and AN3 for reference, and I also tried AN0 for input and Vdd for reference. The LCD and buttons both work fine, the problem is that ADRESL and ADRESH both stay at 0, and I can't tell whether the problem is the analog voltage simulator or something else. I have the analog voltage simulator set to the correct pins and I have the one on AN3 set to a higher voltage than the one on AN0. Thanks in advance, Brian
×
×
  • Create New...