RetroBSD

2.11BSD operating system for microcontrollers
It is currently Mon Sep 24, 2018 11:00 pm

All times are UTC




Post new topic Reply to topic  [ 19 posts ] 
Author Message
PostPosted: Sat Apr 04, 2015 1:49 pm 

Joined: Sun Mar 22, 2015 4:36 pm
Posts: 12
http://microcontrollershop.com/product_ ... ts_id=3995

Came across this on Microcontrollershop.com. I may give this a try. Anyone try installing Retrobsd on it yet? Looks like a decent development board, and not too expensive.


Top
 Profile  
 
PostPosted: Tue Apr 07, 2015 5:42 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
It would be great to have a variant of this board, adapted for pic32mz.

The configuration for RetroBSD kernel should be easy to create. Existing Duinomite config is a good starting point.

Unfortunately, Ethernet port is currently useless, as we do not have TCP/IP stack in RetroBSD.


Top
 Profile  
 
PostPosted: Sun Apr 12, 2015 7:48 pm 

Joined: Sun Mar 22, 2015 4:36 pm
Posts: 12
It looks like that board has been out for a while (since 2011). Maybe Olimex has some new pic32mz offerings in the works. I'm sure the TCP/IP stack will be developed eventually.

And does the Atmel 32-bit series have enough RAM to run RetroBSD? It looks like they're under 128k of SRAM.


Top
 Profile  
 
PostPosted: Wed May 13, 2015 4:53 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
As for TCP/IP stack, we already have LiteBSD running on pic32mz with Ethernet driver and networking enabled. Telnet and FTP protocols work fine. For details, see: https://github.com/sergev/LiteBSD/wiki/Networking

Do you mean Atmel AVR32 family, like AT32UC3A4256? Quite interesting chip. It would be great if somebody ported RetroBSD to it.


Top
 Profile  
 
PostPosted: Wed May 13, 2015 12:16 pm 

Joined: Sun Mar 22, 2015 4:36 pm
Posts: 12
That's definitely the one, the AVR32 family w/ 128k RAM. I didn't know if anyone was working on a port for the AVR32.

I've been getting started with microcontroller programming, and I have a couple of PIC development boards, though the micro used is the PIC 16f877a. I just had development boards I've bought years ago, but never used. That's a good chip to get a feel for the PIC micro.... the PIC32 family is really just a more powerful version of the earlier PIC chips, like the 16F. For example, there are certain programming aspects particular to the PIC, that are still the same, like setting the tristate and port registers. Once I get the feel for programming these older pics, I can move up to the PIC32.

It would be interesting to have a way to manipulate the TRIS and PORT registers from a shell script or Python script with RetroBSD. Maybe there are special files in /dev that represent the TRISx and PORTx register functions in RetroBSD?


Top
 Profile  
 
PostPosted: Thu May 14, 2015 2:52 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
dmmiller wrote:
It would be interesting to have a way to manipulate the TRIS and PORT registers from a shell script or Python script with RetroBSD. Maybe there are special files in /dev that represent the TRISx and PORTx register functions in RetroBSD?

Exactly! There is a set of /dev/conf* and /dev/port* devices, which allow to control GPIO signals from shell scripts. For details see http://retrobsd.org/wiki/doku.php/doc/gpio.
Code:
# ls -l /dev/port* /dev/conf*
crw-rw-rw-  1 root       6,  64 May  7 18:50 /dev/confa
crw-rw-rw-  1 root       6,  65 May  7 18:50 /dev/confb
crw-rw-rw-  1 root       6,  66 May  7 18:50 /dev/confc
crw-rw-rw-  1 root       6,  67 May  7 18:50 /dev/confd
crw-rw-rw-  1 root       6,  68 May  7 20:29 /dev/confe
crw-rw-rw-  1 root       6,  69 May  7 18:50 /dev/conff
crw-rw-rw-  1 root       6,  70 May  7 18:50 /dev/confg
crw-rw-rw-  1 root       6,   0 May  7 18:50 /dev/porta
crw-rw-rw-  1 root       6,   1 May  7 18:50 /dev/portb
crw-rw-rw-  1 root       6,   2 May  7 18:50 /dev/portc
crw-rw-rw-  1 root       6,   3 May  7 18:50 /dev/portd
crw-rw-rw-  1 root       6,   4 May  7 20:43 /dev/porte
crw-rw-rw-  1 root       6,   5 May  7 18:50 /dev/portf
crw-rw-rw-  1 root       6,   6 May  7 18:50 /dev/portg

Devices like /dev/confa allow to configure GPIO signals as inputs (default), outputs (o) or open drain outputs (d). Just write a 16-character string to the device, like:
Code:
# echo .............doii > /dev/confa

To view configuration of all ports, use:
Code:
# cat /dev/conf*
ii----i-iiii--ii
iiiiiiiiiiiiiiii
iiii-------iiii-
iiiiiiiiiii--iii
------iiiiiiiiii
--ii---i--iiiiii
iiii--iiii----ii

Devices like /dev/porta allow to read inputs or change values of output ports:
Code:
# cat /dev/port*
11----1-1111--11
1111111111111111
1111-------1111-
11111111111--111
------1111111111
--11---1--111111
1111--1111----11

Here is an example of shell script controlling RGB LED connected to signals RE5, RE6 and RE7:
Code:
# Set signals RE5, RE6 and RE7 as output.
echo --------ooo----- > /dev/confe
echo --------000----- > /dev/porte

while :
do
    echo --------100----- > /dev/porte
    sleep 1
    echo --------010----- > /dev/porte
    sleep 1
    echo --------001----- > /dev/porte
    sleep 1
done

An alternative way is to use /bin/portio utility. Here is a similar script using portio instead of /dev/port* output:
Code:
# Set signals RE5, RE6 and RE7 as output.
portio -o e5-7
portio -c e5-7

while :
do
    portio -c e5 -s e7
    portio -c e7 -s e6
    portio -c e6 -s e5
done

Shell scripts are not quite fast on RetroBSD, as every process invocation requires swapping out the shell, running the process and then swapping the shell image back in. C application can do it much faster. Here is the same example rewritten in C:
Code:
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/gpio.h>

#define MASK_D5     (1 << 5)    /* signal RE5 */
#define MASK_D6     (1 << 6)    /* signal RE6 */
#define MASK_D7     (1 << 7)    /* signal RE7 */

int main()
{
    int fd;
    char *devname = "/dev/porta";

    /* Open GPIO driver. */
    fd = open(devname, 1);
    if (fd < 0) {
        perror(devname);
        return -1;
    }

    /* Configure pins as output. */
    ioctl(fd, GPIO_PORTE | GPIO_CONFOUT, MASK_D5 | MASK_D6 | MASK_D7);
    ioctl(fd, GPIO_PORTE | GPIO_CLEAR, MASK_D5 | MASK_D6 | MASK_D7);

    for (;;) {
        /* Clear D5, set D7. */
        ioctl(fd, GPIO_PORTE | GPIO_CLEAR, MASK_D5);
        ioctl(fd, GPIO_PORTE | GPIO_SET, MASK_D7);
        usleep(100000);

        /* Clear D7, set D6. */
        ioctl(fd, GPIO_PORTE | GPIO_CLEAR, MASK_D7);
        ioctl(fd, GPIO_PORTE | GPIO_SET, MASK_D6);
        usleep(100000);

        /* Clear D6, set D5. */
        ioctl(fd, GPIO_PORTE | GPIO_CLEAR, MASK_D6);
        ioctl(fd, GPIO_PORTE | GPIO_SET, MASK_D5);
        usleep(100000);
    }
    return 0;
}

You can compile it with cc and run right away:
Code:
# cc led3.c -o led3
# ./led3


Top
 Profile  
 
PostPosted: Sun May 17, 2015 6:21 pm 

Joined: Sun Mar 22, 2015 4:36 pm
Posts: 12
Are there any really good pic32mz boards out yet? Olimex is going to come out with one (with ethernet), and MikroElectronika has a decent set of development boards, but no MZ yet. They only have pic32mx modules. I emailed MikroE and asked them if they plan on offering a pic32mz in the future. Still awaiting the reply.


Top
 Profile  
 
PostPosted: Mon May 18, 2015 11:50 am 

Joined: Sun Mar 22, 2015 4:36 pm
Posts: 12
MikroElectronica informed me that they won't be supporting the PIC32MZ. The reason they gave is that the chip is too full of Errata, and they won't consider supporting the chip until Microchip fixes the bugs.


Top
 Profile  
 
PostPosted: Mon May 18, 2015 7:54 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
I would recommend Majenko SDZL board:

Image

Works fine for me. As I understand, it's not in wide production yet. Better to ask Matt - usually he makes them in small batches and sells on eBay. For technical details, see here: https://github.com/sergev/LiteBSD/wiki/Majenko-SDZL-board

ChipKIT Wi-Fire is a good choice as well. Wi-Fi driver for LiteBSD is about 80% ready.

Image

Technical details: https://github.com/sergev/LiteBSD/wiki/chipKIT-WiFire-board

I also ordered a new MZ board from Olimex: https://www.olimex.com/Products/PIC/Development/PIC32-HMZ144/open-source-hardware. We'll see how it goes.

IMHO, people tend to overestimate the impact of MZ errata. In my experience, I had not yet encountered any of hardware issues with pic32mz. Everything I tried worked exactly as expected, including Ethernet. I never tried ADC and I2S though.


Top
 Profile  
 
PostPosted: Tue May 19, 2015 3:32 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
vak wrote:
IMHO, people tend to overestimate the impact of MZ errata. In my experience, I had not yet encountered any of hardware issues with pic32mz. Everything I tried worked exactly as expected, including Ethernet. I never tried ADC and I2S though.

It might be an underclocing to ie. 80MHz corrects many errata items.. :P

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue May 19, 2015 4:25 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
I don't use underclocking, only standard 200MHz clock rate.


Top
 Profile  
 
PostPosted: Thu May 21, 2015 5:07 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi Serge and Matt,

So how do I get Matt to send me one of his units? I could send him a USPO Money order to avoid E-Bay stuff?

Nice to see real hardware done by real people on this list :) :).

Impressive !

Wiz


Top
 Profile  
 
PostPosted: Thu May 21, 2015 9:39 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
I don't have any at the moment. I haven't got round to re-designing the power subsystems yet - it needs a new EPS manifold, and the plasma relays are shot.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Fri May 22, 2015 8:30 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
I've got few spare beta-matrix compositors and a phase compensator (nos), if you may need them..
Also, I do not cross manifolds with replicator power converters, never.
Btw, you may consider an isomagnetic EPS conduit in order to maximize the power distribution efficiency as well (I can supply too).
Pito

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Fri May 22, 2015 9:31 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
The isomagnetic EPS conduit is a good idea - I may have to see if I can adapt the flow compressor to use them.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Fri May 22, 2015 9:38 am 

Joined: Sun Mar 22, 2015 4:36 pm
Posts: 12
Damn. No flux capacitors?


Top
 Profile  
 
PostPosted: Fri May 22, 2015 12:22 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
No, and no Mr Fusion either.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Fri May 22, 2015 12:55 pm 

Joined: Sun Mar 22, 2015 4:36 pm
Posts: 12
Dammit. My first order of business would be to find a DeLorean on ebay. Then, assemble the flux capacitor. The pic32mz would control the fuel injection system on the retrofitted V6 engine, as well as the 7-segment displays showing the destination years and times.


Top
 Profile  
 
PostPosted: Fri May 22, 2015 1:19 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi Matt and all,

So Matt, please consider my 'order' a backorder :).

And if I can help, please let me know how!

As you already know, I have a few ideas :) which I won't bother you further with :).

Really nice to see your efforts getting close to product land.

Fun journey! Good luck!! I spent most of my career doing products.

Lots of fun :).

Wiz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ] 

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:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission