Jump to content

Pavel

Administrators
  • Content Count

    1,466
  • Joined

  • Last visited

Everything posted by Pavel

  1. The reason we use xlaunch.exe instead of the actual compiler in the MplabX plugin is to allow different programming languages to be used in the same project. Xlaunch analyses the command line and based on the extension of the input source file launched a relevant compiler For example a project can consist of .c, .c++ and .bas files an when compiling xlaunch.exe will use C, C++ and Basic compilers to compile these files.
  2. When you assign an integer to a float like in float fnum = 0x41bba752; you expect compiler to do copy number into the float directly byte by byte. This is not what's happening. Behind the scene compiler generates code like fnum = float32_from_int32(1102817106); so you get the same value but presented as a float.
  3. Use either this: asm { movlw 0x52 movwf _fnum+0 movlw 0xa7 movwf _fnum+1 movlw 0xbb movwf _fnum+2 movlw 0x41 movwf _fnum+3 } or this: union { unsigned long l; float f; } f; f.l = 0x41bba752; fnum = f.f;
  4. Check http://forum.sourceboost.com/index.php?showtopic=1456&do=findComment&comment=20995
  5. Make sure you start preg.exe as administrator and make sure you select the correct product inside the preg.exe dialog (for example a BoostC++ key won't work with BoostC). If this fails try to register from command line. This can be done for any product that is an executable (so this method won't work for plugins and those are DLLs).Do do this: - open command prompt as administrator - navigate into SourceBoost installation directory - start the product executable followed with the "register" command line argument. For example for the BoostC compiler issue the command line like : C:\Program Files (x86)\SourceBoost>boostc_pic18.exe register This will bring up a dialog where you enter your registration name and license key and press OK. If registration was successful you will get a relevant prompt - Again it's important to use these steps as administrator, if not you still may bet an successful prompt but the registration won't be applied properly If still unsuccessful send a mail to support@sourceboost.com and quote your registration name and license key and briefly describe the problem and what you have done. UPDATE: We migrated on a new faster web server and seems that our key generation system got broken If you experience similar problem please email to support@sourceboost.com and we will sort it out. Sorry about the confusion. Regards, Pavel
  6. That's sounds like a compiler bug. We'll look into this. Chameleon does not support C++ classes but has a very good support of data and function templates up to the point when template based meta programming can be done. In fact its code generation logic is based on this. For an example check very bottom of include\sys\sys_assign.h file where meta programming is used to generate code for assigning structs. It also supports auto data type and explicit enum types (like in the latest C++ standard). From the top of my head: - rom type specifier is ignored - dynamic memory allocation is not supported (new/delete) - complex array and struct initialisation works a bit differently - system header system.h does not have to be included (it's included behind the scene) - Chameleon does support bit fields - Chameleon does support floating point data types natively Pavel
  7. You can download support files for PIC18F6xK40 from: http://www.sourceboo...PIC18F6xK40.zip 7.40 also includes instructions how to add support for new targets. Look into the readme.txt files inside include and config directories and how_to_add_new_target.txt file in the root of SourceBoost installation. Pavel
  8. Currently the Chameleon compiler is in beta stage and does not have a corresponding MplabX plugin yet. The only way I can think of how to work around this is to save the BoostC compiler executable in a safe place, rename the Chameleon executable into BoostC and use MplabX with BoostC plugin. The command lines between these 2 is mostly compatible and this makes it possible for this approach to work. Pavel
  9. No difference. GOTO is ok as well. My point was to use built-in assembler rather than C but whatever you use CALL or GOTO doesn't matter. Regards, Pavel
  10. I's tricky to call a function that is not linked to an application. The way to proceed is to use built in assembler like 'call 0x70'. The only issue with this approach is that it's impossible to use call arguments so the solution is to declare a fixed address array to pass data to your bootloader function. Regards, Pavel
  11. Please explain why your method is more preferable? Regards, Pavel
  12. There is no known way to do this under MPLAB And MPLABX should work just fine
  13. Running preg as admin may not be enough. One option is to log in as admin and that run preg and register. Another way is to log in as admin and start compiler from command line followed by the 'register' command line argument like 'boostc_pic16.exe register'. This will show a dialog where you can enter your license info.
  14. Isn't this issue fixed in 7.x release? Regards, Pavel
  15. Here is working sample code that sets up custom characters that represent battery status and that cycles trough them. Enjoy. Regards, Pavel #include <system.h> // Configure LCD connections // If using this code under SourceBoost simulator (for PIC18F97J60), configure the LCD plugin as follows: // RS to RH2 // R/W to RH1 // E to RH0 // DB0 to RE0 // DB1 to RE1 // DB2 to RE2 // DB3 to RE3 // DB4 to RE4 // DB5 to RE5 // DB6 to RE6 // DB7 to RE7 // #define LCD_ARGS 0, /* Interface type: mode 0 = 8bit, 1 = 4bit(low nibble), 2 = 4bit(upper nibble) */ \ 1, /* Use busy signal: 1 = use busy, 0 = use time delays */\ PORTE, TRISE, /* Data port and data port tris register */ \ PORTH, TRISH, /* Control port and control port tris register */ \ 2, /* Bit number of control port is connected to RS */ \ 1, /* Bit number of control port is connected to RW */ \ 0 /* Bit number of control port is connected to Enable */ #include <lcd_driver.h> // include the LCD template code //Target PIC18F97J60 configuration word #pragma config BW = 16 // 16-Bit Data Width mode #pragma config CCP2MX = ON // ECCP2/P2A is multiplexed with RC1 #pragma config CP0 = OFF // Program memory is not code-protected #pragma config DEBUG = OFF // Background debugger disabled; RB6 and RB7 configuredas general purpose I/O pins #pragma config EASHFT = ON // Address shifting enabled; address on external bus is offset to start at 000000h #pragma config ECCPMX = ON // ECCP1 outputs (P1B/P1C) are multiplexed with RE6 and RE5; ECCP3 outputs (P3B/P3C) are multiplexed with RE4 and RE3 #pragma config ETHLED = ON // RA0/RA1 are multiplexed with LEDA/LEDB when Ethernet module is enabled and function as I/O when Ethernet is disabled #pragma config FCMEN = ON // Fail-Safe Clock Monitor enabled #pragma config FOSC = HS // HS oscillator #pragma config FOSC2 = ON // Clock selected by FOSC1:FOSC0 as system clock is enabled when OSCCON<1:0> = 00 #pragma config IESO = ON // Two-Speed Start-up enabled #pragma config MODE = MM // Microcontroller mode, external bus disabled #pragma config STVR = ON // Reset on stack overflow/underflow enabled #pragma config WAIT = OFF // Wait states for operations on external memory bus disabled #pragma config WDT = OFF // WDT disabled (control is placed on SWDTEN bit) #pragma config WDTPS = 32768 // 1:32768 #pragma config XINST = OFF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode) //Set clock frequency #pragma CLOCK_FREQ 25000000 void interrupt( void ) { //Handle timer0 interrupt if( intcon & (1<<T0IF) ) { clear_bit( intcon, T0IF ); //clear timer 0 interrupt bit } } void interrupt_low( void ) { } void main( void ) { //Configure port B trisb = 0x00; //Set Timer0 mode set_bit( t0con, TMR0ON ); //enable timer0 clear_bit( t0con, T0CS ); //configure timer0 as a timer //Set Timer0 resolution set_bit( t0con, T08BIT ); //set timer0 8 bit wide //Set prescaler assignment clear_bit( t0con, PSA ); //prescaler is assigned //Set prescaler rate clear_bit( t0con, T0PS2 ); //prescaler rate 1:2 clear_bit( t0con, T0PS1 ); clear_bit( t0con, T0PS0 ); //Set timer0 source edge selection set_bit( t0con, T0SE ); //increment on high-to-low transition on RA4/T0CKI pin // Enable priority interrupts rcon = (1<<IPEN); //Enable interrupts (Timer0) intcon = (1<<GIE) | (1<<TMR0IE); /////////////////////////////////////////////// //Initialize LCD trisg.5 = 0; portg.5 = 1; //lit LCD backlight lcd_setup(); //Initialise first 3 custom characters lcd_funcmode(); lcd_write( 0x40+0 ); lcd_datamode(); lcd_write( 0b01110 ); //empty battery character lcd_write( 0b11011 ); lcd_write( 0b10001 ); lcd_write( 0b10001 ); lcd_write( 0b10001 ); lcd_write( 0b10001 ); lcd_write( 0b10001 ); lcd_write( 0b11111 ); lcd_write( 0b01110 ); //half empty battery character lcd_write( 0b11011 ); lcd_write( 0b10001 ); lcd_write( 0b10001 ); lcd_write( 0b10001 ); lcd_write( 0b11111 ); lcd_write( 0b11111 ); lcd_write( 0b11111 ); lcd_write( 0b01110 ); //full battery character lcd_write( 0b11011 ); lcd_write( 0b11111 ); lcd_write( 0b11111 ); lcd_write( 0b11111 ); lcd_write( 0b11111 ); lcd_write( 0b11111 ); lcd_write( 0b11111 ); /////////////////////////////////////////////// //Show hash pattern on LCD lcd_clear(); lprintf("###"); //Show changing battery status character inside an endless loop unsigned char ch = 0; while( 1 ) { lcd_gotoxy( 1, 0 ); lcd_datamode(); lcd_write( ch++ ); if(ch == 3) ch = 0; delay_ms(250); } }
  16. I spent more time on the PicPack library and eventually was able to build the usb_serial project. Here is a list of additional to my previous post changes that needs to be done: 1. Seems that some define names are a bit inconsistent. This fix will take care of this. In config.h add these code after the line '#define USB_EP0_IN_ADDR 0x0508': #define USB_EP0_OUT_O_SIZE USB_EP0_OUT_SIZE #define USB_EP0_OUT_O_ADDR USB_EP0_OUT_ADDR #define USB_EP0_OUT_E_SIZE USB_EP0_IN_SIZE #define USB_EP0_OUT_E_ADDR USB_EP0_IN_ADDR 2. For the value of PLATFORM_CLOCK defined in the project there are no defines for 2400 and 4800 serial baud rates. To fix this we'll use conditional compilation for the code that uses these values. In usb_cdc_class.c add ifdefs like this: switch (my_lc->dte_rate.as_long) { #ifdef SPBRG_2400 <<<<<<<<<<<<<< added line case 2400: current_bit_rate = SPBRG_2400; #ifdef CDC_DEBUG serial_print_str("2400 "); #endif break; #endif <<<<<<<<<<<<<< added line #ifdef SPBRG_4800 <<<<<<<<<<<<<< added line case 4800: current_bit_rate = SPBRG_4800; #ifdef CDC_DEBUG serial_print_str("4800 "); #endif break; #endif <<<<<<<<<<<<<< added line case 9600: 3. usb_serial project uses serial routines but source file with these routines in not part of the project. To fix this add pic_serial.c and pic_serial.h from the pic_pack_lib folder to the project. After these changes the project could be built without errors. Regards, Pavel
  17. ...Unfortunately it gets numerous compiler and preprocessor errors with 7.30 while attempting to compile the demo projects (using whatever chip the demos were meant for, I didn't change their target) ... I just tried to build couple of the USB projects from the PicPackLib 3.09 from www.embeddedadventures.com with 7.30 and here is what you need to change to make the project build: Project ea_plt1003_usb2serial or ea_plt1003_usb_keyboard or usb_joy_mouse: 1. The project file contains path to the compiler that may be different from what is on your computer. After opening the project you need to go to Settings->Options->Tools and press the 'Get Default' button. This will reset the path to the compiler in the project 2. The project misses path to some of its include files. Go to Settings->Options->Compile Options and add to the 'Extra compiler options' field this string: -I ../../pic_pack_lib After these changes I was able to build the projects. However I couldn't build the usb_serial project as some of the defines are missing. These defines are present in the usb_joy_mouse project so maybe copying them over will help. Regards, Pavel
  18. No SourceBoost does not include any USB libraries Regards, Pavel
  19. SourceBoost is alive and well. Just released a new version 7.30 with a number of improvements and fixes including a new IP library that implements basic IP stack (ARP/IP/UDP/DHCP/ICMP) which was quite fun to develop. We still support and develop it albeit not as active as before. Regards, Pavel
  20. I tried SourceBoost installation on a 'clean' Windows 8.1 64bit computer that had never SourceBoost installed. The installation went fine and after installation I was able to register goodies using preg just fine (remember that after you select 'goodies' inside preg you need to press 'OK' and that will bring up another dialog where you enter your goodies license name and key). After that I started goodies and they extracted files (including Novo) without any problems. Regards, Pavel
  21. A new version of SourceBoost 7.30 is ready and available to download from http://www.sourceboost.com What's new: 1. Improved compiler speed. Now it is about 3x faster. 2. Added IP library that implements the following protocols: ARP, ICMP (ping only), IP, UDP, DHCP (client) and simplified UDP sockets. 3. General improvements of BoostWizard 4. Added support for board files into BoostWizard 5. Added support for binary semaphores into Novo 6. Added UDP demo project (requires Novo libraries from goodies.exe) 7. Added support for 16F1459 and 16LF1708 8. Fixed code generation for left shift of byte by 16 9. Fixed error when result of complex expression that used left shift wasn't promoted to 32 bits 10. Added detailed description of long promotion into compiler help Regards, Pavel
  22. Log in as administrator, start preg and register again. It's important to be logged in as administrator as just running preg as administrator may not be enough. If this fails start command prompt (as administrator), navigate to your SourceBoost installation directory and start compiler followed by the 'register' command line argument like: boostc_pic16.exe register This will open a registration dialog to enter your license details. Re-compile all your source files after you enter your license information. If you don't linker may think that obj files were compiled with unregistered compiler copy and will complain. Regards, Pavel
  23. No variable arguments are not supported and we don't plan to add support for it. The reason behind is a very long generated code required to properly support this feature. Regards, Pavel
  24. I have corrected the tutorial code to produce correct delays. Regards, Pavel
  25. You need to used the floating point library built with the same compiler version that you use (in your case 6.97). Normally it's the library included into SourceBoost installation that you use. From your post it sounds that this might not be the case. Tip: try to add linker command line argument -v. This will trigger more detailed linker output which might tell more details about this problem. Regards, Pavel
×
×
  • Create New...