Shop OBEX P1 Docs P2 Docs Learn Events
PNUT issue with INA? — Parallax Forums

PNUT issue with INA?

rjo__rjo__ Posts: 2,114
edited 2015-11-17 04:08 in Propeller 2
When I do this it works fine
setb     outa, #25
setb    dira,#25


when I do this it works fine
mov   temp,#0
wrlut ##$FFFFF,temp

when I do this it works fine
mov   inna,##$FFFFF
mov   temp,#0
wrlut inna,temp


BUT not when I do this...
mov   inna,INA
mov   temp,#0
wrlut inna,temp

Gives $FFFF FFFF
Using P123 A7 with fix
I have tried every addressing mode for INA... so that isn't it. So, what is it?
:)







Comments

  • What is INA connected to on the hardware side? If none of the pins go anywhere, then $FFFF_FFFF would not be a suprising value to get.
  • rjo__rjo__ Posts: 2,114
    I have two input pins connected to +V3.3 on the header and one output pin connected to an LED... which lights correctly. The rest are floating. The +V source is fine.
  • rjo__rjo__ Posts: 2,114
    I'm hoping that it is just an issue with my board. But it is weird enough that I thought it was worth mentioning.
  • rjo__rjo__ Posts: 2,114
    When I look at INB in a similar way... pins 15 and 16 are the only ones that change to zero... even though nothing is hooked up:) V+ to other pins has no effect.

    Do I have to declare pins as inputs? My understanding is "no" and that INB should show the states without any fuss... as on the P1.
  • rjo__rjo__ Posts: 2,114
    I have serial working fine... using pins 62 and 63. And I have video working fine in the same program.
  • At the beginning of your code, put a WAITX ##25_000_000 and see if that works for you. Several weeks back, there was an issue reading inputs unless a large delay was inserted. I am not aware of a resolution to that issue, so you may be encountering it here.
  • Rich
    INA is working Ok on my P123-A7 board
    All pins tested Ok as inputs (INA 0..31)

  • rjo__rjo__ Posts: 2,114
    Thanks guys. I did what I was supposed to do.... have a beer and go to bed.

    This morning, I retried everything and get the same. I have to believe that it is the board. Problem is that every other time I have believed this (except once)... it wasn't the board; it was me.

  • rjo__rjo__ Posts: 2,114
    if I look at #INA, I do get $1FE, so INA is where it is supposed to be;)
  • cgraceycgracey Posts: 14,133
    rjo_, are you still experiencing trouble?
  • rjo__rjo__ Posts: 2,114
    nope:)
  • rjo__rjo__ Posts: 2,114
    neglected to pull down my pins. Which is probably the mistake I was also making with my P1V project. BUT I still can't figure out how to rotate (x32,y32) by theta
  • rjo__ wrote: »
    BUT I still can't figure out how to rotate (x32,y32) by theta
    Rich
    Use QVECTOR to convert your x,y values to Ro,theta.
    Use QFRAC to convert angles to 32 bit values.
    and use QROTATE to get back x, y values from a R0,theta pair.

    Something like this:
    		qvector	#50,#50		'x=50,y=50
    		getqx	ro		'ro = $47 = 71
    		getqy	theta		'theta = $20000000 = 45 degrees
    
    		qfrac	#12,#360	'convert 12 degrees
    		getqx	angle		'angle = $08888888
    
    		qrotate	ro,angle
    		getqx	new_x		'new_x = $45
    		getqy	new_y		'new_y = $f
    
    
    Hope this helps :)
    Brian

  • rjo__rjo__ Posts: 2,114
    I thought I tried everything:)
  • cgraceycgracey Posts: 14,133
    SETQ Y
    QVECTOR X,ANGLE
    ...
    SETQ Y
    QROTATE X,ANGLE

    If the SETQ is missing, then 0 is used for Y.
Sign In or Register to comment.