Jump to content

Alistair George

EstablishedMember
  • Content Count

    50
  • Joined

  • Last visited

Everything posted by Alistair George

  1. Easy to do, have made the mistake several times over the years. Also easy to flag as 'Warning - possible conditional error': void buttonpress (void ) { unsigned char keydelay = 0; tcount = 0; if (CmdState=3) return;
  2. Hi Ian. I did not know such a thing existed. Ive been really happy with BoostC and have been waiting for firming up of a project eg money coming in before buying it. Typically, the sales people have moved the goalpost and my design using a 12F683 is too expensive for them, they want to sell a unit for $10 retail, which means we have to use the 10F family. I'm just wondering how hard would it be to tweak the ASM code generated by BoostC to fit 10F; have you tried this Ian?
  3. While reading the IDE manual I noticed this: other compilers, debuggers, and simulators. We know how to do this and we are good in doing this. For more details send a mail to support@sourceboost.com with a short description of the kind of customization you are looking for. Please consider enabling user addition of other compilers for the new IDE? I'm not a fan of MPLAB or Hitech and have to use another compiler for the 10F series, preferably using SourceBoost IDE. Thanks,
  4. Hi Rye. MPLAB gave me problems with being able to watch variables in that it does not list them for watching, and is a known problem. Seems you have to copy the asm source to MPLAB local directory in some cases. Kind regards, Al.
  5. Hi any comments on the following: bool test; test=~test;//result in compliment of test eg if before=true now=false Referring to bit operator: NOT This operation is performed on a single bit. Its result is the inversion of the actual value of the bit: if it was set to 1 it becomes 0, and if it was 0 it becomes 1: However, in BoostC its used as a urinary operator, which results in if (test==0) test=~test; //test==1; if (test==1) test=~test; //test==1; To compliment a boolean assume I use: test=1^test; Thanks. Al.
  6. Ctrl+Shift+L Take a look at the "Hot Keys" chapter in SourceBoost users manual. Regards, Pavel Had previously looked at hot keys, but 'remove line under cursor' is a new connotation; had looked for 'delete' and anything else that went with it. Normally called 'Delete Line'. I have modified and made a PDF users manual from previous source. Cant upload it here; 50k is too small. Lets know how you want it. Later when I have time, and the new IDE is ready, can do that for you if desired. Tks, Al.
  7. Regretfully, having trouble with this: //declaration returns compile error: "Error, missing right paren" divby2n(unsigned char &avlotemp,unsigned char &avhitemp,unsigned char divisor); //function divby2n(unsigned char &avlotemp,unsigned char &avhitemp,unsigned char divisor) { do { avhitemp>>=1; avlotemp>>=1; divisor>>=1; } while (--divisor); }
  8. Just wondering why register names need be referred to in lower case when the datasheets are capitalised? Guess that the register name is needed to precede the bit to help bank switch for compiler. EG expected setting bit would be TRISA0=0; rather than trisa0.0=0; Unfortunately, dont have luxury of library. Thanks, Al.
  9. This is a naive question, but there is nothing in the manual about, and surely there is a better alternative than select line, Del. Ctrl-Y does not work. ? Al.
  10. Yes, I guess your are right; its just the Scots ancestry in me and a penchant for DIY :-(
  11. Hi Ian. Its a requirement for the lower pin count because there will be several thousand devices used. It looks like the only method thats practical at the moment is to take part of your suggestion of using an alternate part, and workaround by defining the different parameters. Using a self built debug board which plugs into a development board using DIP socket. Thanks for confirming there are no alternatives. Cheers, Al.
  12. Hi I wish to debug PIC12F683/PIC10F206/PIC16f684, which require a header part ICD Header, AC162059 etc which is quite expensive. Does anyone have any information for clone or alternatives which enable debugging the various chips that need header connectors? Thanks vm, Al.
  13. OK tks. To clarify for others who read this thread if they are as BoostC illiterate as I: To return values from function you must still specify the values, even if not used eg: to get the value of busy: delaymsec(0,0); returns true if the function has busy set. Actually the plot thickens (or I) The function is meant to be re-entrant eg if a interrupt calls the function, and its already being used, it should return busy as true. So I trust this is secure coding: //From IRQ service routine: if (delaymsec(0,0)==0) delaymsec(100,0); //allow the function if not being used elsewhere. void delaymsec(unsigned char delayms,bool &busy) { unsigned char temp; if (busy==1 || temp==0) return busy; //exit function to caller with busy else busy=1; do { temp=249; do clear_wdt();while(--temp); } while(--delayms); busy=0; }
  14. Thanks vm. Sorry to be pedantic, but to refer to your last example of the function: void delaymsec(unsigned char delayms,bool &busy) on the calling side: delaymsec(); would return the value of busy, with no error for the missing parameter delayms? Tks, Al.
  15. Hi the BoostC guide gives very little info about functions. Please advise for the following: as I understand: void delaymsec(unsigned char delayms,bool busy) Would return nothing, as a proceedure. delaymsec(unsigned char delayms,bool busy) Would return values in delayms and busy is it possible to also make one parameter optional eg if delaymsec(); //returns value of bool busy only Tks, Al.
  16. No, I realised that thanks. Its a pity BoostC does not support this set as they are probably just as popular as any of the others. Arch rivals are also quick to point out to their potential customers 'oh, by the way, make sure you check out what sets the compiler supports; ours supports all including the 12F series'
  17. OK here are the links (on my dropbox) there is a C source, but thats not the one Im interested in: http://dl.dropbox.com/u/1541849/Cap_Sense.h http://dl.dropbox.com/u/1541849/Cap_Touch727.c http://dl.dropbox.com/u/1541849/P10F206.INC http://dl.dropbox.com/u/1541849/Vars.inc http://dl.dropbox.com/u/1541849/10Ftouch.asm These files wont be up permanently. Cheers, Alistair.
  18. All good stuff. I'll post the end result up here when I've finished and let you pick the eye teeth out of it. Eventually well end up with another component that will be useful to those using BoostC et al. Its a touch sensitive app for PIC; there are no C code around, so having to do this. Cheers, Al.
  19. I have searched but cant find how to assimulate the Carry flag in C eg decf averagelo movlw .255 xorwf averagelo,w btfsc status,z decf averagehi //C --averagelo; averagelo=averagelo ^ 255; //here is where the carry flag check is needed. asm btfsc status,z --averagehi;
  20. What I'd done was Timer0 only in the interrupt. Keypress IRQ was enabled, bit checked and cleared in main. So I'll disable the keypress interrupt and just check and clear the flag in main thanks vm Al.
  21. The assembler sequence movlw .255 movwf temp2 would indeed be equal to temp2 = 255 Thanks, thats exactly how it was, and how I'd put it. Appreciate. Al
  22. Could anyone help please whats the equivalent of Move Literal as below: movlw .255 and gatedtime equ .33 Can I just ignore the decimal point? So I would 'assume' the following equivalent to above #define gatedtime 33 temp2=255; Tks, Al. Tks, Al.
  23. I like it; thinking outside the square. Yep, I have a main loop which is forever shooting off to IRQ then returning with the IRQ flagging relevant IRQ proc. It would make sense to enable desired interrupts, and check some in effected subroutines instead. EG why go to IRQ for buttonpress, as you suggest, when it can be tested anywhere else? Cheers, Al.
×
×
  • Create New...