ascii conversion help needed


Results 1 to 13 of 13

Threaded View

  1. #9
    Join Date
    Jun 2005
    Location
    Up the bush, Western Plains, NSW Au
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Hi again Darrel,
    All that stuff worked a treat. Thanks.
    Now there is a follow up to that series.
    Now that I am getting 5 bytes to play with, I am simply generating a 4 digit decimal code by taking the last numeral from each of the bytes (decimalised) ((along the lines of dec1 card(1) dec1 card(2) dec1 card(3) dec1 card(4)))
    This works fine, as long as I am sending these numerals out serially or sending to an LCD. What I am having trouble with is sending the bottom half of the decimal byte to a port. The byte should be %0000xxxx where xxxx is the decimal 0 - 9 in binary. Right so far??
    It seems to me that I can't qualify the byte as dec1, BIN4 or anything like that when I am not sending it to the port. I have tried portb = var AND %00001111 which to my way of thinking should mask off the top nibble but what I get out of the port is a full byte of 1's with no resemblance to the numeral that can be deciphered at all.
    I got a few other things to try, so I'll be back.
    I'll have a look at BCD and see if I can make that work.
    Last edited by muddy0409; - 10th January 2007 at 17:17. Reason: more info added

Similar Threads

  1. ASCII to Long conversion
    By TerdRatchett in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 5th March 2009, 23:43
  2. A/D conversion problem in 18F2520, 2523, 2550 etc.
    By selimkara in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 10th March 2008, 16:26
  3. SerIn2 ASCII Conversion
    By rwskinner in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 4th March 2008, 21:41
  4. ASCII Viewer Needed
    By sougata in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 19th January 2008, 05:29
  5. Conversion of 10-bit word into ASCII
    By Barry Johnson in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th January 2005, 14:26

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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