Binary or decimal?


+ Reply to Thread
Results 1 to 13 of 13

Thread: Binary or decimal?4295 days old

  1. #1
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default Binary or decimal?

    Hi,

    If I want to change a register, for example,

    Code:
    CCPR1L = %11111111
    can I do it,

    Code:
    CCPR1L = 255
    Will it work?

    Regards

    Joseph

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Prolific Poster RGV250's Avatar
    Join Date
    Aug 2005
    Posts
    2,363
    Thumbs Up
    Received: 29
    Given: 7
    Total Downloaded
    1.16 GB

    0 Not allowed!

    Default

    Hi,
    I don't think it matters one way or the other, I always use binary as it is easier to see which bits are set/cleared but for 0 or 255 it would be just as easy.

    Regards,
    Bobby

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default

    Thank you Bobby for reply.

    Actually I am to try to make a variable changing this register that is why I am opting for this method.

    Thank you
    Kind regards

    Joseph

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Fanatical Contributor fanie's Avatar
    Join Date
    Oct 2005
    Posts
    7,989
    Thumbs Up
    Received: 31
    Given: 15
    Total Downloaded
    434.52 MB

    0 Not allowed!

    Default

    Of course you can do that. It's the same value.

    I use binary only for tris, the rest I use decimal, but it won't matter if you use hex, bin, dec, oct or whatevere other format as long as you tell the compiler what it is that you are using and that the value is correct.
    Fanie

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default

    Fanie,

    You know that you caused me all this trouble?

    Remember the 10 bit PWM?

    I am trying it now to do it as per your suggestion a few months ago

    Regards

    Joseph

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Fanatical Contributor fanie's Avatar
    Join Date
    Oct 2005
    Posts
    7,989
    Thumbs Up
    Received: 31
    Given: 15
    Total Downloaded
    434.52 MB

    0 Not allowed!

    Default

    You can always stick to 8 bit if you want.
    Fanie

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default

    Fanie,

    I tried it. Unfortunatly I cannot get more than 312 resolutions. Cannot arrive to 1023. I am loading CCPR1CON bits 4 and 5 (LSB), and CCPR1L (MSB) with a 1024 value but still no joy.

    Regards

    Joseph

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #8
    Fanatical Contributor fanie's Avatar
    Join Date
    Oct 2005
    Posts
    7,989
    Thumbs Up
    Received: 31
    Given: 15
    Total Downloaded
    434.52 MB

    0 Not allowed!

    Default

    The resolution is dependant on the speed, to achieve higher frequencies the resolution is reduced. Have a look in the pdf file, the speeds and resolutions are indicated.
    Fanie

  16. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  17. #9
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default

    Saw that. I begin with 1 MHz and up. varies with 100 only

    Regards

    Joseph

  18. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  19. #10
    Fanatical Contributor fanie's Avatar
    Join Date
    Oct 2005
    Posts
    7,989
    Thumbs Up
    Received: 31
    Given: 15
    Total Downloaded
    434.52 MB

    0 Not allowed!

    Default

    1,000,000 PWM frequency... and up Are you sure ?
    Fanie

  20. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  21. #11
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default

    Sorry Fanie,

    1KHz and up. I am sick since Friday while I was at work and still today. I think I was not thinking/writing what I should want.

    Regards

    Joseph

  22. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  23. #12
    Fanatical Contributor fanie's Avatar
    Join Date
    Oct 2005
    Posts
    7,989
    Thumbs Up
    Received: 31
    Given: 15
    Total Downloaded
    434.52 MB

    0 Not allowed!

    Default

    I always say some people are punished immediately

    While you are recovering from your long sick bed also check up on the lowest PWM freq for the different clock speeds... in the help file.

    At the lower frequencies you should be able to get full resolution. Just remember the HPWM command runs on 8 bits only. After you issued the HPWM command you have to do the nessesary adjustments to the pwm's setup.
    Fanie

  24. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  25. #13
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default

    Yes Fanie as per the pther thread. I will keep trying. BTW. I found a piece of code Les wrote long time ago, I think. I should also try that one and let you know. To be honest, I do not feel comfortable in front a PC at the moment, but, I get fedup doing nothing.

    Regards

    Joseph

  26. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Decimal Digit extract
    By John Drew in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 31st January 2017, 01:38
  2. More than three digits after the decimal point
    By pe1pme in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 23rd December 2015, 21:35
  3. Convert variable decimal to binary
    By Pic in forum Projects discussion
    Replies: 4
    Last Post: 21st February 2015, 22:38
  4. [SOLVED !] 7segment Decimal Point Value
    By willim in forum Proton Plus Compiler v3
    Replies: 11
    Last Post: 26th April 2007, 19:49
  5. [SOLVED !] bcd to decimal
    By ADLIN SYSTEMS in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 31st March 2007, 14:24

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts