Shop OBEX P1 Docs P2 Docs Learn Events
Bug with PropBasic ? — Parallax Forums

Bug with PropBasic ?

$WMc%$WMc% Posts: 1,884
edited 2010-06-25 01:00 in Propeller 1
Hello all

·I not sure if its a bug or I'm doing something wrong.

When I send out a VAR like this·%0000_0001 I'll get this·%0000_0001 back?, If I send %1000_0000 then·I'll get this·%0001_0000 back.
This is messing up all of my shift reg. code and my SEROUT/IN code.

In the test the LSBs come in order %0000_3210. But the MSBs are reversed %4567_3210 with the buttons pressed in order from pin7..pin0.
Yes the LED pins are in order from pin15..pin8 ???

·I have attached a sample code using LEDs and buttons to show this in more detail.

Any help with this would be great!!!

Thanks in advance

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA


want speed?·want·to use the Propeller?·want to stay with BASIC___www.propbasic.com___


You can feel stupid by asking a stupid question or You can be really·stupid by not asking at all.

Comments

  • JonnyMacJonnyMac Posts: 9,208
    edited 2010-06-23 02:34
    Help with what? Your program works exactly as designed. [noparse];)[/noparse]

    That said, I simplified it like this:

    Start:
      Leds = %0000_0000
    
    Main:
      bStates = Buttons                             ' capture buttons
      bStates = ~bStates                            ' invert
      Leds = ~bStates                               ' out to LEDs
      DELAY_MS 250
      GOTO Main
    
      END
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • BeanBean Posts: 8,129
    edited 2010-06-23 02:53
    I assume you posted the wrong code ?

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
  • $WMc%$WMc% Posts: 1,884
    edited 2010-06-24 02:38
    Bean

    Well; ·Now I'm really confused. I don't see why the first 4 bits on the right are in order and the second 4 bits on the left are reversed?

    ·I have included a hardware drawing of what I have set-up on the Propeller Pro. Dev. Board and a little chart to show the LED that gets lite from what button is pressed in the code I posted earlier.

    ·If You can find the time to look at My little drawing posted below,I would really appreciate it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA


    want speed?·want·to use the Propeller?·want to stay with BASIC___www.propbasic.com___


    You can feel stupid by asking a stupid question or You can be really·stupid by not asking at all.
    1202 x 880 - 71K
  • JonnyMacJonnyMac Posts: 9,208
    edited 2010-06-24 03:31
    I used the PPDB to test your program and found no problems -- but I have an idea. Are you using the push-buttons in the lower right corner? Since they are split into two groups of four you may have accidentally crossed one up. It's easy to do (ask me how I know...).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • BeanBean Posts: 8,129
    edited 2010-06-24 10:16
    The schematic helps alot to understand what you are doing.

    I've looked at the generated code, and I don't see anything wrong.

    Like Jon suggested, triple check your wiring.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
  • Christof Eb.Christof Eb. Posts: 1,247
    edited 2010-06-24 11:03
    Hi Bean,

    I was just curious, what the compilation result is.

    (I do think too, it should be a wiring issue here.)

    But I have seen, that every LED line is switched to LOW for the time of one instruction.

    ················· mov·········· __temp1,ina················· '· LEDs = buttons
    ················· and·········· __temp1,buttons············
    ················· shl·········· __temp1,#8·················
    ················· and·········· __temp1,LEDs···············
    ················· andn········· outa,LEDs·················· <<<<<<< switch to low!!!
    ················· or··········· outa,__temp1

    I think, this is a trap, because it can generate very short additional pulses.

    Christof
  • BeanBean Posts: 8,129
    edited 2010-06-24 11:38
    Christof,
    Yeah, I know, it's just that it takes two more instructions to do it glitch-free.
    I guess I should change it though....

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
  • $WMc%$WMc% Posts: 1,884
    edited 2010-06-25 01:00
    Thanks for the Replies

    After reading Your post replies, I started investigating My wiring further.My wiring was good. I had some other devices on the board and some of them were wired to the I/O pin groups in the VGA pin group of the PropProDevBoard. None of these pins where shared (only 1 jumper wire per pin) But I seem to remember mixing resistors for the VGA output.

    I know now this is a hardware issue and not a PropBasic software issue.

    I now have a working code that does what I expect it to do.(with the other hardware devices removed)

    Many Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA


    want speed?·want·to use the Propeller?·want to stay with BASIC___www.propbasic.com___


    You can feel stupid by asking a stupid question or You can be really·stupid by not asking at all.



    Post Edited ($WMc%) : 6/25/2010 11:13:05 PM GMT
Sign In or Register to comment.