Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by RJS

  1. Since I have not seen any updates or responses in some time could you please let us know if your products are still supported and if the newer devices will be added soon or should we start looking at other compliers? Thanks! Randy
  2. Any update on support for this chip? Thanks, RJS
  3. Hi Reynard, Nope hadn't tried that but that was the solution - Thanks!!! I went back to the documentation but didn't see anything about the large libs. Randy
  4. Hey Reynard, Well I found the problem but I am not sure how to fix it. I am using the -idx 2 option for 2 byte indexing which I need in this program. if I take out the code that requires this and trun off the option if links fine. Randy
  5. Ok I am sure I am missing something but I have the rand.h header file included and both the libc.pic18.lib and rand.pic18.lib file set in the library files but I continue to get the following errors: Error: Unresolved external function:'rand(void)' Error: Unresolved external symbol, function:rand
  6. Thanks Reynard! I see that the Microchip documents do state 1E000h as the EEPROM address, however, when programming the device this does not work. I am not sure if MPLAB is not interperting it correctly or just an error in the document but if you set _EEPROM to F000h the data is written to the EEPROM in the correct location. I hate modifying header files as they will get over written next time I update so I just set the correct value in my code. Randy
  7. The header file for the 12F1822 also has the same incorrect address
  8. The header file, PIC12LF1822.h, contains an incorrect address for the 12LF1822 MCU, the file states 0x1E000 but the correct address is 0xF000. Thanks, Randy
  9. Can someone please point me to a list of the new features in 7.0? Thanks, Randy
  10. I was able to get it working. The BoostCPic16.h files did not contain entrys for the 12F1822 but the headers were there so I just edited BoostCPic16.h. Hopefully it will be corrected in 7.02. Thanks! Randy
  11. I just upgraded to 7.0 and was expecting to see support for the 12F1822. I saw a few references to it in the forum but nothing indicating if it is supported. Can you please let me know if it is and I am just missing something or when it will be supported? Thanks, RJS
  12. Has anyone been able to integrate the ICD 3 Command Line utility (ICD3CMD.EXE) in to the SourceBoost IDE? If so how did you do it? I seem to be missing where to configure the command line options within the IDE.
  13. Any near term plans to support the new 16F19xx chips? Thanks, RJS
  14. There is no way yet. This is on our todo list. Regards Dave I can confirm that the updated linker fixes the problem - downloaded to 18f2620 and confirmed working. I agree with Mac - a pragma for the -rb option would be much nicer than having to use the ide command line settings dialog - means the bootloader config could be automated before building. cheers Ian. Soooo where would one get this new linker from? Thanks, Randy
  15. I would guess the problem is the comparator needs to be turned off but I am not sure how that would affect the AD since you are using it on a different pin. I do not have the 12F675 but I here is some code that works on the 12F683 which should work the same on the 12F675 except for the configuration bits //////////////////////////////////////////////////////////////// #include <system.h> #pragma CLOCK_FREQ 1000000 #pragma DATA _CONFIG, _FCMEN_OFF & _IESO_OFF & _CPD_OFF & _BOD_ON & _CP_OFF & _MCLRE_OFF & _PWRTE_OFF & _WDT_OFF & _INTOSCIO unsigned short ADRead( void ); #define LED gpio.2 main() { unsigned short adc; trisio = 0b11111011; // Port I/O configuration osccon = 0b01000001; // Set to 1MHZ cmcon0 = 0b00000111; // disable comparator ansel = 0b01000010; // Fosc/4, AN1 selected adcon0 = 0b10000101; // Right justified, AN1, A/D on LED = 0; while( 1 ) { adc = ADRead(); // Read Analog value LED = !LED; // toggle LED delay_ms( adc >> 2 ); // delay based on 1/4 Analog value } } unsigned short ADRead( void ) { adcon0.GO_DONE = 1; // start AD conversion while( adcon0.GO_DONE ); // wait for it to complete return( (adresh << 8 ) + adresl ); } Perhaps not very interesting of a program but it shows how to setup and use the ADC. It just blinks an LED at a rate based on the AD output. RJS
  16. I tried 6.91 RC2 and the static keyword now works for all functions and reduced my program size by 2K Thanks for the quick fix, you guys are are the best!!!! RJS
  17. I just upgraded to the C++ version of the compiler and while the compiler does not affect the size of my existing code when I recompile it, it does seem to create bloated code when using classes. For example in the non C++ version the function call func( a ); generates the following assembler code: 0012 5002 MOVF main_1_a, W 0014 6E03 MOVWF func_00001_arg_a 0016 EC02F000 CALL func_00001 However using a C++ version of the function, foo.func( a ); the following code is generated 0012 0E00 MOVLW HIGH(gbl_foo+D'0') 0014 6E04 MOVWF func_00000_arg_this+D'1' 0016 0E01 MOVLW LOW(gbl_foo+D'0') 0018 6E03 MOVWF func_00000_arg_this 001A 5002 MOVF main_1_a, W 001C 6E05 MOVWF func_00000_arg_a 001E EC02F000 CALL func_00000 I could understand this if I was using indirection or virtual functions but since the location of the function in my case is always deterministic I do not understand why the additional code is necessary. I have tried using the static keyword and it creates asm similar to the non C++ code in this simple example but a class with multiple functions is causes duplicate references and other errors and I could find any other way to use the static keyword or to otherwise reduce the code size. Here is the example of a multi function class where I tried to use static but does not compile: // test.cpp #include <system.h> #pragma CLOCK_FREQ 8000000 #include "foo.h" FOO foo; void main( void ) { char a; for( a = 0; a < 100; ++a ) foo.func( a ); } // foo.h class FOO { public: static void func( char a ); static void anotherfunc( char a ); }; // foo.cpp #include "foo.h" void FOO::func( char a ) { char b; b = a; anotherfunc( b ); } void FOO::anotherfunc( char a ) { char b; b = a; } Please let me know if there is any way to better optimize this while still using c++ Thanks, RJS
  18. Are you using MPLAB or the SourceBoost IDE? If you are using MPLAB make sure you are linking with the library file, it is not included automatically like with the SourceBoost IDE. memcmp should be in libc.pic16.lib (or libc.pic18.lib if you are using a 18Fxxx.) To add the library, in the project window, right click on the "Library Files" folder and select "Add File..." and browse to the SourceBoost/lib directory and select the correct library for your PIC. Hope that helps, RJS
  19. Reynard, Thanks for the suggestion. It helped to find the source of the problem by changing the timing a bit more and it is now working. It turns out that the problem was disabling the UART before the reset. Taking out the statements txsta = 0; rcsta = 0; from the reset sequence resolved the problem and I can upload new firmware automatically and wirelessly! Thanks, RJS I do not have any issues with you posting this.
  20. Without knowing your hardware design I am not sure if this will cause a problem or not but Port B has built in pull-up resistors. option_reg.RBPU = 0 will force the bits (pins) on port B high (logical 1) and then when the button is pressed the input will go low (logical 0). If that is not an option use 10K resistors to VDD on the pin with the button this will have the same effect. Also you may want to consider using a 1K resistor to GND from the button. You can get away without doing this but I always feel safer limiting the current below the 20ma max for a pin in case there is a short elsewhere. RJS
  21. Reynard, Thanks for the suggestion. It helped to find the source of the problem by changing the timing a bit more and it is now working. It turns out that the problem was disabling the UART before the reset. Taking out the statements txsta = 0; rcsta = 0; from the reset sequence resolved the problem and I can upload new firmware automatically and wirelessly! Thanks, RJS
  22. I did not see any posts on this so I do not know if I am just missing something simple or charting a new area. I just started playing with the bootloader from Embedded Adventures and discovered that it can be used wirelessly with an XBee. However, as incredibly exciting as that is, I just have to try to push this one step further. The next step is to get this working without a manual reset or cycling the power. I hoped this would be a simple as calling the reset() function after receiving a specific sequence, but apparently not :angry: As best as I can tell it does appears to go thought the reset ( I also tried forcing the PCL and PCLATH start to 0x0000.) I tried modifying the bootloader to see if it was getting executed and while it seems to be getting to the bootloader code it will not initiate the upload. I have tried a number of different timings incase that was the problem but I still cannot get this to work. I also had the same results with a wired connection. What am I missing? Has anyone already got this to work? Here is the code: #include <system.h> #pragma CLOCK_FREQ 4000000 void SendStr( char *p ); #pragma DATA _CONFIG1, _CP_OFF & _CCP1_RB3 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_CLKOUT #pragma DATA _CONFIG2, _IESO_OFF & _FCMEN_OFF #define BAUD 25 /* 9600 */ char recdata; char rmreset; void interrupt() { recdata = rcreg; if( recdata == 'r' ) rmreset = 1; porta.1 = !porta.1; } main() { unsigned char a; ansel = 0b00000000; // all ports digital trisa = 0b00100000; // PortA I/O configuration trisb = 0b00000100; // PortB I/O configuration osccon = 0b01100000; // Set to 4MHz porta = 0; // clear ports portb = 0; // Setup Serial port spbrg = BAUD; // Set baud rate txsta = 0b00100110; // transmit enabled async mode, 8 bit high speed baud generator rcsta = 0b10010000; // enable serial & continous receive // Setup interrupts intcon = 0b11000000; // Global & Peripheral interrupts on pie1.RCIE = 1; // interrupts on receive pir1.RCIF = 0; rmreset = 0; while( 1 ) { porta.1 = !porta.1; delay_s( 5 ); if( rmreset ) { SendStr( "\r\rReset in 10 Seconds\r" ); txsta = 0; rcsta = 0; delay_s( 7 ); for( a = 0; a < 10; ++a ) { porta.1 = !porta.1; delay_ms( 100 ); } porta.1 = 0; asm clrf _pclath asm clrf _pcl // reboot(); } SendStr( "Hello\r" ); } } void SendStr( char *p ) { while( *p != 0 ) { while( txsta.TRMT == 0 ); txreg = *p++; } } Thanks for any suggestions or assistance. RJS
  23. After I upgraded to MPLAB 8.10 I also upgraded SourceBoost to 6.87 and everything is working fine for me, even the ICD2. You may want to trying reinstalling SourceBoost or upgrading to 6.87.
  24. Has anyone tried MPLAB 8.10 with BoostC 6.85? It looks like MicroChip just release 8.10 and I wanted to know if BoostC 6.85 was supported. Thanks, RJS
  • Create New...