POOKECODE and PEEKCODE


Closed Thread
Results 1 to 15 of 15
  1. #1
    Join Date
    Apr 2008
    Posts
    85

    Exclamation POOKECODE and PEEKCODE

    HI,

    my PBP does not recognize the PEEKCODE and POKECODE. so any hint can help
    thanks

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Question

    Hi, MINHLE

    Will you post a relevant piece of code ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    the code is very simple. but the words: peekcode and poke code are not bolded and capitalized automatically (i.e. they become: PEEKCODE and POKECODE
    ----------------

    CMCON = 1
    TRISA = 0
    TRISB = 0

    I VAR BYTE
    OUT_STORAGE VAR WORD ; OUTPUT STORRAGE TEMP.
    address VAR WORD

    LOOP:

    PORTA.1 = 1 ;RESET 4017
    PORTA.1 = 0
    PORTB = 0 ; set port B all zero
    address = $11 ; storage data location beginning here



    FOR I = 0 TO 1 ; loop 2 times

    peekcode address , OUT_STORAGE ; retrieve data ready for output
    PORTB = OUT_STORAGE ; output data by port B
    address = address +1 ; fetch the next data
    PAUSE 10 ; pause for 10ms
    CALL CLOCK ; call clock of 4017

    NEXT I

    GOSUB LOOP

    clock:

    porta.0 = 1 ; clock the 4017
    @nop
    porta.0 = 0
    RETURN

    END

    pokecode @address, $55,$2A
    ;
    ;note that the peekcode and pokecode is not capitalized and bolded automatically as the other keywords i.e. PEEK or POKE

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Question Strange, you said strange ???

    Hi, MINHLE

    1) address = $11 ; storage data location beginning here
    pokecode @address, $55,$2A

    Very Strange ... as the table might be located at the program END ( see manual ... ) you are right into the PBP "macro" 's locations !!!

    2) Those commands did not ever exist ... which version of PBP do you work with ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    Hello,
    the manuel said place the pokecoke after the END "FOR THE REASON OF INTERRUPTION OF FLOWING PROGRAM".

    anyway, the PBP does not recognize the functions PEEKCODE and POKECODE. then issue the compile error

    whatever wrong with the code, the keywords should be in upper and bold automatically, similiar to other keywords or functions

    in this case i assume there are no such FUNCTIONS IN THE PBP COMPILER.

    THANKS FOR YOUR ATTENTION,
    i keep looking for answer

    p/s the version i do is 3.0.0.5
    regards
    Last edited by MINHLE; - 7th December 2009 at 16:00. Reason: add answer:

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Question

    Question 2 was ...

    2) Those commands did not ever exist ... which version of PBP do you work with ???
    ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    hello Alain,

    in the PBP the version is 3.0.0.5. (melab programmer and Picbasic pro compiler)
    and also in the manuel book mentions to those commands.


    thanks Alian,

    regards,

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink

    ... soo simple

    Pokecode DO NOT accept a variable as address ...

    Obvious !

    Once corrected ... compiles fine.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    thanks ,
    i try it

    regards,

  10. #10
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    Hello agian Alian,

    if POKECODE does not accept address avariable it becomes POKE.

    in the case, i store serveral data in the POKECODE function.
    i try it but only the datum stored at the specific location is shown up i.e at the location $11 that is $55;

    i.e. i can write: POKE $11, $55, $2A

    The output is only $55 (after compile)
    but if i wrire

    POKECODE $55, $2A ( location address is empty or a constant)

    PEEKCODE ??? , OUT_STORAGE ( ??? Mean which address: the first datum is retrieved only, that is $55

    and in case i would jump to the second location to pick up the datum (i.e. $2A) of that location how can I do?

    I believe i do not have those functions?

    thanks
    regards,

  11. #11
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Thumbs down

    Really interesting point of view ... "this explains that ... "

    have a good evening.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  12. #12
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    hello ALain,

    youa re right.

    the variable does nothing on the POKECODeE. after refresh my mind i relize taht. misunderstanding the address

    thanks again for your help

    regards,

    the address

  13. #13
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi, Minhle

    May be you might try the WRITECODE Command

    a good night somtimes Helps ... to understand what is looked for. LOL

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  14. #14
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    Hello Alain,
    thanks, both EEPROM and DATA, WRITE and READ are work well

    regards,

  15. #15
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default pokcode redo

    hi ,can someone help to see where is problemes are
    the output is only the first byte of data stored in a table
    pic16f877A

    ADCON0 = 0
    ADCON1 = 7
    define osc 20

    trisB = 0 ' SET PORTB AS OUTPUT
    PORTB = 0 ; SET PORTB t and C to 0
    trisc = 0
    portc = 0

    trisd = 0 ; 2 pins of this port is for reset and clock


    erasecode $500 ; erase code space @$500 (page 0)

    B0 var word
    StrAddr var word
    F0 var byte
    E0 var byte
    k var byte
    LOOP ; this loop display the value stored in the flash
    b0 = 0 ; initial value
    FOR StrAddr = 500 to 505 step 2 ; read a word
    call display
    NEXT StrAddr
    goto loop
    '--------------------

    DISPLAY:
    Peekcode StrAddr, b0 ; fetch a value from table
    f0 = b0.lowbyte
    e0 = b0.highbyte
    call output1
    return

    '-----------
    output1:
    for k = 0 to 30 ; output 2 ports of B and C
    call reset
    portb = f0
    portc = e0
    call delay
    next k
    return

    '-------------------------------------------------------
    RESET: PORTd.2 = 1 ;RESET 4017 pin 16-PIC
    @NOP
    PORTd.2 = 0
    RETURN
    '-----------------------------------------------------------
    DELAY:
    pause 1 ;
    portb = 0 ; reset portb , c
    portc = 0
    portd.3 = 1 ; clock the 4017 pin17-PIC
    @nop
    portd.3 = 0

    return
    end


    pokecode @$500, $2a,$55 ,$55, $2a ,$55 ,$2a ; store data in flash mem

    thnaks for all reply,

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