Showing posts with label cogs. Show all posts
Showing posts with label cogs. Show all posts

Sunday, August 18, 2013

Talking Cogs

Parallax code award to Jim Coleman
DESIGNING WITH THE PROPELLER CHIP
COG LOADER: LOADING COGS IN A PROPELLER CHIP

ONE of the most important functions in the Parallax Propeller chip is the ability to talk between various processors. There are numerous ways to write programs to do this, some which use a fractional number of the chip's eight cores and some programs which use the full load of cores. Some examples are spartan and some are more comprehensive and involved, and some will contain embedded comments while others have none. In these examples, cores are called Cogs, the naming convention conceived by the Propeller designer, Charles "Chip" Gracey III, who is also the founder of Parallax Company.

Let's take a look at these programming examples that can talk with Cogs. First up, we honor and spotlight Jim Coleman's award, Object of the Week, issued by Parallax this week. The program is found at the Obex and can be downloaded here. The program is fantastic in documentation and includes the use of PBASIC style language for the Propeller chip. Next up is this sample found at QuickStart 5: Multiple Cogs. It loads up three cogs with tasks that all run at the same time. The code is provided below.

CON
  _clkmode = xtal1 + pll16x         'Establish speed
  _xinfreq = 5_000_000              '80Mhz
OBJ
  led: "E555_LEDEngine.spin"        'Include LED methods object
VAR
  byte Counter                      'Establish Counter Variable                                   
  long stack[90]                    'Establish working space
PUB Main
  cognew(Twinkle(16,clkfreq/50), @stack[0])    'start Twinkle cog 1
  cognew(Twinkle(19,clkfreq/150), @stack[30])  'start Twinkle cog 2
  cognew(Twinkle(22,clkfreq/100), @stack[60])  'start Twinkle cog 3
PUB Twinkle(PIN,RATE)                  'Method declaration
  repeat                               'Initiate a master loop 
    repeat Counter from 0 to 100       'Repeat loop Counter
      led.LEDBrightness(Counter, PIN)  'Adjust LED brightness
      waitcnt(RATE + cnt)              'Wait a moment     
    repeat Counter from 100 to 0       'Repeat loop Counter
      led.LEDBrightness(Counter,PIN)   'Adjust LED brightness
      waitcnt(RATE + cnt)              'Wait a moment


Next, move onto Methods & Cogs and follow the details of the Spin code shown below.

'' File: CogStartStopWithButton.spin
'' Launches methods into cogs and stops the cogs within loop structures that
'' are advanced by pushbuttons.
VAR
  long stack[60]
PUB ButtonBlinkTime | time, index, cog[6]
 repeat
   repeat index from 0 to 5
     time := ButtonTime(23)
     cog[index] := cognew(Blink(index + 4, time, 1_000_000), @stack[index * 10])
   repeat index from 5 to 0
     ButtonTime(23)
     cogstop(cog[index])
PUB Blink( pin, rate, reps)
  dira[pin]~~
  outa[pin]~
  repeat reps * 2
    waitcnt(rate/2 + cnt)
    !outa[pin]
PUB ButtonTime(pin) : delta | time1, time2
  repeat until ina[pin] == 1
  time1 := cnt
  repeat until ina[pin] == 0
  time2 := cnt
  delta := time2 - time1


PROPELLER LINK TREASURY
Parallax Inc.
http://www.parallax.com/
OBEX
http://obex.parallax.com/object/61
QuickStart 5: Multiple Cogs
http://www.parallaxsemiconductor.com/quickstart5
Propeller Education Kit Labs
http://www.parallax.com/go/pekit
Comstock's
https://www.comstocksmag.com/batteries-not-included 
Propeller <-> PC Terminal Communication (forums)
http://forums.parallaxinc.com/forums/?f=25&m=341494&g=341494#m341494
Debug LITE for the Parallax Serial Terminal (forums)
http://forums.parallaxinc.com/forums/default.aspx?f=25&m=348893
Measure Resistance and Capacitance (forums)
http://forums.parallaxinc.com/forums/default.aspx?f=25&m=335407
Transmit Square Wave Frequencies (forums)
http://forums.parallaxinc.com/forums/default.aspx?f=25&m=343747
EEPROM Datalogging and I2C (forums)
http://forums.parallaxinc.com/forums/default.aspx?f=25&m=219237
Servo Control (forums)
http://forums.parallaxinc.com/forums/?f=25&m=197069&g=197069#m197069
PEKbot (forums)
http://forums.parallaxinc.com/forums/default.aspx?f=25&p=1&m=174962
Methods & Cogs
http://nagasm.org/ASL/Propeller/printedPDF/MethodsAndCogs-v10.pdf

Wednesday, September 26, 2012

City in a Propeller Chip

Houses/streets/trees appear inside the chip
Big Brain City Analogy
MICROSCOPIC CITY IN A PROPELLER CHIP ANALOGY

IT'S THE STRANGEST THING  YOU MAY EVER SEE!!! LOOK WHAT YOU CAN FIND INSIDE A PARALLAX PROPELLER MICROCONTROLLER CHIP!

You can reveal a fascinating world showing a complete city inside a P8X32A-D40 Parallax Propeller chip by using the powerful Microscope from the Microscopy Initiative and some simple "processing" of the chip's substrate.

First, establish one of three methods to reveal the microscopic inner workings of one Parallax Propeller chip.

LET'S TAKE A LOOK AT PROPELLER CITY
To obtain the photo shown of an actual Propeller chip, a fractional section of one COG inside one chip was processed using the Big Brain's Microscopy Initiative. An additional effectual  "electronic lens" was applied to increase enlargement and accentuate the city. In some sections of this City, we believe parked cars are just visible. Prior, we believed only the logic components were etched into the substrate with nothing out of the ordinary to see. But this project shows the truth to the old adage that Seeing is believing..."

WHAT IS SEEN
The captured Microscopy image in natural processing color appears to show laid out real estate with rows upon rows of tiny houses, streets and express ways, a business development section, various districts, parked cars and buses, a train, and even green trees, shrubs and landscaping.

Methods of Chip Processing
1) Chemical Acid Bath*
2) Sand off the substrate
3) Data

CHIP PROCESSING
For safety reasons, the Big Brain does not recommend using acid for chip processing. It's more safe, wearing a filter mask, to sand off the substrate and polish the remaining surface, carefully revealing a level of components. The level is then imaged into microscope data and processed with Big Brain's Microscopy Initiative. High resolution data can also be accumulated from sources and analyzed with the Big Brain's Microscope.

SHOCKING RESULTS!
It's rather shocking to open up the chip and discover a Tiny COSMOS world of microscopic and molecular, with appearances of streets and buildings! Come explore this Inner Space of multiple dimensions and fascinating objects within the Big Brain's New Frontier!

SKY INSIDE THE CHIP
Living the life of the P8X32A-D40 Propeller chip, zooming through its rich object filled silicon sky with the myriad motions of molecules, with varying levels of capacitance and inductance. The effervesce effects with elemental particles of Physics is not unlike the twinkling of stars strewn across the Earth's sky.

ON THE GROUND
At "ground level" components with dancing electrons liven up the streets and avenues of circuits. But what are these tiny objects? Possibly we have some things determined... Busy intersections are found with running athletic Cogs and busy transportation of Global Memory Buses, and plots of real estate packed with tall structures of HUB Logic, fields of sprouted RAM, neatly laid out rows of ROM, vast field arrays of mystic proportions and the obviously large affluent homes where COGs live and work. Trillions of electrons have a busy life in Propeller City..

Molecular Microscopy Initiative

Tuesday, March 20, 2012

One Chip Brain

Propeller Driven Big Brain
ANALYSIS OF A ONE CHIP BRAIN
What can you do with a one chip brain? Exactly how powerful is it? How many processors can be initiated in the confines of one Parallax Propeller chip? What are these one-chip Big Brain prodigies capable of doing? How are they constructed?

The Humanoido approach - First take one Parallax Propeller chip. Working with the pins of a P8X32A-D40 DIP chip is easy. It will have 8 COGS or RISC processors. These are powerful because they run in true Parallel. Let's enhance this power. Enhancing the chip and Cloning can create smaller sub processors. This is a process used by the Big Brain to create a new ROS real time operating system of Neural Matter and exampling firing neurons. It also serves as a time manager and facilitates the new creation of extra domains with 125 processors. COGs have available 2K. Initiate Cloning for an array of 8 x 125 processors. This creates a chip with 1008 exampling processors. So one chip is very capable when enhanced. Applications include constructing working Simplex Neurons - which are small powerful levels of code, extended thinking and thought patterns (TP's are the key to one form of machine intelligence), and simultaneous & time shared events.
  • Model Number: P8X32A-D40
  • Processors (cogs): Eight
  • Architecture: 32-bits
  • System Clock Speed: DC to 80 MHz
  • Global RAM/ROM: 64 K bytes; 32 K RAM / 32 K ROM
  • Cog RAM: 512 x 32 bits each
  • I/O Pins: 32 (simultaneously addressable by all eight cogs)
  • Current Source/Sink per I/O: 40 mA
  • Clock Modes: (a) External crystal 4 -8 MHz (16 x PLL) (b) Internal oscillator ~12 MHz or ~20 kHz (c) Direct drive
  • Package Type: 40-pin DIP
  • P0-P31: General purpose I/O.  Can source/sink 40 mA each at 3.3 VDC
  • P31: Rx from host (general purpose I/O after boot up).
  • P30: Tx to host (general purpose I/O after boot up/download).
  • P29: I2C SDA connection to external EEPROM (general purpose I/O after boot up).
  • P28: I2C SCL connection to external EEPROM (general purpose I/O after boot up).
  • Vdd: 3.3 V power (2.7 - 3.6 VDC).
  • Vss: Ground (0 VDC).
  • BOEn: Brown Out Enable (active low). Must be connected to either Vdd or Vss.  If low, RESn becomes a weak output (~5 KΩ) for monitoring purposes but can be driven low to cause reset. If high, RESn is a CMOS input with Schmitt Trigger.
  • RESn: Reset (active low). When low, resets the Propeller chip; all cogs disabled and I/O pins floating. Propeller restarts 50 ms after RESn transitions from low to high.
  • XI: Crystal / clock input. Can connect to crystal or oscillator.
  • XO: Crystal Output. Provides feedback for an external crystal. Internal C and R selectable for crystals (no other components required).
  • Power requirements: 2.7 to 3.3 VDC
  • Communication: Serial for programming
  • Dimensions: 0.48 x 2.0 x 0.13 in (12.3 x 51 x 3.41 mm)
  • Operating temp range: -67 to +257 °F (-55 to +125 °C)

Saturday, February 18, 2012

Micron Propeller

THE MICRON PROPELLER
Create the MP with no hardware changes
Shrinking the Propeller!
One of the most exciting parts of working with a Propeller chip is enhancing it with new ways of thinking out of the box. Expanding the world of Propeller with enlarging enhancements is highly useful for the Big Brain. Contracting the chip is also useful, i.e. shrinking it down to a remarkable "micron" level.

A Micron Propeller is a new small scale version of the full scale Propeller chip. How small? It's exampling prototype is 1/125th of Cog or 1/1000th of the entire chip. It's a prop that's subdivided into smaller processors. It's one of these processors that we are interested in. Propeller chips already have subdivisions of eight Cogs or processors that can work singly or in unison. However, the Micron Propeller takes this to a whole new level of small.

Focus on a Micron Propeller - it's created by the operation of disabling seven Cogs, maintaining functioning of one, and subdividing the one into additional processing units. One of these subdivisions become a Micron Propeller. Micron Propellers are useful for ultra low power consumption, the managing and operating of special code, can be transported to other parts of the chip, and operate green by using only the resources needed. Th e Micron Propeller is derived from the Big Brain's VP technology.

Micron Propeller
Spinoff technology from Big Brain VPs -  the Micron Propeller is the ultimately small Propeller. Each Propeller chip has eight cogs, one of which is subdivided into a maximum of 125 Clones. The remainder cogs are placed in off conditions. One 1/125th of (A), the smallest usable subdivision, is known as a Micron Propeller (MP). One chip can generate many MPs. Each MP holds one Micron program and shares resources including RAM, ROM, Clock, Counters and PINS. MPs can undergo SW transmutations and transporting. The MPRTOS Micron Propeller Real Time Operating System controls timing, parametric handling, multitasking functions, and is a part of Cloning.