Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: How to XOR a byte output? Date: Fri, 15 Apr 2016 08:06:45 -0400 Organization: IISS Elusive Unicorn Lines: 47 Message-ID: References: <87potssg4n.fsf@elektro.pacujo.net> <1973741114.867178.1460675103346.JavaMail.yahoo@mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de Ih7/VJbQfeaxLpEA4bQMSQ4vp2SwBRE0B2ovbCR1rJzA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(python': 0.05; 'executable': 0.07; 'interpreted': 0.07; 'subject:How': 0.09; 'c/c++': 0.09; 'interpreter,': 0.09; 'message-id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'thread': 0.10; 'advance': 0.10; 'python': 0.10; 'interpreter': 0.15; 'thu,': 0.15; '(python)': 0.16; '(xor': 0.16; '2016': 0.16; 'chip': 0.16; 'consume': 0.16; 'itself).': 0.16; 'processors': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'thread.': 0.16; 'memory': 0.17; 'byte': 0.18; 'processor': 0.18; 'url:home': 0.18; '(in': 0.18; 'language': 0.19; 'load': 0.20; '(not': 0.20; 'library': 0.20; "aren't": 0.22; 'arm': 0.22; 'interpret': 0.22; 'produces': 0.22; 'programming': 0.22; 'nearly': 0.23; 'unlike': 0.23; 'wondering': 0.25; "doesn't": 0.26; 'header:X-Complaints-To:1': 0.26; 'chris': 0.26; '+0000': 0.27; 'equivalent': 0.27; 'question': 0.27; 'sequence': 0.27; '32-bit': 0.29; 'assembly': 0.29; 'loads': 0.29; 'thread,': 0.29; 'windows,': 0.29; 'starts': 0.29; 'typically': 0.29; 'code': 0.30; 'mention': 0.30; 'anyone': 0.32; 'core': 0.32; 'implement': 0.32; 'compiled': 0.32; 'language.': 0.32; 'run': 0.33; 'point': 0.33; 'file': 0.34; 'running': 0.34; 'add': 0.34; 'list': 0.34; 'gives': 0.35; 'could': 0.35; 'newer': 0.35; 'level': 0.35; 'but': 0.36; 'list,': 0.36; 'should': 0.36; 'instead': 0.36; 'there': 0.36; 'created': 0.36; 'basic': 0.36; 'alone': 0.36; 'loaded': 0.36; 'modules': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'received:org': 0.37; 'charset :us-ascii': 0.37; 'things': 0.38; 'means': 0.39; 'does': 0.39; 'application': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'space': 0.40; 'some': 0.40; 'your': 0.60; 'entire': 0.61; 'black': 0.61; 'programs': 0.62; 'more': 0.63; 'believe': 0.66; 'python-list': 0.66; 'cards': 0.67; 'flash': 0.67; 'direct': 0.68; 'subject': 0.70; '(utc),': 0.84; 'devices.': 0.84; 'dennis': 0.91; 'stamp': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: adsl-108-73-119-88.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <87potssg4n.fsf@elektro.pacujo.net> <1973741114.867178.1460675103346.JavaMail.yahoo@mail.yahoo.com> Xref: csiph.com comp.lang.python:107047 On Thu, 14 Apr 2016 23:05:03 +0000 (UTC), Chris Juried via Python-list declaimed the following: >Hello list, >I am new to the list and was wondering if anyone is using Python for MCU programing? In particular the First matter: You should have created a new thread, rather than piggy-backing on an existing thread. Your question has nothing to do with the thread subject (XOR a byte). >AVR and ARM based controllers. Is Python a plausible language for MCU programming or is C/C++ or Assembly the only way to go? Thanks in advance for your insight. Most implementations of Python are of a byte-code interpreted language. It does not produce native executable binaries. That means that to use it on those microcontrollers you would have to first port the interpreter to the controller. That alone may consume the entire FLASH memory space -- even before you add library modules to access the hardware (Python doesn't "do" hardware level access -- there is no "pointer to memory" you can set to write to pins). The core of the interpreter, for 32-bit Windows, is nearly 300KB -- more than the 256KB available on a TIVA TM4C123 Launchpad. You'd then need to implement a file system so the interpreter could locate and load library modules used by your program (not to mention the program itself). At that point you've created the Python equivalent of the old Parallax BASIC Stamp (in which the MCU FLASH is loaded with the interpreter of a very limited BASIC, and off-chip memory is used to hold the pre-compiled byte code of your program). Or the newer Parallax Propeller chip -- in which the boot sequence loads a very short interpreter for the SPIN language into the processor core from off-chip memory before it starts to interpret byte-codes. Though unlike the BASIC Stamp, the Propeller also gives you access to assembly (assembly programs get loaded into the core memory instead of the interpreter -- so run much faster). You can run it (Python) on things like the BeagleBone Black and Raspberry PI -- but those cards are using application SoC processors running a form of Linux; they aren't running bare-bones direct hardware access. For microcontrollers, you typically need to have a compiled language that produces a memory image that can execute in place. It may not be C/C++ -- I believe a few efforts have been made for a no-run-time GNAT Ada to run on some ARM devices. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/