udamonic.com
  • Start
    • What is a Scamp?
    • Getting Started
    • Getting Started (Windows)
  • Learn
    • What is Forth?
    • Arithmetic
    • The Stack
    • Creating Words
    • Compilation Tricks
    • Decompilation
    • Comments
    • Characters and Strings
    • Accessing Memory
    • Constants, Variables and Values
    • Flow Control
    • Loops
    • Data Structures
    • Doubles, Triples and Quads
    • FlashForth Dictionary Reference
    • Scamp Dictionary Reference
  • Extras
    • Interrupts
    • Timers
    • Multitasking
    • Delays and Tick Count
    • Processor Words
    • Starting up with turnkey
    • Changing the Prompt
    • Formatting Text on Screen
  • Interfacing
    • Using the LED Array
    • Temperature Sensor
    • Input/Output
    • Analog Input
    • Serial >
      • Serial Communication
      • Scamp Serial Comms
      • Scamp2 UART Pins
    • I2C >
      • I2C Overview
      • I2C Commands
    • SPI
    • PWM
    • Peripheral Pin Select
    • Input Capture
    • Digital Signal Modulator
    • DataFlash
    • RS485
  • Create
    • Scamp Projects on Youtube
    • Prototyping >
      • Protoboards
      • Fabricating PCBs
      • Soldering
    • GPIO >
      • Adding Extra GPIO
      • 32-bit GPIO Module
      • Adding a Low Side Switch
    • Sensing >
      • Measuring Temperature
    • LEDs >
      • Adding LEDs
      • LED arc-welder effect
    • Memory >
      • Adding MRAM
      • AT24C256 EPROM Driver
    • Displays >
      • Adding a 7 Segment Display
      • Adding a Touch LCD
      • Touch LCD GUI
      • Game of Pong
    • FizzBuzz
    • Model Train Control
    • Adding a Real Time Clock
    • 1-D Pacman
  • Resources
  • Buy
  • Consulting
  • About

​Running Your Word at Start Up
​

When FlashForth starts (or resets), it can be configured to run any word from the dictionary by mapping that word to the turnkey word. This is particularly useful if you have created an embedded application that you want to run automatically whenever your Udamonic computer is turned on.

​In this example, myWord is made to launch at start up:
' myWord is turnkey
The tick word ' searches the dictionary for the name of the word (specified by the string of characters immediately after ' ), and places the address of myWord on the stack. The word is then stores the address to the dictionary entry for turnkey.  Once you've set turnkey, use the word warm to restart your Scamp. This causes the value for turnkey to be saved to flash. From now on, a cold restart, warm restart or brownout reset will cause turnkey to run at startup. 
On restart, if turnkey is 0 (false), FlashForth starts normally. If turnkey is not zero, it is treated as a token (pointer) to a word to be run. The RESET button on your Udamonic computer will restart FlashForth without turnkey running. In this way you can use RESET to bypass turnkey, if you need to disable it or change it. Other sources of restart (such as power-on, brown-out reset, warm etc) will execute turnkey immediately.
 

Note: If the startup word pointed to by turnkey is removed, turnkey will still attempt to execute whatever it finds at that address in the dictionary. So, always remember to disable turnkey if you forget (remove) your startup word.

 
To disable turnkey, just set it to false (zero):
​false is turnkey
Note that when setting it to false, no tick ' is required. That's because you're setting turnkey to be zero, not the address of false in the dictionary.

Powering Your Scamp
​

When developing code, your Scamp can be powered by USB alone. However, in standalone applications, USB power is usually not available. You can provide an external power source for your Scamp via the VIN pin. Anything from 5V to 12V is suitable.  

​The 3V3 pins on the main connector are outputs from the onboard regulator and provide regulated 3V3 power to external devices. All 3V3 pins are connected together. For external devices that draw a lot of current, use multiple 3V3 pins for power.  
 

Do not connect external power sources to the 3V3 pins. 

 

Site powered by Weebly. Managed by Hostwinds
  • Start
    • What is a Scamp?
    • Getting Started
    • Getting Started (Windows)
  • Learn
    • What is Forth?
    • Arithmetic
    • The Stack
    • Creating Words
    • Compilation Tricks
    • Decompilation
    • Comments
    • Characters and Strings
    • Accessing Memory
    • Constants, Variables and Values
    • Flow Control
    • Loops
    • Data Structures
    • Doubles, Triples and Quads
    • FlashForth Dictionary Reference
    • Scamp Dictionary Reference
  • Extras
    • Interrupts
    • Timers
    • Multitasking
    • Delays and Tick Count
    • Processor Words
    • Starting up with turnkey
    • Changing the Prompt
    • Formatting Text on Screen
  • Interfacing
    • Using the LED Array
    • Temperature Sensor
    • Input/Output
    • Analog Input
    • Serial >
      • Serial Communication
      • Scamp Serial Comms
      • Scamp2 UART Pins
    • I2C >
      • I2C Overview
      • I2C Commands
    • SPI
    • PWM
    • Peripheral Pin Select
    • Input Capture
    • Digital Signal Modulator
    • DataFlash
    • RS485
  • Create
    • Scamp Projects on Youtube
    • Prototyping >
      • Protoboards
      • Fabricating PCBs
      • Soldering
    • GPIO >
      • Adding Extra GPIO
      • 32-bit GPIO Module
      • Adding a Low Side Switch
    • Sensing >
      • Measuring Temperature
    • LEDs >
      • Adding LEDs
      • LED arc-welder effect
    • Memory >
      • Adding MRAM
      • AT24C256 EPROM Driver
    • Displays >
      • Adding a 7 Segment Display
      • Adding a Touch LCD
      • Touch LCD GUI
      • Game of Pong
    • FizzBuzz
    • Model Train Control
    • Adding a Real Time Clock
    • 1-D Pacman
  • Resources
  • Buy
  • Consulting
  • About