Searching \ for '[SX] sx48 proto board and noise' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/ubicom/devices.htm?key=sx48
Search entire site for: 'sx48 proto board and noise'.

Exact match. Not showing close matches.
PICList Thread
'[SX] sx48 proto board and noise'
2007\07\29@212204 by capdiamontn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, capdiamont wrote:

I have a sx48 protoboard with sx key. The code seems to work great in debug with no hardware attached, until i added a button.

pull up resistor is enabled, but watching the pin in debug, it goes crazy. The lead to the button is about 1 to 2 feet. I want to install this in to an old UPS case, I thought the long lead would make it easier. Long day working with my mistakes, 1st sx program.


code:
DEVICE          SX48, OSC4MHZ
IRC_CAL         IRC_4MHZ
FREQ            4_000_000

' -------------------------------------------------------------------------
' IO Pins
' -------------------------------------------------------------------------
' PORT RA 4 bit reserve for serial on all programs, unused set to outout low
' port rb 8 bit, input
' port rc 8 bit, output
' port rd and re 8 bit, unused set to output, low

' -------------------------------------------------------------------------
' Constants
' -------------------------------------------------------------------------
'flash delay time, wait period between on/off, word size
MaxDelay CON 1000

' -------------------------------------------------------------------------
' Variables
' -------------------------------------------------------------------------
'delaytemp, wait time counter, word size
DelayTemp Var Word
'mode, on/off bit size
ModeTemp Var Bit
watch DelayTemp
watch ModeTemp
' -------------------------------------------------------------------------
'  INTERRUPT
' -------------------------------------------------------------------------
'ISR_Start:
 ' ISR code here
'ISR_Exit:
' RETURNINT ' {cycles}                                

' =========================================================================
 PROGRAM Start
' =========================================================================
'Pgm_ID:
' DATA  "LightHouseVbeta0.01", 0

' -------------------------------------------------------------------------
' Subroutines / Jump Table
' -------------------------------------------------------------------------
' OnMode SUB 0

OnMode:
rc.1 = 1
if DelayTemp >= MaxDelay then
toggle rc.0
DelayTemp = 0
endif
DelayTemp = DelayTemp + 1
' DelayTemp = 255
' Return
goto Main
' -------------------------------------------------------------------------
' Program Code
' -------------------------------------------------------------------------
Start:
 ' initialization code here
TRIS_A = %0000 'outputs %=bitwise
TRIS_B = 255 'input dec
TRIS_C = 0 'output dec
TRIS_d = 0 'output dec, unused
TRIS_e = 0 'output dec, unused
PLP_b = 255 'MAKE rb port PINS PULLUP RESISTOR ON
' ST_B = 255 'make rb port pins schmitt trigger
ra = 0 'set putput low
rc = 0 'set output low
rd = 0 'set output low
re = 0 'set output low
' on/off swtich =rb.0
' lighthouse = rc.0
' pump = rc.1
Main:
 ' main code here
 ' modetemp/delaytemp/maxdelay
 if rb.0 = 1 then
   toggle ModeTemp
 endif
 if ModeTemp = 0 then
   rc.0 = 0
   rc.1 = 0
 endif
 if ModeTemp = 1 then goto OnMode
 GOTO Main
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205092
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)

2007\07\30@053406 by beann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

PLP_B = 255 actually turns the pullups OFF. PLP_B = 0 would turn them on. (I know it's not the way you would think it works).
Your best bet is to use the PIN definition.

I have modified the program to what I THINK you are looking for.

Bean.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205092#m205138
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)

2007\07\30@073221 by capdiamontn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, capdiamont wrote:

I have cut and pasted your code in, but it doesn't seem to work. give me some time to look through things, gota go to work.

I had the tris in the pins section of the template before, but when doing say rc = 255 it wouldn't make the pins go high. When putting the tris after the start it made rc = whatever to work as expected.

Looking at your code through debug, it makes rb = 255 / all pins high. Does this mean ispressed needs to be 0 and rb.0's button gets hooked to vss(ground)?

using version 3.2.3 of editor is there any modifications of the board I should do?

do i need to pass variables to the OnMode sub, such as DelayTemp?

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205092#m205151
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)

2007\07\30@073357 by capdiamontn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, capdiamont wrote:

also I thought plp worked like pullup, 1 to enable. That is why I thought plp_b should of been 255.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205092#m205152
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)

2007\07\30@080918 by beann/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

Yeah if you button is connected to ground then change PRESSED to 0.

Bean.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205092#m205160
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)

2007\07\30@093641 by capdiamontn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, capdiamont wrote:

The reason I asked is that after getting the RB pullups actually on, the RB show up as high, and thus in order to change state, I have to now make the button connect to ground in stead of +5.

Note I'm at work, just couldn't resist. Will have to wait until after 5pm California time, for further diag.

Thank you for your time, you have been above outstanding. Seems like many of you live here.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205092#m205170
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)

2007\07\30@113111 by beann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

[Quoting: "Capdiamont"]
Note I'm at work, just couldn't resist. Will have to wait until after 5pm California time, for further diag.
Thank you for your time, you have been above outstanding. Seems like many of you live here.
You're Welcome, and I wish. I live in PA (not by choice).

Bean.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205092#m205200
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)

2007\07\30@220258 by capdiamontn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, capdiamont wrote:

Actually I was thinking you all seem to live inside the board.

Code seems to work fine as below, but weird thing is it seems to hang on the pause statements in debug, thus commented them out.

Next to connect the SSR's to the output.


' -------------------------------------------------------------------------
' Device Settings
' -------------------------------------------------------------------------
DEVICE          SX48, OSC4MHZ
IRC_CAL         IRC_4MHZ
FREQ            4_000_000

' -------------------------------------------------------------------------
' IO Pins
' -------------------------------------------------------------------------
' PORT RA 4 bit reserve for serial on all programs, unused set to outout low
' port rb 8 bit, input
' port rc 8 bit, output
' port rd and re 8 bit, unused set to output, low
RAUnused  PIN RA OUTPUT
RBUnused  PIN RB INPUT PULLUP
RCUnused  PIN RC OUTPUT
RDUnused  PIN RD OUTPUT
REUnused  PIN RE OUTPUT
Switch    PIN RB.0 INPUT PULLUP
Light     PIN RC.0 OUTPUT
Pump      PIN RC.1 OUTPUT
' -------------------------------------------------------------------------
' Constants
' -------------------------------------------------------------------------
'flash delay time, wait period between on/off, word size
MaxDelay CON 1000
Debounce  CON 1
Pressed   CON 0

' -------------------------------------------------------------------------
' Variables
' -------------------------------------------------------------------------
'delaytemp, wait time counter, word size
DelayTemp Var Word
'mode, on/off bit size
ModeTemp Var Bit
watch DelayTemp
watch ModeTemp
' -------------------------------------------------------------------------
'  INTERRUPT
' -------------------------------------------------------------------------
'ISR_Start:
 ' ISR code here
'ISR_Exit:
' RETURNINT ' {cycles}                                

' =========================================================================
 PROGRAM Start
' =========================================================================
'Pgm_ID:
' DATA  "LightHouseVbeta0.01", 0

' -------------------------------------------------------------------------
' Subroutines / Jump Table
' -------------------------------------------------------------------------
OnMode SUB 0
' -------------------------------------------------------------------------
' Program Code
' -------------------------------------------------------------------------
Start:
 ' initialization code here
 ' ST_B = 255 'make rb port pins schmitt trigger
 RA = 0 'set putput low
 RC = 0 'set output low
 RD = 0 'set output low
 RE = 0 'set output low
 ' on/off swtich =rb.0
 ' lighthouse = rc.0
 ' pump = rc.1
Main:
 DO
   ' main code here
   ' ModeTemp/DelayTemp/MaxDelay
   IF Switch = Pressed then
     TOGGLE ModeTemp
     ' PAUSE Debounce
     DO
     LOOP UNTIL Switch <> Pressed
     ' PAUSE Debounce
   ENDIF
   IF ModeTemp = 0 THEN
     Light = 0
     Pump = 0
   ENDIF
   IF ModeTemp = 1 THEN
     OnMode
   ENDIF
 LOOP
' -------------------------------------------------------------------------
' Subroutine Code
' -------------------------------------------------------------------------
SUB OnMode
' OnMode:
 Pump = 1
 IF DelayTemp >= MaxDelay THEN
   TOGGLE Light
   DelayTemp = 0
 ENDIF
 INC DelayTemp
 ' DelayTemp = 255
 ' Return
ENDSUB
' goto main
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205092#m205308
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)

2007\07\31@181441 by capdiamontn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, capdiamont wrote:

I've been thinking, about it seeming to hang on the pause statements. I don't understand why it would do that. Is there a way to further troubleshoot that?

The reason I ask, it seems like a good part of the debounce code you put in.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205092#m205498
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)

2007\07\31@192548 by beann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

If you are using "step" or "walk" in the debugger, the pause commands will take FOREVER because the code is running like 0.001% of it's normal speed.

You can change Debouce to zero, then no code will get generated for the "PAUSE Debounce" lines.

Bean.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205092#m205510
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)

2007\07\31@234708 by capdiamontn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, capdiamont wrote:

ok, put the debounce pauses back in, put it in run, and oh my! Too fast even when delay time was 16,000+. Moved freq from 4mhtz, to 32khz, and delay to 2,000. Works good now. It is all assembled, and working. Thanks!

Guess I'll have to do a completed project now, recieved the sx, key, and ssr's all on last friday. The project is for the local county fair, inside the poultry fair, is a large model 4 to 5' tall of a lighthouse. The pump, just so we don't have to plug it in, or out for on/off. Oh, the pump is for the waterfall.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=205092#m205538
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)

More... (looser matching)
- Last day of these posts
- In 2007 , 2008 only
- Today
- New search...