Goldfish Bowl http://blog.goldfishsbowl.co.uk Sat, 15 Aug 2009 23:31:10 +0000 http://wordpress.org/?v=2.8.4 en hourly 1 PIC10F Assembly “Hello World” http://blog.goldfishsbowl.co.uk/2009/08/15/pic10f-assembly-hello-world/ http://blog.goldfishsbowl.co.uk/2009/08/15/pic10f-assembly-hello-world/#comments Sat, 15 Aug 2009 00:00:16 +0000 fish http://blog.goldfishsbowl.co.uk/?p=346 So for a project, I’m using a PIC10F due to their very small size (in a SOT23-6, wow) and low cost.  They don’t have interrupt support, but they do have a timer, watchdog timer and a comparator.  You can do some fairly funky things with them.  However, I’m opting to use assembly for this project since it’s probably going to be simpler this way, as the stuff I need to do is very timing critical (reading sensors without interrupts = lots of polling).  Also I think I can squeeze the size of the program down better than a C compiler might do.

But I ran into a roadblock.  There are no documentations of assembly code listings for the PIC10F, and very few resources online.  So here’s a little snippet for you, which blinks an LED on pin GP2:

	list      p=10F222            ; list directive to define processor

#include
        ; processor specific variable definitions

    #define LightOn bsf GPIO,2  ; turn drive output on
    #define LightOff bcf GPIO,2 ; turn drive output off

;**********************************************************************
	ORG     0x1FF             ; processor reset vector
	ORG     0x000             ; coding begins here

    cblock 0x18 ; this is where we declare what to call user memory locations
      DelayTime:3       ; reserve 3 locations for delay counters
     endc

	goto Init
Start:
	clrwdt
	LightOn
	call Delay
	LightOff
	goto Start

Init:
    movwf   OSCCAL      ; load factory osccal value at start-up
    bcf     OSCCAL,0    ; do NOT output osc/4 on GP2 (IR sensor input)
    movlw   b'00000000' ; set all GPIO low at startup
    movwf   GPIO        ; load port latches
    movlw   b'00000000' ; All GPIO pins are outputs
    tris    GPIO        ; set I/O directions
    movlw   b'11011000'	; wake-up on pin change disabled, weak pull-ups off
                        ; Timer0 clock select on GP2 internal
    option              ; write to OPTION_REG

    ; clear all user RAM/variables on boot

    movlw  0x10         ; initialize pointer
    movwf  FSR          ; to RAM start
	goto Start

Delay					  ;
    movlw   D'2'          ; 2 = a delay period of approximately 500mS

Delay2                    ;
    movwf   DelayTime     ; pre-load W & enter at Delay2 for different delays
    movlw   D'232'        ;
    movwf   DelayTime+1   ;
    movlw   D'255'        ;
    movwf   DelayTime+2   ;
Dloop
    clrwdt                ; 1
    decfsz  DelayTime+2,f ; 1
    goto    $-2           ; 2/1
    decfsz  DelayTime+1,f ; 1
    goto    $-4           ; 2/1
    decfsz  DelayTime,f   ; 1
    goto    $-6           ; 2/1
    retlw   0             ; 2

	end

Delay routine and general structure is shamelessly stolen from Bruce on PICbasic.co.uk.

Hopefully, someone will find this useful :)

]]>
http://blog.goldfishsbowl.co.uk/2009/08/15/pic10f-assembly-hello-world/feed/ 0
Lounge on the Farm: Outside Broadcast for CSR (Part III) http://blog.goldfishsbowl.co.uk/2009/07/14/lounge-on-the-farm-outside-broadcast-for-csr-part-iii/ http://blog.goldfishsbowl.co.uk/2009/07/14/lounge-on-the-farm-outside-broadcast-for-csr-part-iii/#comments Tue, 14 Jul 2009 12:49:02 +0000 fish http://blog.goldfishsbowl.co.uk/?p=334 We did it! High fives all round.

After a lot of preparation, sweat and blood we managed to broadcast live, for 11 hours a day for 3 days, from a pigshed in the middle of nowhere. Here’s a little tour of our makeshift station:

This is the Edit Suite and Tech Corner, fully set up. As I mentioned in Part II, we have the encoder on the back wall which encoded audio from the studio (coming up next), and sent it over the point to point wireless link. The edit machines saw a lot of action, as we (the tech team) dashed about the site transporting Marantz recorders from the various stages back to base to be edited for broadcast. They were also used to edit interviews and other bits of audio for broadcast. Once the editing was complete, the data was transferred to the Playout machine in the Studio, where they were added to the database and played out on air.

Here’s the studio. Presenter goes behind the desk, guests and co-hosts in front. We did a lot of mic swapping, and patching over the course of the weekend to accomodate different requirements. The studio ended up being used not only for live interviews and shows, but also for live musical performances! Below we see the rather excellent Harp for Hangovers performing a live set in the studio. We also had Lucy Kitt perform two tracks for us. The quality was excellent, and far better than we expected.

All in all, it was a very successful OB. The editing team have got many hours of live recordings to work with, which will hopefully start being played out on FM in the near future. As one of the OB’s I’ve helped with, I was extremely impressed at how smoothly it went. There were a few hicups, but nothing that caused any significant problems for the running of the TX. High fives indeed!

You can see the rest of my photos for the event on my flickr tag “lotf”.

]]>
http://blog.goldfishsbowl.co.uk/2009/07/14/lounge-on-the-farm-outside-broadcast-for-csr-part-iii/feed/ 0
Lounge on the Farm: Outside Broadcast for CSR (Part II) http://blog.goldfishsbowl.co.uk/2009/07/10/lounge-on-the-farm-outside-broadcast-for-csr-part-ii/ http://blog.goldfishsbowl.co.uk/2009/07/10/lounge-on-the-farm-outside-broadcast-for-csr-part-ii/#comments Fri, 10 Jul 2009 14:06:56 +0000 fish http://blog.goldfishsbowl.co.uk/?p=328

CSR is doing an outside broadcast at the music festival called Lounge on the Farm, and broadcasting live (right now as of this writing) on the Internet and on FM 97.4MHz in Canterbury. I am a volunteer for Engineering, and the team had the challenge of making all this possible.

On Thursday morning at about 1030 we rocked up to the “venue” in The Kitchen van. We found a pig/horse/cattle shed, complete with straw and cobwebs, and various forms of Hanging Death.

We got the farmer to remove the hanging guttering you see in the above picture, and we removed most of the dangling bits of wood in the roof and put duct tape over all the sharp bits on the walls.

After a large amount of sweeping and clearing, we manage to get it into a semi-decent state so we can start putting all of the kit into the “rooms”. Meanwhile, we were setting up the 5GHz link between the pigshed and the site office where there is an Internet connection.

Here we have a wind up stand, with a crossbar holding an point-to-point wireless link we got from Solwise, and a FM antenna for our radio tuner in the studio.

Once we had the client end of the wireless link in position, we were ready to install the other end. Fortunately, we had found a place to mount the other side that was in perfect line of sight to the receiver. However, it was a little bit scary.

Here we see a terrified looking Rich on the top of a bent lighting mast, and a bit of CAT5 flying down to the portacabins below. We then ran the CAT5 through a window in the site office and into the kitchen (!!) where they have their ADSL router. We installed the Power over Ethernet Injector (which we were praying would work over that length of cable), and plugged it in. And what do you know, it worked perfectly first time.

Once the Internet connection was up, we set about building the transmission equipment.

We’ve got a little AMD Semperon machine which has a DI coming from the studio on the other side of the shed, which is then encoded into AAC+ by SAM Broadcaster and sent over the network connection to the station on the Canterbury campus. We chose AAC+ due to its ability to encode to high quality over very low bitrates. This also means that we don’t need very much bandwidth to provide the stream, which is very good when you’re out in the sticks! It’s quite resilient to packet loss too, as we found.

Most of the networking kit is running off a UPS – mainly so that if the power fluctuates (which is does, quite a lot) then we don’t break the power supply too much, and the link won’t go down (causing a lengthy rebooting process, and potential dead air).

Next to Tech Corner (also known as Rat corner, due to there being a dead rat lying there when we arrived), we have 2 edit stations, where the producers can download content from the recorder units we are using on the stage, and edit them for playout using Audacity.

And finally, the studio.

The studio consists of 4 mics, 2 mixers, a playout system, 2 CD decks and an outboard with compressors and a Saphire 90 sound card. We ended up using SAM Broadcaster for playout. There’s an area for guests in front of the desk, and 2 presenters behind it.

So far, the broadcast has been going beautifully – there was a power outage this morning (we think the main stage is using the same power feed as us, and the breakers tripped). After our Engineers moved the power over to a genny feed, we were back up and running.

I wasn’t actually on site today, however I will be there tomorrow and I hope to post an update from the pigshed!

]]>
http://blog.goldfishsbowl.co.uk/2009/07/10/lounge-on-the-farm-outside-broadcast-for-csr-part-ii/feed/ 0
Lounge on the Farm: Outside Broadcast for CSR (Part I) http://blog.goldfishsbowl.co.uk/2009/07/06/lounge-on-the-farm-outside-broadcast-for-csr-part-i/ http://blog.goldfishsbowl.co.uk/2009/07/06/lounge-on-the-farm-outside-broadcast-for-csr-part-i/#comments Mon, 06 Jul 2009 13:32:25 +0000 fish http://blog.goldfishsbowl.co.uk/?p=323 Since April I’ve been volunteering some of my free time to work with the Tech team at Canterbury Student Radio CSR FM (broadcasting on 97.4 FM in the Canterbury area, as well as streaming on the Internets). It’s great fun, and gives me lots of freedom to work on interesting projects.

So far, I’ve been involved in building Linux servers, helping maintain Windows Servers, writing perl scripts, doing analog circuit design, building an Asterisk PBX, customising Cisco 7960G IP Phones, as well as lots of other odds and ends.

CSR is going to be broadcasting from the music festival in Canterbury called Lounge on the Farm. This is quite a technical challenge, as you might imagine. Broadcasting from a farm in the middle of nowhere is quite tricky. I’ve been helping out with the preparation for the Outside Broadcast, which will be going live on air this coming weekend (11th -13th July 2009).

We built 4 Windows XP computers to use on Lounge on the Farm to do an outside broadcast for CSR

One for encoding, one for playout (using JAZZLER , apparently) and two with Audacity for audio editing.

300g disks are in the playout and edit machines. And shared with peer to peer file sharing. All set up so all machines can see all drives.

Job is what one might call a good ‘un.

]]>
http://blog.goldfishsbowl.co.uk/2009/07/06/lounge-on-the-farm-outside-broadcast-for-csr-part-i/feed/ 3
Colour Code http://blog.goldfishsbowl.co.uk/2009/05/25/colour-code/ http://blog.goldfishsbowl.co.uk/2009/05/25/colour-code/#comments Mon, 25 May 2009 00:21:59 +0000 fish http://blog.goldfishsbowl.co.uk/?p=320 Something I came up with this afternoon with the help of Fluffy, and for a project that we’ll be doing in the somewhat near future.

It’s a code, using colours. See if you can crack it ;)

]]>
http://blog.goldfishsbowl.co.uk/2009/05/25/colour-code/feed/ 0
Body QR Code http://blog.goldfishsbowl.co.uk/2009/05/07/body-qr-code/ http://blog.goldfishsbowl.co.uk/2009/05/07/body-qr-code/#comments Thu, 07 May 2009 01:56:35 +0000 fish http://blog.goldfishsbowl.co.uk/?p=317 I like QR Codes.  I’ve made QR Poems before now, and the idea of having a barcode printed on my hand has been knocking around my head for a while, so I thought I’d give it another shot.  Unfortunately I didn’t do it very well.  Note to self: paint sticks to paper better than skin >_<

Next time, body paint!

]]>
http://blog.goldfishsbowl.co.uk/2009/05/07/body-qr-code/feed/ 0
Facebook thinks I’m from Jenny’s block http://blog.goldfishsbowl.co.uk/2009/04/12/facebook-thinks-im-from-jennys-block/ http://blog.goldfishsbowl.co.uk/2009/04/12/facebook-thinks-im-from-jennys-block/#comments Sun, 12 Apr 2009 04:12:39 +0000 fish http://blog.goldfishsbowl.co.uk/?p=308

Yeah, Jenny from mah block!

Uhh, no.

]]>
http://blog.goldfishsbowl.co.uk/2009/04/12/facebook-thinks-im-from-jennys-block/feed/ 0
Infrequenty Asked Questions II http://blog.goldfishsbowl.co.uk/2009/04/09/infrequenty-asked-questions-ii/ http://blog.goldfishsbowl.co.uk/2009/04/09/infrequenty-asked-questions-ii/#comments Thu, 09 Apr 2009 01:48:04 +0000 fish http://blog.goldfishsbowl.co.uk/?p=299 Ah, time for another happy installment.

  • User: Hi, are you a helpdesk person?
  • Me: Yes ….
  • User: There’s a wasp in Level 2 Computer room … can you get rid of it for me?
  • Me: Um.  I’ll call security.
  • User: Hi are you IT support?
  • Me: Yes ….
  • User: My the tap in my kitchen is leaking.

In a feedback form:

  • User: The noise level in Level 4 Extension is unacceptable!  I can’t concentrate, it’s  like a discussion area!
  • Supervisor: Level 4 Extension *is* a group discussion area.
  • User: My document isn’t coming out in colour!
  • Me: (looking at their print history) that’s because you printed it to a black and white printer.  There’s 2 colour printers, colour2 and colour3.
  • User: Oh.  Can I get a refund?
  • Me: Because you sent it to the wrong printer?  No.
  • User: My document didn’t print
  • Me: (looking at print history) that’s because you don’t have enough credit.  And you’re not likely to either
  • User: What?
  • Me: Unless you happen to have £13,000 in pound coins on your person.

(turns out they had put the pages they wanted to print into the copies section, and so were ordering something like 242,526 copies of a 60 odd page document. )

**UPDATE**

Had to squeeze this one in:

  • User: I’ve tried to print a document in colour and it’s not coming out.
  • Me: (looking up the job) Ah well, that’s because you printed it on a black and white printer.  In a computer room on the other side of campus.
  • User: Oh.  Can I get a refund?
  • Me: Uhh, no.

(I eagerly await the day when someone accidentally prints something on another campus, and then they ask me where the printer is)

]]>
http://blog.goldfishsbowl.co.uk/2009/04/09/infrequenty-asked-questions-ii/feed/ 0
*twitch* http://blog.goldfishsbowl.co.uk/2009/03/01/blargh/ http://blog.goldfishsbowl.co.uk/2009/03/01/blargh/#comments Sun, 01 Mar 2009 04:12:56 +0000 fish http://blog.goldfishsbowl.co.uk/?p=296 I’ve been working on my second year project for the last …. 12 hours now.  Most of the backend is done.  It looks like this:

As I snapped this screenshot, I noticed that my BlueJ window was exactly 1337 pixels wide.  That’s surely got to be a good sign, right?

Now, before someone goes off on a rant “Oh, NMEA parsing isn’t hard, I did it in a Python script!”.  I’ve got to do a bit more than just updating Location information.  I have to generically parse all NMEA sentences and check if they’re valid or not, and depending on whether they’re a Proprietary sentence or not I need to switch send the data to the right sort of object.  I’ve got measurements coming in on the stream which gives me Temperature, Humidity, Pressure and vertical acceleration.  I need to be able to dispatch these Measurements to the right places so they can be updated in the GUI. Also, each one of these Measurements needs to be associated with a Location.  I also need to be able to throw Exceptions which can be sensibly handled by the clients. Also everything needs to be completely documented.

It’s not particularly hard, just big and long. The class to turn the GGA sentences into Locations was the easy bit.

Now: I’m going to watch some BSG and go to sleep before my shift in 10 hours.

Bleeeding!

]]>
http://blog.goldfishsbowl.co.uk/2009/03/01/blargh/feed/ 0
Error’d: OrCAD knows what’s best for my Vias http://blog.goldfishsbowl.co.uk/2009/02/25/errord-orcad-knows-whats-best-for-my-vias/ http://blog.goldfishsbowl.co.uk/2009/02/25/errord-orcad-knows-whats-best-for-my-vias/#comments Wed, 25 Feb 2009 20:17:32 +0000 fish http://blog.goldfishsbowl.co.uk/?p=293

Oh, OrCAD.  If it weren’t for these little gems of error messages, I’d throw it out the window.

]]>
http://blog.goldfishsbowl.co.uk/2009/02/25/errord-orcad-knows-whats-best-for-my-vias/feed/ 0