Menu

4bit Output on 16F688

Help
2010-07-16
2013-05-30
  • Nobody/Anonymous

    i cant get a 4bit output working on one of these.

    how do i set it up in great cow and configure 4 of the pins as outputs and sent it out a 4bit number please (to show on 4 LEDS)

    Thanks

     
  • David Stephenson

    chip 16F688,4

    #config OSC=INTRC_OSC_NOCLKOUT, MCLRE=OFF, WDT=OFF
    dir portc out
    start:
    for k= 0 to 31
    set portc=k
    wait 1 sec
    next k
    goto start
    

    so if you connect your LEDs to the C port (with suitable resistors- do not exceed the maximum current rating) the 4 LEDs should light in sequence from 0000 to 1111 cahnging every second.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.