Shop OBEX P1 Docs P2 Docs Learn Events
Best SX Threads index and Code Examples — Parallax Forums

Best SX Threads index and Code Examples

Capt. QuirkCapt. Quirk Posts: 872
edited 2020-02-18 16:31 in General Discussion
! NOTE !

Some of these links may have expired.
Often you can find the links by Google searching the topic in the forum search box (near top right).

If anyone has a list of updated URLs, feel free to PM message those to a moderator for updating.


Recent Additions:


Tutorial on Port Triggered Interrupts .......................... (pdf by John Coulture)

Tutorial on 7seg LED w/ MAX7219 ............................ (pdf by John Coulture)

Asm program scheduler ........................................... (code example by pjv)

Using the "LOAD" statement ..................................................(SX/B examples by Jon Williams)

Nutsn Volts Artical -152 ..................................SX/B v2.0

New SX-B 2.0 examples

Dynamic Virtual Peripheral Library for SXB 2.0...........................(SX/B examples by Peter Verkaik)
A VP treasure chest for experienced SX/B programmers

Transmitting SIRCS code (SX/B 2.0 demo)..................................(SX/B examples by Jon Williams)
Formatted Numeric Output (SX/B 2.0)..................................(SX/B examples by Jon Williams)
Improved LOAD instruction (SX/B 2.0)..................................(SX/B examples by Jon Williams)
4 bit ParallelLCD Display with SX28(SX/B 2.0)...................(SX/B examplesby Jon Williams)
Formatted Numeric Output (SX/B 2.0)...................(SX/B examplesby Jon Williams)
Menu on LCD(4bit parallel)......................................................(SX/B examples by Jon Williams)

2004/2005 SX design contest winners...........well documented examples of SX capabilities


Recomended Reading, Nuts n Volts and other good articals


A working draft of Jon Williams, upcoming book "Practical SX/B",
Parts I & II, 118 pages


SX-Key IDE examples page.....Command word examples in SX/B and SASM


NV-116.........Key Points: Theproject uses a SX28 as a slave to a BS2, to control a line sensor array. In the article
Jon Williams gives us a little SX/B history, The Parallax App Mod Protocol (SERIN-SEROUT) for single wire communications
to the BS2. The SX/B codeis outdated, but the concept is relative.

NV-117......Key Points: An excellent primer on using interrupts in SX/B. This project is easily done on a Parallax professional
development board. It uses a BS2 masterto an SX slave using the Parallax App Mod Protocol. The interrupt uses a Uart VP
that is written in SASM and is well explained. The SX slave also controls a 7-segment display for the data sent by the BS2.
The article is written in an earlier version of SX/B, but should be easy to update using the information in NV-137.

NV-122......Key Points: This Nuts n Volts article deals with the SX 28 communicating with a computers MIDI port.The artical
deals with interrupts and uses a "Circular Buffer" and a modifiedUart VP. The code is written in an earlier version of SX/B.

NV-125
NV-129
NV-137..............................A good first read, about SX/B
NV-139
NV-141............................................Ready...Set...Code!
NV-142...................................Livin’ Life on the SX28
NV-143...................................Control Virtually Anything...Virtually
NV-144...................................Rev It Up
NV-145...................................Where’s Waldo?
NV-146...................................Dimming the Lights Fantastic
NV-147...................................The Power of Networking
NV-148...................................It’s In the Cards
NV-149...................................More Surplus Successes
NV-150...................................Putting the Brakes to It
NV-151.................................. Experiments with Sound
NV-152 ..................................SX/B v2.0




How best to format "Technical Qusetions"
Within this thread Guenther Daubach says:
"Typically, microcontroller applications consist of hardware and software, so it helps a lot giving problem
support when both parts can be inspected right away" Posting code and schematics (when applicable) helps.


ADC's

LTC1298.............................................................(SX/B code example by Jon Williams)
Key Points
(1) Transmitting serial data
(2) How to use SHIFTIN, with values greater than 8 bit

12 bit resolution for the SX comparator........(SASM code example by Peter Verkaik)
Schematics and code to increase the SX comparator resolution

ADC frequency limit with SX chips
Pual Baker & Bean discuss the SHIFTIN
speed of the SX

Data packets and the SX
Pual Baker & Bean discuss data packets

Determining the apropriate ADC and EEPROM for a project
Applications Engineer, Pual Baker discusses in length, picking an ADC
and SRAM for the application

Measuring a desired frequency with the SX comparator
Applications Engineer, Pual Baker discusses the SX comparator

Smoothing Sensor Readings.....................................................(SX/B code snippets)
Bean, Jon & Beau Schwabe chime-in onsoftware smoothing techniques

Binary operators in SX/B.............(Updated LTC 1298 SX/B code example by Jon Williams)


Arrays and Global variable memory
There is plenty of memory space in the SX, but at some point you may need to declare Arrays
in order to acess it all.

16 Bit Data
96 byte array...........................................................(SX/B code snippets by Terry Hitt)
Simple Array Sort.....................................................(SX/B code snippets by Terry Hitt)
SX-B -- Arrays and Bit-Index.................................(SX/B code snippets by Jon Williams)
SX-B Considerations for Maximal RAM Utilization..........SX/B code example by Jon Williams)
SX-B RAM Banking Scheme.....................................(SX/B code snippets by Terry Hitt)
SX-B RAM Banking Scheme 2 ...............(Big_Array.SXB code example by Jon Williams)
Variable Space & Lookup Table (some Advanced material inc)
Word Array.........................................................(SX/B code example by Jon Williams)

Bean's Tips

Counting pulses with the SX48 hardware counters........,,.(SX/B code example by Terry Hitt)
Create your own video game with the SX-Tech or PDB....(SX/B code example by Terry Hitt)
SX Micro is Write Protectable


Converting Pbasic to SXB

BS2 Nibbles for SX-B...............................................(SX/B code snippets by Jon Williams)
DCD function for SXB..............................................(SX/B code snippets by Jon Williams)
Explainig the differences between the BS2 and the SX
FREQOUT command in SX-B.............................,,......(SX/B code snippets by Terry Hitt)
HIGHBYTE and LOWBYTE in SX-B.....................,,.....(SX/B code snippets by Terry Hitt)
SX-B Equivalent for WAIT............................,,....(SX/B code example by Jon Williams)
Use lookup and lookdown to replace Select-Case statements.......(SX/B code snippets by Jon Williams)
Do SX/B and BS2 Shiftout commands act different ??....,,....(SX/B code example by Jon Williams)


Crystals and Resonators

Is SX speed fixed to the resonator speed


Debuging the SX

Code to help with debugging SX/B programs..........(SX/B code example by Jon Williams & RobotWorkshop)
Does SX-B have a STAMP-Style DEBUG..........(SX/B code example by Jon Williams)
Unable to Assemble due to errors in source code.......(SX/B code snippets by Terry Hitt)
SX48 Failing above 42mhz...................a Read-Modify-Write problem


Don't Smile off the moderators

This would have been a great thread..............(SX/B code example by Jon Williams)


EEPROMS, FRAM,Ram and MMC/SD formatmemory cards

EEPROM code for 24LC32 to 24LC512..............(SX/B code example by Jon Williams)
Atmel 24C512-24LC16 I2c info
Cypress ram example.............................................(SX/B code example by Terry Hitt)
Determining the appropriate ADC and EEPROM for a project
FRAM
General I2C EEPROM info.........................................(SX/B code snippets by Terry Hitt)
General memory info
Ramtron FRAM
Ramtron Hold and WP pins
Removable memory cards and the SX....................(Information and SX/B code example by Terry Hitt)


EMI, EMC Noise considerations for the SX

EMI failure................................................................(App Noteby Guenther Daubach)
EMC failure with SX52_ 50 MHz
Stray noise and input lines
SX Affected by RFI


Encoders

Incremental Encoder
Quadrature Encoder Example Problem
Using the SXB Encoder Sample
Determining Pulse Width.....................,,..(SX/B code example by Jon Williams)

Examples of improving SXB programing skills

Another way to FREQOUT in SX-B............................(SX/B code snippets by Terry Hitt)
How toDEBUG withmore than 1 BREAK statement.(SX/B code snippets by Terry Hitt)
How to declare your IO pins.....................................(SX/B code snippets by Jon Williams)
How to emulate AND and OR in IF statements........(SX/B code snippets by Terry Hitt)
Improving the Pause statement.....................,,..(SX/B code example by Jon Williams)
Simple 16 bit Math Library....................................,,.(SX/B code example by Terry Hitt)
SXB _I2C with the SX28........................................,,..(SX/B code snippets by Terry Hitt)
trying to use the lookdown command...................,,..(SX/B code snippets by Terry Hitt)
Use lookup and lookdown to replace Select-Case statements.......(SX/B code snippets by Jon Williams)
Using a SX command once in a subroutine rather than multiple times.......(SX/B code example by Jon Williams)
Word comparing
SX/B - Functions vs Subroutines.....................,,..........(SX/B code sample by Jon Williams)
Passing PIN as Parameter.....................,,.......................(SX/B code sample by Jon Williams)


Gunther's Tips

Learned a Watchdog Lesson
Pulse-Stretching, using an SX controller..............(SASM code example by Guenther Daubach)


I2C

I2C Template..............................................................,,..(SX/B code example by Jon Williams)
Help with 24lc128
Running a I2C VP_4MHz
SX I2C wiring
SXB _I2C with the SX28...................,,......................................(SX/B code snippets by Terry Hitt)


Interrupts

_SX Interrupts......................................................................(SASM code example by Peter Verkaik)
Adding a Background UART to SX-B....................................(code examples by Jon Williams)
Are multiple interrupts on multiple pins possible
Calling a SUB or FUNC from an ISR...............................................(SX/B code snippets by Terry Hitt)
Generating specific timed pulses...................................................(SX/B code snippets by Terry Hitt)
Interrupt for reading encoder
Interrupt RETIW question (SASM)...............................................(SX/B code snippets by Terry Hitt)
Interrupt vs hardware stall protection
Is it possible to return from the interrupt routine to a different point than called from
Simple Servo VP in SX-B..............................................((2) code examples by Jon Williams)
Simultaneous serial send and receive using only 1 interrupt routine...(SX/B code example by Terry Hitt)
SX ISR Calculator...................................................................(a link to a useful calculator on sxlist.com)


Keyboard & KeyPad

PS/2 Keyboard Input.........................................................(SX/B code example by Jon Williams)
Debouncing the kepad example in the SXB help...............................(SX/B code snippets by Terry Hitt)


LCD's

Convert a 16bit binary variable into a decimal value............(SX/B code snippets by Terry Hitt)
Converting variables into ASCII characters...........................(SX/B code snippets by Terry Hitt)
Converting variables into HexDecimal in SX-B...................(SX/B code snippets by Jon Williams)
Converting word values to ascii digits....................................(SX/B code snippets by Terry Hitt)
Is it possible to convert RX'd Bytes into a DATA statements..(SX/B code snippets by Terry Hitt)
Serial LCD (excellent SXB code example)
SXB Serial LCD code example(Up-Dated Code).....................(SX/B code example by Jon Williams)
SXB SEROUT



LED's

12 IO pins to drive 32 LEDs.....................................................(SASM code example by PJV)
16x16 LED matrix..........................................................(SX/B code example by Jon Williams)
RGB LED SXB example


Math

SINCOS.SXB.................................................................(SX/B code example by Jon Williams)
Simple 16 bit Math Library....................................,,........(SX/B code example by Terry Hitt)


Projects

SX 3 axisCNC mill 0.0005 acurracy

Fuel Injection.....Lots of good information on the different types of systems, how to manage an EFI
and popular web sites. Ford motor company engineer (GAF(ret.)) provided technical experience for what is
a broad subject.

16x16 LEDClock interface for the SX48 and DS1302 RTCC...................(SX/B Project code included)
A small C compiler for sx28
CANbus with the SX-28
Drag bike shift and NOS control ................................................................(SX/B Project code included)
PJV_Multi Threaded SX-B
SX28 - DS1302 RTC interface to a Serial LCD ..........................................(SX/B Project code included)
SX52_Dynamic RAM
The Secret SX Instructions


PWM

ISR control of PWM.........................................................................(SX/B code example by Jon Williams)
4 motor PWM control
Fixed and variable PWM
SX48 timers for PWM
SX speed control
SXB 16 channel PWM and or SERVO controller.....................................(SX/B code example by Terry Hitt)
PWM thru an Interrupt..............................................................................(SX/B code snippets by Terry Hitt)



RcTime

Pinewood derby lane timer revisited.........................................................(SX/B code example by Jon Williams)


SASM programing help

Excellent example of how to use a simple (non-preemptive) RTOS........................(SASM code example by pjv)
RETP vrs RETW......................................................................................(SASM code example by Guenther Daubach)
The PC register Puzzle With SXSim & DeBug
Using SX Sim with your programs


Sensors

Hitachi HM55B Compass ........................................................................(SX/B code example by Terry Hitt)
Memsic 2125 Dual axis accelerometer ..................................................(SX/B code example by Terry Hitt)
TAOS light sensor..................................................................................(SX/B code example by Terry Hitt)
PING.......................................................................................................(SX/B code example by Jon Williams)
Reading RPM......................................................................................(SX/B code example by Terry Hitt)

Serial Comunications

Buffered Serial Code Example.........................................................(SX/B code example by Jon Williams)
A poor man's serial IO.........................................................(SX/B code example by Peter Verkaik)
A simple 1 wire serial protocol.........................................................(SX/B code example by Jon Williams)
Max Baud Rate for Serout
SEROUT and Ltc1298 12Bit ADC.........................................................(SX/B code example by Jon Williams)
Simultaneous serial send and receive using only 1 interrupt routine..........(SX/B code snippets by Terry Hitt)
SX serin - serout filter at 57600
[url=" http://forums.parallax.com/showthread.php?p=617188"]SXB SerIn Timeout Option[/url]
Serial comm between two SX chips
DBUS (TI-Link) Demo....................................................................(SX/B code exampleby Terry Hitt)


Servo Control

$40 6-Channel RC System.........................................................(SX/B code example by Jon Williams)
Background Servo Control using SX-B.......................................(SX/B code example by Jon Williams)
Basic Servo Control..............................................................................(SX/B code snippets by Terry Hitt)
Heating up an SX while pulsing a servo - what's up here
Help with servo control............................................................(SX/B code example by Jon Williams)
Simple Servo VP in SX-B............................................................(SX/B code example by Jon Williams)
SX-B 16 SERVO controller..................................................................(SX/B code example by Terry Hitt)


ShiftIn & ShiftOut

10 bit Word varibale needed for high speed SPI type interface.........(SX/B code snippets by Terry Hitt)
SHIFTOUT and the DS1302 Real Time Clock........................................(SX/B code snippets by Terry Hitt)


SPI

SPI Slave code in SX/B..................................................................(SX/B code example by Terry Hitt)


Stepper motors

Generic stepper motor subroutine.....................................................(SASM code snippets by PJV)


SX Chip setup

Longest possible battery life, using a 9volt.............................................(Circuit example by Guenther Daubach)
SX28 Bypass Capacitor selection question


SX Development

Multi Threaded SX-B


SX error messages and quirks

Chip connection failed
NOSTARTUP gottcha..............................................................................(SX/B code snippets by Terry Hitt)
Problems saving programs
SX crash
SX-B code page-Addresses....................................................................(SX/B code snippets by Terry Hitt)
Using a pin as a variable.........................................................................(SX/B code snippets by Terry Hitt)


SX Key & SX Blitz

Supremely Basic SX Question
Sx Key Dead
SX key problem-question



SX Product line info

A comparison between the SX and BS2


SX to SX Comunication

Keeping two SX28's in sync
Running a VP i2c multi master in 4MHz
SX28 Keypad used as a slave to a BS2px..............................................(SX/B code example by Jon Williams)
SX28 Master-Slave I-O series resistor question
Using Shift-Out from SX28 to Shift-In on SX48
What is Hi-Z input
Serial comm between two SX chips
SX ParrallelComunication..............................................(SX/B code example by Jon Williams)
Comunication between 2 SX chips..............................................(SX/B code example by Jon Williams)
DBUS (TI-Link) Demo....................................................................(SX/B code exampleby Terry Hitt)
SPI Slave-BS2 Mastercode in SX/B..................................................................(SX/B code example by Terry Hitt)


Thermocouples

SXB code for DS2760........................................................................(SX/B code example by Terry Hitt)



Uarts

Adding a Background UART to SX-B..............................................(SX/B code example by Jon Williams)
Need a sanity check SX48 + 115200 baud + LCD + PS-2 keyboard.......(SASM code example by PJV)
VP Dual 115200 Uarts.................................................................................(SASM code example by PJV)
VP 2 UARTs + I2C possible, again
Buffered TX and RX (SX/B + Assembly)..............................................(SX/B code example by Jon Williams)

Variable Exceed Available RAM

Lost in Pages of Variables...


Video

DS1302 RTC with SX Video module display and BS2
SX52 and SRAM problem


Virtual Peripherals

Peter Verkaiks SASM VP library and Project Template....(SX/B code example by Peter Verkaik)
VP Dual 115200 Uarts.....................................................................(SASM code example by PJV)


Watchdog, Timers and RTCC

RTCC with SX-B help request....................................................(SX/B code snippets by Terry Hitt)
Setting !option for a watchdog in an SXB program
SX48 and the DS1302 Real Time Clock......................................(SX/B code snippets by Terry Hitt)
SX48BD Multi-Function Timer
SX52 timers phase.......................................................................(SX/B code snippets by Terry Hitt)




Post Edited (Capt. Quirk) : 6/24/2010 4:01:51 AM GMT

Comments

Sign In or Register to comment.