• LOOKUP.pbp

    PICBASIC PRO program to demonstrate LOOKUP & RANDOM commands. Converts numeric value to ASCII hexadecimal equivalents.
    ' Name        : LOOKUP.pbp
    ' Compiler    : PICBASIC PRO Compiler 2.6
    ' Assembler   : PM or MPASM
    ' Target PIC  : 12F, 16F or 18F
    ' Hardware    : PC serial connection & terminal for result display
    ' Oscillator  : 4MHz internal or external
    ' Keywords    : LOOKUP, RANDOM, SEROUT
    ' Description : PICBASIC PRO program to demonstrate  LOOKUP & RANDOM commands.
    ' Converts numeric value to ASCII hexadecimal equivalents.
    '
    
    Include "bs1defs.bas"  ' Include BS1 variable and serial definitions
    
    SO Con 0               ' Define serial out
    
    mainloop:
       W6 = W0 : Gosub HexW    ' Print W0
       Serout SO,N2400,[13,10] ' Print end of line
       Random W0		   ' Randomize W0
       Goto mainloop           ' Do this forever!!!
    
       ' Send W6 as XXXX (Uses W5)
    
    HexW:
       Gosub HexB13            ' Print MSB
       B13 = B12               ' Print LSB
    
    HexB13:
       B11 = B13 / 16          ' Print MSB
       Gosub HexB11
       B11 = B13 & 15
    
    HexB11:
       Lookup B11,["0123456789ABCDEF"],B10 ' B10 = HEX$(B11)
       Serout SO,N2400,[B10]
       Return
    
       End
    
               
    Download the file lookup.pbp
  • Recent Forum Posts

    OTL_18F

    18f67j94

    Yes all caps are attached and all Vdd's are at 3.3V All traces were checked from the programming cable to the chip pin legs. All good there. The error

    OTL_18F 6 Hours Ago Go to last post
    tumbleweed

    Unable to program 18F67J94

    What are you trying to program it with? What is the exact error message you're getting?

    All VDD/VSS pins connected, bypass caps installed,

    tumbleweed 7 Hours Ago Go to last post
    OTL_18F

    Unable to program 18F67J94

    Recent upgrade to PBP3 and it is running perfectly with another J-chip(18F26J53). Not so with the 18F67J94. Click program and get "Target device

    OTL_18F 14 Hours Ago Go to last post
    mpgmike

    Question on voltage for programming PIC 18F87K22

    Just finished & shipped a project that works around AC electricity. Though you're right about "usually fine", 10k didn't work for that

    mpgmike 2 Days Ago Go to last post
    Ioannis

    Support for new 18F chips

    Up to this moment I was not able to test the beta version with my K40 chip. I have some programming issues with the ICD3 and Pickit3 along with the unbelievable

    Ioannis 2 Days Ago Go to last post