PIC pong clock

posted Feb 22nd 2010 5:56am by
filed under: clock hacks

[Andrew] built this pong clock over the span of a couple of days. The PIC 18f2520 he used can serve as a real time clock with the addition of an external clock crystal. His project proves the usefulness of an oscilloscope as poor board layout caused interference in the crystal connections, something difficult to troubleshoot without this handy lab tool.

Pong clocks have been quite popular. This one is nice because it’s easy to throw together now that [Andrew's] done the coding work for you. Written in assembly, reading and understanding his code might be a good exercise if your low-level language skills are lacking.



12 Responses to PIC pong clock

  • strider_mt2k says:

    Haven’t seen the word “Archer” on anything hacky in a while. Very cool!

    Extra credit for that alone. ;)

  • Josh says:

    He needs to add some human reaction time delays to the paddles to make them look more realistic.

    Other than that, it’s pretty cool.

  • AJ says:

    Damn you duck, you’re on the front page of hackaday

  • steaky1212 says:

    i think that the project proves the usefullness of good ciruit practices

  • Robert says:

    Damn, player 2 kicks ass!! Player 1, you suck, you rarely ever score! Go back to pong school!

    Looks very nice. reminds me of some of the programming ideas I did on my TI. Those were the days….

  • josh says:

    whaaaatt no arduino?!!

  • Alan says:

    Until this week I’ve always programmed PICs in assembler, but I’ve started using C via the HI-TECH assembler in the 45-day pro-demo. It’s very intuitive – as in nice definitions in the header – and makes very small binaries. Free mode – without the omniscient code generation – is the opposite.

    I particularly like the assembler embedding to do bitwise operations:
    #asm
    bcf 0x0b, 2
    #end asm

    rather than:
    INTCON &= (1 << 2);

    Although in this example the pro mode HI-TECH compiler spots what I'm trying to do and boils over 10 instructions down to just the 1.

    It's a shame it's so expensive, I really would like an intuitive, efficient and free C compiler for PIC16 MCUs.

  • Alan says:

    … And yes, I do now realise I forgot to compliment (~) that C bit clearing method. Screwing up my interrupts in the process.

  • Jesse says:

    @Alan: I just use

    T0IF = 0;

  • AO says:

    Diggin’ the pong clocks!

  • Leave a Reply

    XHTML: You can use these tags: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Hack a Day serves up fresh hacks each day, every day from around the web as well as hacking related news.

    Send us your hacks






         




    Hacks

    Resources