Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by Pavel

  1. C language does not allow declaration inside for expression. This is valid in C++ though. Many C compilers allow this too as a "C language extension". Both BoostC and BoostC++ do support this feature too. You must be using an old compiler release if you get compile errors. Regards, Pavel
  2. This problem is caused by over-optimisation. We still work on a fix. Meanwhile please use a workaround: use level 1 optimisation (compiler command line argument -O1) Regards, Pavel
  3. Problem confirmed. Will investigate asap. Thanks for reporting. Regards, Pavel
  4. For the command line like yours 'C:\Sourceboost\boostc_pic18.exe" CPU.c -O1 -W1 -t 18F4550 -I wireless' where input file is specified without path compiler will look for it in the current directory. Apparently MPLAB sets the current directory to C:\Docs\Controller\Software\Project. Not sure how to change this. Regards, Pavel
  5. This is a compiler bug. Even the preprocessor does allow setting define values in command line compiler does not handle this. Will be fixed in v7. Regards, Pavel
  6. Well that's an unfortunate pain. Will this be fixed in v7? If so, I can probably hang around and wait a while (it was imminent in February). If not, well, I haven't needed 2k code yet so I hadn't paid up. Which means I should start looking around and seeing what quirks other compilers have. Yes this will be fixed in v7. In fact we plan to make this feature available in the very first v7 pre-release whenever it becomes available. In v6 you'll have to split your big arrays into a number of smaller arrays or use any other algorithm that can split data into smaller chunks. Regards, Pavel
  7. Tasks can't be members of a class. The reason is in memory allocation for variables. Because there is no stack on PIC all memory allocation has to be done at compile time. Each task is handled as a start of a completely independent call tree. This was compiler and linker can overlay memory regions between different call trees and between different nodes on the same tree. Again this analysis is done at compile time. If class members are used as tasks that it's not known at compile time how many instances of a particular class will be created at run time (remember that if task was a class member than each instance of a class would create a new task). This means that code can't be linked because it's not possible to allocate memory for variables. Technically it would be possible to use static class members for tasks but the compiler currently does not support this. Regards, Pavel
  8. Still under development. As usual other more important tasks popped in and slowed down the new compiler development. Regards, Pavel
  9. Preprocessor does not evaluate any expressions. It's job if to process include files, handle ifdef logic and do macro substitutions. All calculations are done by compiler. In this case compiler was written so that it does not handle expressions in fixed address part of declarations. We added this to our todo list for v7. For now please don't use expressions in the fixed address part in declarations. Regards, Pavel
  10. Dave will answer this. He is traveling now and I'm not sure when he's able to access the forum. Regards, Pavel
  11. You must be using an old RC. All of them except the very last one had this functionality broken. The one that is on the www.sourceboost.com right now does seem to handle all configs from your code correctly (including MSSP7B_EN that you marked as not working). Attached is the picture of what MPLAB showed me. Try to download latest 6.97 RC and use it to build your code. Reagrds, Pavel
  12. The % operator as well as few others need the libc library linked to your project. If you work from SourceBoost IDE this library will be added automatically. If you use MPLAB you need to add it manually (libc.pic16.lib for PIC16 targets, libc.pic16x.lib for new pic16f1x and libc.pic18.lib for PIC18). This library can be found in the lib folder inside SourceBoost installation directory. #include <system.h> should be the first include in all your source files. Regards, Pavel
  13. Code from your screenshots looks ok (you don't even need to Sys_Yield, Sys_Sleep calls will cause scheduler to switch tasks). Must be something in the rest of the program. Regards, Pavel
  14. Sometimes we do. But we don't plan to do it for every post. The idea of these posts is to let us know about the problems. These problems than go into our bug tracking system that we use internally. Regards, Pavel
  15. Check the configuration bits. If they look ok check if your code initialises hardware correctly. Regards, Pavel
  16. Actually this is the final release candidate. We don't plan to change anything in it unless this is a very serious issue. Compilation speed shouldn't change. What optimisation options do you use? What's you OS, Ram size and CPU speed? Regards, Pavel
  17. Thanks for pointing this out. Yes these are errors. Original code in the above post is now corrected. Regards, Pavel
  18. Currently wizard is limited to only a few targets. This does not depend on the license. We plan to change this in v7. For now the workaround is to use wizard target closest to your device. Regards, Pavel
  19. Here is a link to UART driver that will replace existing rs232_driver. And here is a link to another sample code that uses same UART driver. Very easy to use (API consists of only 5 calls) especially if you need just one UART. Regards, Pavel
  20. The main difference between 6. and 7.x is that 7.x is not yet released and 6.x is available for a long time already Some other differences can be found here. Pavel
  21. In 6.x an array has to fit inside a memory bank. Workaround is to split big array into multiple smaller ones and add some code that manages access using big indexes. 7.x will fix this and allow big arrays that can reside in multiple memory banks. Regards, Pavel
  22. OK here is same sample modified not to use Novo (untested). It uses 2 UARTs and just forwards data received from UART1 to UART2. Enjoy: /******************************************************************** BoostC/BoostC++ sample code Asynchronous UART sample code that receives data from UART1 and forwards it to UART2. Code also flashes heartbeat LED connected to PORTD pin 0 BoostC/BoostC++ compilers are available from www.sourceboost.com Author(s) Pavel Baranov Copyright(C) 2010 Pavel Baranov This code can be used free of charge in both commercial and non-commercial projects as long as this copyright notice and this entire statement is left unchanged. This software is provided "as is", without warranty of any kind. ********************************************************************/ //System headers #include <system.h> //Target PIC18F8722 configuration word #pragma DATA _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L & _XINST_OFF_4L #pragma DATA _CONFIG2H, _WDT_OFF_2H & _WDTPS_128_2H #pragma DATA _CONFIG2L, _PWRT_OFF_2L & _BOREN_OFF_2L #pragma DATA _CONFIG1H, _FCMEN_OFF_1H & _OSC_HS_1H //Set clock frequency #pragma CLOCK_FREQ 10000000 //UART Tx and Rx data #define TX_BUFFER_SIZE 8 #define RX_BUFFER_SIZE 8 //TX and RX buffers and helper variables static unsigned char txBuffer[TX_BUFFER_SIZE], txHead, txTail; static unsigned char rxBuffer[RX_BUFFER_SIZE], rxHead, rxTail, rxCnt; //Because we use 2 UARTs we have to use UART driver in multiple port mode #include "uart_driver.h" //Helper defines for uart driver calls #define uart1Init rs232Init<PIE1,TX1IE,PIE1,RC1IE,RCSTA,CREN,RCSTA,SPEN> #define uart1TxInterruptHandler rs232TxInterruptHandler<PIR1,TX1IF,TXREG1,sizeof(txBuffer),TXSTA,TXEN,TXSTA,TRMT> #define uart1RxInterruptHandler rs232RxInterruptHandler<PIR1,RC1IF,RCREG1,sizeof(rxBuffer),RCSTA,CREN,RCSTA,OERR,RCSTA,FERR> #define uart1Rx rs232Rx<sizeof(rxBuffer)> #define uart1Tx rs232Tx<sizeof(txBuffer),TXSTA,TXEN> #define uart2Init rs232Init<PIE3,TX2IE,PIE3,RC2IE,RCSTA2,CREN,RCSTA2,SPEN> #define uart2TxInterruptHandler rs232TxInterruptHandler<PIR3,TX2IF,TXREG2,sizeof(txBuffer),TXSTA2,TXEN,TXSTA2,TRMT> #define uart2RxInterruptHandler rs232RxInterruptHandler<PIR3,RC2IF,RCREG2,sizeof(rxBuffer),RCSTA2,CREN,RCSTA2,OERR,RCSTA2,FERR> #define uart2Rx rs232Rx<sizeof(rxBuffer)> #define uart2Tx rs232Tx<sizeof(txBuffer),TXSTA2,TXEN> ////////////////////////////////////////////// // High priority interrupt // handles system time ////////////////////////////////////////////// void interrupt( void ) { //Handle timer0 interrupt if( intcon.T0IF ) { // update system time every 1s static unsigned char nDivider = 0; if( 39 == ++nDivider ) { nDivider = 0; latd ^= 1; } clear_bit( intcon, T0IF ); //clear timer 0 interrupt bit } } ////////////////////////////////////////////// // Low priority interrupt // handles UART send and receive ////////////////////////////////////////////// void interrupt_low( void ) { uart2TxInterruptHandler( txBuffer, txTail, txHead ); uart1RxInterruptHandler( rxBuffer, rxHead, rxCnt ); } ////////////////////////////////////////////// // Program entry point ////////////////////////////////////////////// void main( void ) { //Disable watchdog wdtcon.SWDTEN = 0; //Configure and initialise port D trisd = 0x00, portd = 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 set_bit( t0con, T0PS2 ); //prescaler rate 1:256 set_bit( t0con, T0PS1 ); set_bit( t0con, T0PS0 ); //Set timer0 source edge selection set_bit( t0con, T0SE ); //increment on high-to-low transition on RA4/T0CKI pin //Configure serial port speed and interrupt ipr1.RCIP = 0, ipr1.TXIP = 0, ipr3.RCIP = 0, ipr3.TXIP = 0; //use low priority interrupt txsta.BRGH = 1, txsta2.BRGH = 1; //high speed spbrg = 64, spbrg2 = 64; //9600kbps/10Mhz //Configure UART1 pins trisc.7 = 1; trisc.6 = 0; //Configure UART2 pins trisg.2 = 1; trisg.1 = 0; //Init uart driver uart1Init(); uart2Init(); //Configure interrupts rcon.IPEN = 1; //enable priority level interrupts intcon.TMR0IE = 1; //enable timer 0 interrupt intcon.GIEH = intcon.GIEL = 1; //Enable high and low priority interruptr //Endless loop while( 1 ) { if( rxCnt ) { //read one byte received from UART1 unsigned char data = uart1Rx( rxBuffer, rxTail, rxCnt ); //write received byte into UART2 uart2Tx( data, txBuffer, txHead ); } } } // End of code Regards, Pavel
  23. I am sure the driver isn't intended for exclusive use with NOVO, it just happens that the demo code demonstrates the use of the driver with NOVO - killing two birds with one stone! Perhaps another simple demo is called for to demonstrate the driver without using the RTOS? This is a general purpose driver and it does not depend on Novo RTOS. Don't let sample code confuse you. All driver API (that consists of only 5 calls) is described in the accompanying manual and can be used from any code. Regards, Pavel
  24. Driver release candidate can be found here http://forum.sourceboost.com/index.php?showtopic=4534 Regards, Pavel
  25. A bit of more info will help. Do you build from MPLAB? Have you added libc library to your project? Pavel
  • Create New...