More inchworm help needed

Status
Not open for further replies.
blueroomelectronics said:
What is the target chip?

A 12F509 or 16F54?

Its actually a 12F683. The only 2 chips I have currently are the 16F54 and the 12F683. The 683 dosn't have enough pins for the project I am currently trying to learn all this for, but I thought maybe I'd have better luck with the 683's internal ocsillator to get somthing up and running to play with.

kchriste - Thanks for the reply, I will give both those a try tomarrow.
 
Andy1845c said:
Its actually a 12F683.

The program should be something like this:

Code:
	list p=[b]12F683[/b]	
  	include "p12f683.inc"
    	
	;__CONFIG directive: choose oscillator type, code protection, etc.   


init    ;configuration: TRISIO, [u]analog inputs[/u], etc. This is the difficult                                       
        ;part


main    bcf    GPIO, 2	      ;GPIO2 low (LED coonected to +Vcc)
        ;bsf    GPIO, 2	       ;GPIO2 high(LED connected to GND)
loop    goto loop	      ;loop forever


        end
 
Last edited:
The 12F683 is a rather more complex chip than a 12F509.

I don't have one handy but you need to turn off the comparator and A/D will default to analog.

Code:
;*** WDT reset toggles GP2
  list p=12F683
  include <p12F683.inc>
  __CONFIG 0x3FFC
  org 0
  movlw 0x7
  movwf CMCON0
  banksel ANSEL
  clrf ANSEL
  movlw b'00001110'
  movwf OPTION_REG
  movlw b'11111011'
  tris GPIO
  banksel GPIO
  movlw b'00000100'
  xorwf GPIO, f
  sleep
  end
 
Bill - THAT WORKED!!!!!!!!!!!!

Eng1 - I got yours to work as well.

This must be my lucky night!!!

Can you tell i'm excited!!!!!! lol

Seriously, many many thanks to everyone that helped me with this. Now I feel re-inspired to learn to make it do more then blink But I think i'm gonna sit back and watch it blink for a while first
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…