Jump to content

Alistair George

EstablishedMember
  • Content Count

    50
  • Joined

  • Last visited

Everything posted by Alistair George

  1. Unfortunately with BoostC is you cant copy a line in the output box (to show you the error), it copies the lot. IDE leaves a lot to be desired in some of the detail, easy to do implementation; right click, copy selection, copy all. #pragma DATA _CONFIG, _CP_OFF & _PWRTE_OFF & _WDT_OFF & _INTRC_OSC_NOCLK & _MCLRE_OFF '_INTRC_OSC_NOCLK' does not work for chipset 12F675. I repeat, Its no big deal, and its not a problem. Al. Building... Bullit12f683.c error: invalid pragma DATA argument '_INTRC_OSC_NOCLK' failure Bullit12f683.c failure G:\dev\PIC\SourceBoost\boostc_pic16.exe Bullit12f683.c -t PIC12F675 Exit code was 1. Removing target: Bullit12f683.obj Done
  2. Yessss. . . . . Don't even 'think' its named wrong . . . .! The .h is based on the .INC, autoconverted by John Nagle's inctoh utility then tweaked a little. Always check the header for the actual names to avoid embarrassment . . . . HTH Ian P.S. *Always* use the full name of the PIC to avoid ambiguity. '//675' could be *anything* '// PIC12F675' is unambiguous, AND WILL SHOW UP ON GOOGLE for future readers of this forum! Thanks hopefully that message was in good humor. In microchip directory (MPASM Suite) p12F675.h and as you say its all there. Unfortunately, with the correct '_INTRC_OSC_NOCLKOUT' it still fails even though the correct target is selected - same error message. No big deal, appreciate your advice. Will revert back to the PIC12F683. Al.
  3. Hi I just switched micros, reset the target and changed the following to suit: //683: //#pragma DATA _CONFIG, _CP_OFF & _PWRTE_OFF & _WDT_OFF & _INTOSCIO & _MCLRE_OFF //675 #pragma DATA _CONFIG, _CP_OFF & _PWRTE_OFF & _WDT_OFF & _INTOSC & _MCLRE_OFF Compiler errors with invalid pragma data INTOSC Its spec item, so anyone have any idea why? Cheers, Al.
  4. If he's writing for an obfuscated C contest, he could use a comma operator! Never having used ternary before the sourceboost C manual example is: (volts > 5) ? set_bit(PORTA, LED_bit) : clear_bit(PORTA, LED_bit); Which I creatively applied Cheers, Al.
  5. :-) Okay to be clear: if you don't explicitly initialise a variable, eg, int my_variable; it *will* be initialised to 0 unless you use the command line switch. In a lot of cases it really doesn't matter what the initial value is, you can save memory by not forcing everything to zero. cheers Ian. Actually, I could stand to be corrected on this, but the reason I was initializing was due to some startup numbers not being at zero. Could always be me of course! Cheers, Al.
  6. (++outcount) ? IRQ=0 : {IRQ=1;outcount=65050;} eg if (!(++outcount)) {IRQ=1;outcount=65050;} else IRQ=0; No nesting allowed? Cheers, Al.
  7. Yes we do plan to release beta first. It's not ready yet though. Regards, Pavel There are a whole lot of people using and will continue to use Pspad or Notepad++ and it might make sense to consider your software simulator/debugger be a separate dockable window module, that could be used by both the aforementioned programs? Why suggest this is that those users would consider it a enhancement to be able to continue using their known IDE with your product. Also, it would be great marketing since the simulator needs to have your local library to debug. Thanks, Al.
  8. A single button press will then wake the micro from sleep, run through a bit more initialisation and then start up your application by running main(). Tks, that method is different than what Ive been doing. Mine starts as normal, runs until user presses 3 times within a checked period with debounce etc. It knows its on, so switches off nicely. The the trouble begins - it switches on first press, then while initializing nothing happens for a few seconds so there is no tactile feel for the other button presses. Its running at 125khz. Finally, if you carefully do the 3 button presses, it starts, runs for a while, eats the button presses cycles crazily, then shuts down again. There is a whole lot of stuff going on and I think the heap must get corrupted. Your method sounds more elegant and could work better thanks. Al.
  9. GPIE will only be on if the software makes it so, but agreed, its an irrelevant condition, and yes, I think we need to get together for that coffee because my brains getting fried sorting out all the other conditions happening with these little micros, when working close to the edge.
  10. Hi according to previous C I've used, char variables at declaration were default value 0. It seems that this is not so with BoostC? If not, whats the preferred method to initialise a bunch of variables at same time. eg must one do v1=0;v2=0;v3=0; not v1=v2=v3=0; Cheers, Al PS understood that assigning variables at start can use memory, but only if some of the variables are not being used correct?
  11. Hi I wonder if any of you have been down this track. I want to have a switch off if a user presses a button 3 times (then it goes to sleep). Anything less than 3 presses, its ignored. Once asleep, if they press it once, it wakes up, but if <3 presses its meant to go back to sleep. Its easy enough to get single press switching on and off, but once a bit of logic on the machine state is thrown in it seems to open up a can of worms. Anyone have a tidbit of code that does similar to my above?
  12. Hi David. I just noticed your reply as I got it working due to other settings being wrong. Arent you thinking its a bitwise '&' ??? Its a logical "&&' which is true if GPIE == anyvaluebut0 right? Al.
  13. Hi when the asm is generated is there a switch to include comments/labels from the C code to make following the asm source a tad easier? If so, it goes under Settings/Options/Extra Compiler options? Tks vm. Al
  14. Hi knowing that the new IDE is on its way, would you like to make it a public beta by releasing the url here?
  15. OK good on you. I dont mind being picked up. I was hoping my effort would have been of some use to someone who came unstuck like I had. It has, because you have improved the statement to make it accurate! Thanks and kind regards, Alistair+ PS any chance of telling me whats wrong with my code here: http://forum.sourceboost.com/index.php?showtopic=4397
  16. Using ver 6.96 for a few days what I have noticed. BoostC help in PDF is great, but BoostIDE help online is not. I would happily make you a PDF version of the helpfile as swap for a license. If you provided the changes for new version would integrate those too. Your wizard interface on notebook is way too big - lower section is obscured and the window is not sizeable so wizard does not work! What I think would help, probably already done ;-) To have the 'comment section' under menu item Settings is illogical. It should be in the right-click menu. You could have comment/uncomment function. I'd like to see more hotkeys user definable under settings eg delete line ctrl-y Auto-indent. Wizard looks to have good potential, but should have many more cpu types. As a newbie to your product when I saw it, I though wow! then ho-hum as no processors that I'm using are similar. Plenty more, but thats enough for now. Nice product. Al.
  17. Hi. This is quite intriguing. Wanting to use MCLR as interrupt port change state - its set high. Tried this: ioc.3=1; intcon.GPIE=1; //enable IOC bit for GP3, then GPIE //in ISR checked for state when button pressed high to low thusly: if (GPIE && intcon.GPIF) //nosuch IRQ not being called The logical port to use would be GP2/ext int port, unfortunately thats taken for something else. If not possible on GP3 perhaps GP4/GP5 but have to turn off oscillator gates to stop internal oscillator and set the port high with weak pullup. Have had no joy there either. If anyone can point me to more information appreciated tks. Alistair. sri - this should have been in the BoostC category
  18. Hi I had some old code which turned out to be faulty when used with BoostC. void interrupt(void) { // clear_wdt(); // Timer0 Interrupt if (T0IE && T0IF) //always true { tmr0=tmr0_offset; clear_bit( intcon, T0IF ); // Clear T0IF every time } //Button press if (INTE && INTF) //always true clear_bit(intcon,INTF); } // Timer2 Interrupt // ... if (TMR2IE && TMR2IF) //always true { clear_bit( intcon, TMR2IF ); // Clear T2IF every time } } Change to this: void interrupt(void) { // clear_wdt(); // Timer0 Interrupt if (T0IE && intcon.T0IF) { tmr0=tmr0_offset; clear_bit( intcon, T0IF ); // Clear T0IF every time } //Button press if (INTE && intcon.INTF) clear_bit(intcon,INTF); } // Timer2 Interrupt // ... if (TMR2IE && intcon.TMR2IF) { clear_bit( intcon, TMR2IF ); // Clear T2IF every time } } Note the intcon.
  19. SOLVED - wished I could delete this. Caused by not noticing incomplete build of source //#define timedisplay #define operational //the following code runs even though above is set on operational define #ifdef timedisplay if (hours<1) MatrixOut(led3,25); if (hours.0) MatrixOut(led0,25); //Turn LED on for 1 sec if (hours.1) MatrixOut(led1,25); //Turn LED on for 1 sec if (hours.2) MatrixOut(led2,25); //Turn LED on for 1 sec if (hours.3) MatrixOut(led3,25); //Turn LED on for 1 sec if (hours>15) hours=0; #endif; What am I doing wrong this time? Thanks. Al.
  20. Hi. Sourceboost information does not expand on clock_freq description and I have never understood. Would someone please advise: 1..on a PIC12f683 clock oscillator internal is 8Mhz. 2..I have selected prescale value of 125khz, which is determining the system realtime clock speed/INTOSC. Is #pragma CLOCK_FREQ 8000000 is correct for this setting; or should it be 125000? Tks vm. Oh, also, is there no call to wdt eg if (!_wdt) //watchdog turned off Assume that has to be if (!wdtcon.0) //wdt is turned off and to turn it on and off wdtcon.0=1 wdtcon.0=0 Also, for those who read this post note that WDT must not be enabled in #pragma if you want to control its setting on and off. EG must be & _WDT_OFF PS finding you chaps on this forum very helpful thanks. As a side note; I have been wasting weeks on another compiler which let me down badly. In one day I have made huge inroads with BoostC - a great tool.
  21. Please dont worry I may have found what the problem is on the debug machine the code read: void Startup(void) { delay_ms(10); osccon = 0b01100001; //Set oscillator to 4MHz while(!osccon.HTS); // wait 'til oscillator stable It was never getting over the last statement. Will advise if that was not the problem. Perhaps this CPU does not flag the HTS when ready, as HTS is not mentioned in datasheet.
  22. Greetings. #pragma DATA _CONFIG, _CP_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC & _MCLRE_OFF CPU 12f683 Appreciate reply. Perhaps if I could get a suggested setting known to work with this internal osc, then I'd try that and move on from there. Definitely the processor is fired up and able as if I force a call to display, that functions fine, the display should be polled after the timer IRQ in normal configuration. Kind regards, Al. void main(void) { Startup(); while(1) //{delay_s(1);++hours;Display_Status();} //This test line works display fine if (T0flag){Display_Status();T0flag=0;} //T0flag set by IRQ }
  23. Thanks vm chaps. No, just wondering what the error meant; youve sorted it so appreciate.
  24. Hi I have been using other tools and have had no problems getting IRQ to work. However, Boost is not happy with my init code and I dont know why. Startup is called from Main(). Can anyone advise where i am going astray? void Startup(void) { delay_ms(10); osccon = 0b01100001; cmcon0 = 0x07; // comparator off, digital I/O ansel = 0; // a2d module off, digital I/O trisio = 0b00100000; // set all pins to outputs gpio = 0x00; // set all output latches to '0' intcon.GIE=1; //Set Timer0 mode clear_bit(option_reg, T0CS ); //configure timer0 as a timer //Set prescaler assignment clear_bit(option_reg, PSA ); //prescaler is assigned to timer0 //Enable interrupts (Timer0) intcon = 0xA0; } It never reaches void interrupt(void)
  25. asm MOVLW 0x0000111; asm OPTION; ???????? Thanks, Al.
×
×
  • Create New...