This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to conventer unsigned long to BCD code faster?

just as titleï¼
now i'am use this method:
a=value%1000/100;
b=value%100/10;
c=value%10;
but it's slow,any faster methods?
thanksï¼

Parents Reply Children
  • I do not have malicious,I just want to know that no one have a faster way And willing to share. If I were to do so will lead to unpleasant I will stop this kind of behavior

  • Hi ou fuqiang,

    I come from Taiwan. Nice to meet you.

    If you don't mind, I have some suggestions for you.

    When you post something in this KEIL forum, please:

    NOTE: When posting messages, use the following HTML tags to make your message easier to read and understand.

    These HTML tags "b", "i", "pre" are described in the above of your message field, where you type your message.

    And, when you press the "Preview" button, you shoule preview your post to make sure the format/style/indent is appropriate. This is more important when you post your source code. We need to make our posts be easy to read/understand.

    And, if you post your questions twice or more in different forums, people will need to read/answer your questions twice or more, this is wasting people's precious time/resource. So, it is inappropriate.

  • "And, if you post your questions twice or more in different forums, people will need to read/answer your questions twice or more, this is wasting people's precious time/resource. So, it is inappropriate."

    There is nothing wrong in asking the same question on two forums if you cross-link the forums so that users on one forum are aware of the responses people have already given on another forum.

    Without the cross-posting links, many people will spend time giving similar answers, and that will waste not only bandwidth but also the time of the people who do spend time helping out.

    Since time is a scarce resource, help is an even more valuable and limited resource.

  • This is my wrong,I have always thought that browse forum is only when they have free time.
    this is different between china.

  • I'am at 24'20'24.38"N,109'23'17.71"E.

  • Yes, people browse forums when they have free time.

    But see it this way:
    If a student has a problem at school, he may ask the teacher for help. After he has received help, should he then find another teacher and once more ask for help with the same problem - just checking that the two teachers gave the same answer?

    Wouldn't that waste the time for the teachers - time that they could have used to help someone else?

    That is the reason why you should always add links between the forums if you post a question on multiple sites.

    Since you had received two possible solutions to your question, you could have linked to this forum, and asked at 8052.com: Anyone know any better solution than these two, or how they can be rewritten to better take advantage of my specific processor?

  • Please do not angry, I just started browsing forums abroad. lot of Forum habits i don't know. O(-_-)O~
    design of electronic products not my job. now I am DIY electric bicycle speed table. this is my hobbies. the hall sensor given the pulse so fast that i have to find a fast Conversion code.

  • Hi ou fuqiang,

    I don't know the Latitude and longitude of my location.

    I am in southern Taiwan.

  • You do not need to produce a display update for every pulse you get. Our human brain has a limited capacity - it takes a lot of time for us to read, and if you update too often then the last digit(s) on the display will be hard to see because every reading will vary a bit, making the last digit(s) constantly change value.

    If you have a sensor that produces a lot of readings, then you may decide to measure the time of 5 pulse periods instead.

  • if you wish,you can install google earth to find you Latitude and longitude. it's funny.