From owner-freebsd-questions@FreeBSD.ORG Thu Jun 21 09:09:20 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 799A7106566C for ; Thu, 21 Jun 2012 09:09:20 +0000 (UTC) (envelope-from davidcollins001@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3BE5C8FC0A for ; Thu, 21 Jun 2012 09:09:20 +0000 (UTC) Received: by obbun3 with SMTP id un3so840260obb.13 for ; Thu, 21 Jun 2012 02:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=vCoBox/4FTrIBeA2AXGjyE1/E9rc3OKYXS4tVif9xag=; b=EhZPpAS1EFrp5Z5uCJeVJGeqZPNFnsLc5dsNVuKtVWLn2OE39dd3mqa2/VeoTrI2+6 7kJ15Rsl9i+shG3IWMfxQRNaJ3daNDRUSlep9MfgjCh/aKvAH4fOeXmt7oM30zuuQGDT YBQ3BcDg1QLmO8DGD5UcEuS9fLWOvliRTRgycnia2lgT7btCW2qXY2tKEXeUjJYF8Pys 3MfvDtPg3NOhlU0J11dMJiUO83thyDoPiteZwOWLqyBfjz2zdWuqiDvD2yezV86xBh7J yL+hhlNc2UFtrpnci/QLMXldvwoGJTAC0Ko3zNQLQcyXIpVvxicfIz/w+i7tQUspigyv kG/Q== MIME-Version: 1.0 Received: by 10.182.119.33 with SMTP id kr1mr27413375obb.60.1340269759635; Thu, 21 Jun 2012 02:09:19 -0700 (PDT) Received: by 10.76.80.103 with HTTP; Thu, 21 Jun 2012 02:09:19 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Jun 2012 10:09:19 +0100 Message-ID: From: David Collins To: Wojciech Puchar Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Questions , Modulok Subject: Re: OT: Robotics or embedded or hardware programming... what is this called? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidcollins001@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 09:09:20 -0000 I have one of these http://www.nerdkits.com/ They pack everything you need in and a few examples, quite neat but you need to do some electronics On 21/06/2012, Wojciech Puchar wrote: >> I want to get started programming for hardware. Motors, sensors, >> actuators, etc. >> I have a programming background, (python, PHP, C++) but no experience with >> code >> that drives hardware. (Motors, sensors, etc.) > > add "--" to your language list so first 2 would disappear and third will > become C. > >> I *don't* want closed-source "kit robots" where the point is to build the >> robot >> the book and thats it. I also don't want ladder logic-based PMC's. Some >> kind of >> micro-controller that runs a *nix flavor (or a BSD flavor!) would be >> great! (If > > Why do you want something like microcontroller to run any OS? >> What do you call this? Embedded programming? Generic hardware >> programming? > > running unix on microcontroller-style hardware is what i call nonsense. > > Writing your program that runs from first executed instruction is what i > call normal programming of such devices. > > The proper way is to > > 1) buy a microcontrooler chip, make your hardware using it, possibly buy > already made boards. microcontrollers are <1$, some more capable 32-bit > ones (ARM compatible usually, some are MIPS) for 2-3$. > > 2) throw away all included libraries because they are mostly mess. > prepare something that can be used as crt0.s > Better write it yourself in assembly. shouldn't be larger than 5 > instructions anyway, a bit more if ARM interrupt vectors are needed to be > filled. > > Some assembly knowledge is very useful, in spite of writing most in C. > > 3) read documentation. All embedded devices (like A/D converters, PWM > generators etc.) are described. With 32-bit micros start from "memory MAP" > chapter and then device description. You will just find out at what > address your peripheral is accessible. > > 4) lets say for example that 32 GPIO pins are accessible at address > 0x40001000 for setting ports, 0x40002000 for resetting ports, 0x40003000 > for reading out value, and 0x40004000 for setting direction > (input/output). > > #define GPIO0_SET ((int*)0x40001000) > #define GPIO0_RESET ((int*)0x40002000) > #define GPIO0_READ ((int*)0x40003000) > #define GPIO0_DIR ((int*)0x40004000) > > > 5) use it in your program. > > *GPIO0_DIR=0xFFFFFFFF; //sets all pins to output > *GPIO0_SET=0xAAAAAAAA; //sets every other pin to 1 > *GPIO0_RESET=0x55555555; //set the rest to 0 > > > > if you have questions send it privately. microcontrollers are wrong place > for unix system and it's overcomplexity relatively to the task. > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" >