To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 4062
4061  |  4063
Subject: 
Re: BrickOS Patches and Development
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 15 Jun 2010 10:21:39 GMT
Viewed: 
32452 times
  
Hello Yann,

2010/6/15 Yann Vernier <yann@algonet.se>:

I've recently mucked about with the Power Functions protocol, and got a proof of
concept running on the RCX using brickOS. The main problem is that it's quite
timing sensitive, so this code only worked reliably with interrupts disabled
(looking at the oscilloscope).

The sample code is at http://www.algonet.se/~yann/powerfunctions.c

The timing requirements are probably more lax in reality (PF protocol spec cites
ranges like 316-526us for a 0 bit), but my code was thrown off by whole periods
(of the 38kHz modulation signal) as other interrupts occurred.

I really would prefer to see the interrupt code running to disabling
all interrupts for several milliseconds, loosing several ticks and
disabling all sensors during this time.

Did you apply one of my performance patches to brickOS?  IIRC, the
current release of brickOS still has a busy waiting loop in the sensor
interrupt, which explains why you get corrupt timings.  The patches
are at
http://hoenicke.ath.cx/rcx/brickOS.html

You can also use my simulator brickemu to get some statistics about
maximal run-time of interrupts.  It shouldn't be too difficult to add
debugging output to the 8-bit timer to get cycle exact information of
when the registers are set.  You can also debug your code with
brickemu by adding printf in your code.

It looks hard to get the interrupts fast enough, though. According to
my statistics, the timer interrupt in bibo can take up to 1031 cycles,
i.e 65 us, which is still more than the period of your timer. On
average it runs in only half the time, so you should not loose so many
cycles that your signal is distorted beyond recognition.

Regards,
  Jochen



Message has 1 Reply:
  Re: BrickOS Patches and Development
 
Re: Power Functions: There is an older thread on the topic of Power Functions at [ (URL) ] which includes links to some BrickOS-based code for Power Functions. Be sure to follow the thread to the end, as some of the links mentioned earlier on no (...) (14 years ago, 17-Jul-10, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: BrickOS Patches and Development
 
(...) I've recently mucked about with the Power Functions protocol, and got a proof of concept running on the RCX using brickOS. The main problem is that it's quite timing sensitive, so this code only worked reliably with interrupts disabled (...) (14 years ago, 15-Jun-10, to lugnet.robotics.rcx.legos)

29 Messages in This Thread:






Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR