Jump to content

Alistair George

EstablishedMember
  • Content Count

    50
  • Joined

  • Last visited

Posts posted by Alistair George


  1. Some months ago I asked if it would be possible to make the old Sourceboost C2C compiler available again which supported the PIC12 12 bit core. I don't want to distract Dave and Pavel before BoostC V7 is out and debugged, but if enough people are asking for 12 bit core support something might happen . . . There would need to be enough documentation for the community to be able to add new devices as I think the Sourceboost team would prefer not to have to support an obsolete product.

    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?


  2. 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,


  3. Thanks Reynard, that what the problem was. My version of the manual (which I thought was current) still has the old file names. It looks like the compiler tried to correct itself since the Link name was changed, but the compile name was still the old one.

     

    I'm up and running and getting ready to fire up a PIC Kit 3 after using my beloved Wisp628 and the really nice SourceBoost IDE for years. I am hoping that the debugging capabilities of MPLAB will be helpful now that I am getting better with the PICs. I feel like a traitor leaving the SB IDE, but I am still a strong supporter of the Compiler -- plenty of bang for the buck and very user friendly for the newbies.

     

    Regards

    Rye

    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.


  4. 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.


  5. 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.

     

     

    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.


  6. 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);

    }


  7. 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.


  8. 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.


  9. 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;
    }


  10. 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.


  11. I notice the PIC10F206.INC file amongst your list of files.

    I hope you don't intend to run the C code on that chip because if you do you're in for a rude shock.

    The PIC10 series are not supported by SourceBoostC as they don't have enough resources to run code compiled under C.

     

    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'


  12. You aren't starting from a Microchip AN by any chance? Some of them are NOT well written and at least one of the hardware ones has actually been dangerous!

     

    There also seem to be problems actually getting any reported bugs in them fixed.

     

    *PLEASE* verify correct operation 'as is' before attempting conversion . . . .

     

    Also, just because it cant be googled, doesn't mean it isn't out there. Give us a link to the source, and just maybe someone may have already done this chore . . . and if not, we can at least see the larger context round your next question.

     

    Ian

    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.


  13. Al.

     

    If you are going to check an interrupt flag in a main() function rather than in interrupt() then DO NOT enable the interrupt. The interrupt flag gets set regardless of the state of its enable. Also don't forget to clear the flag when read.

    BTW Using an interrupt to wake from sleep with a button press might be your only option.

     

    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.


  14. Hi davidb

     

    I agree that depending on the requirement, there are different ways of doing things, no problem there.

     

    I see so many code snippets posted which seem unnecessarily complex, or bloated, that from time to time I feel compelled to put in my 10p worth.

     

    In all cases writing robust, easy to comprehend, code provides the basis for reliable operation.

     

    Cheers

     

    Tim

    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...