2.11BSD operating system for microcontrollers
It is currently Tue Oct 15, 2019 11:20 am

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sat Apr 04, 2015 4:52 am 
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
A new driver for general purpose i/o ports has been implemented for LiteBSD. You can find a description on wiki page: ... -IO-Driver

The driver has mostly the same features as in RetroBSD, with a few minor differences. The first version was developed by Jaume, and later I extended it to a full scale driver. Link to the sources: ... dev/gpio.c

The driver has been tested on chipKIT WiFire board. Boot messages:
Copyright (c) 1982, 1986, 1989, 1991, 1993
   The Regents of the University of California.  All rights reserved.

4.4BSD-Lite build 3 compiled 2015-04-03
cpu: PIC32MZ2048ECG100 rev A4, 200 MHz
gpio0 at portA, pins -i---ii-iiiiiiii
gpio1 at portB, pins i---i-iiiiiiiiii
gpio2 at portC, pins iiii---------i--
gpio3 at portD, pins --ii------iiii-i
gpio4 at portE, pins ------iiiiiiiiii
gpio5 at portF, pins --ii--------i---
gpio6 at portG, pins iiii--iii-------

Display a configuration and status of all pins:
# cat /dev/conf?
# cat /dev/port?

Buttons 1 and 2 are connected to pins RA5 and RA4. Testing them:
# cat /dev/porta
-1---10-11001101        -- no buttons pressed
# cat /dev/porta
-1---10-11011101        -- button 2 pressed
# cat /dev/porta
-1---10-11101101        -- button 1 pressed

Signals RD4 and RB11 are connected to LED2 and LED3 - let's configure them as outputs.
# portio -o d4 b11

Now run a loop toggling LED2 and LED3:
# while sleep 1; do portio -r d4 b11; done

There is still no support for LOL interface - to be added later.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission