Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Ads

Discussion Groups

Discussion Groups | Piclist | help!!!!! with pic 12f675

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

Re: help!!!!! with pic 12f675 - Paul James E. - Aug 1 3:29:00 2003


electromechy1,

Make sure you change the ADCON register to make the AD inputs Digital
I/O's instead of the analog inputs.

Regards,

Jim
> hi guys,
> just wtitten 1st prog as per data sheet,builds ok, problem is when i
> run it in simulator (mplab), trisio loading ok but gpio won't load
> value from w reg....i know i am doing something wrong...but can't find
> sample progs for 12f675...anyway heres my prog
>
> cmcon equ 19h
> gpio equ 05h
>status equ 03h
> trisio equ 85h
>
> bcf status,5 ;goto bank 0
> clrf gpio ;clear gen purp in/out port
> movlw 07h ;load w reg
> movwf cmcon ;set pin 0,1,2 to digital i/o
> bsf status,5 ;goto bank 1
> movlw 8h ;make pins 0,1,2,4,5 outputs
> movwf trisio ;pin 3 can only be input
> bcf status,5 ;back to bank 0
> movlw 3fh ;load w reg
> movwf gpio ;switch on pins
> end ;end program
>
> regards
>
>shaun >
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~--> Free shipping on all inkjet cartridge &
> refill kit orders to US & Canada. Low prices up to 80% off. We have
> your brand: HP, Epson, Lexmark & more.
> http://www.c1tracking.com/l.asp?cid=5510
> http://us.click.yahoo.com/GHXcIA/n.WGAA/ySSFAA/dN_tlB/TM
> ---------------------------------------------------------------------~->
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
>
>





(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )


help!!!!! with pic 12f675 - shaunundergrad - Aug 1 11:44:00 2003

hi guys,
just wtitten 1st prog as per data sheet,builds ok, problem is when i
run it in simulator (mplab), trisio loading ok but gpio won't load
value from w reg....i know i am doing something wrong...but can't
find sample progs for 12f675...anyway heres my prog

cmcon equ 19h
gpio equ 05h
status equ 03h
trisio equ 85h

bcf status,5 ;goto bank 0
clrf gpio ;clear gen purp in/out port
movlw 07h ;load w reg
movwf cmcon ;set pin 0,1,2 to digital i/o
bsf status,5 ;goto bank 1
movlw 8h ;make pins 0,1,2,4,5 outputs
movwf trisio ;pin 3 can only be input
bcf status,5 ;back to bank 0
movlw 3fh ;load w reg
movwf gpio ;switch on pins
end ;end program

regards

shaun






(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: help!!!!! with pic 12f675 - Author Unknown - Aug 1 13:35:00 2003

hi jim,
thanx for reply, adcon register defaults to zero, i.e, off

regards

shaun


Attachment (not stored)
Sixties Sunflowers .jpg
Type: image/jpeg



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: help!!!!! with pic 12f675 - jrem123 - Aug 1 15:23:00 2003

Why are you clearing gpio prior to setting up the port?

Note 08h is not 8h, is it?

This works for me on a 12F629 & 675

bcf status,5
movlw 0x07
movwf cmcon
bsf status,5
movlw 0x08
movwf trisio
bcf status,5
clrf gpio

Also, I think the 675 needs to have the ansel setup for analog,
cleared for digital I/O.

Regards, John.
--- In , "shaunundergrad" <electromechy1@a...>
wrote:
> hi guys,
> just wtitten 1st prog as per data sheet,builds ok, problem is when
i
> run it in simulator (mplab), trisio loading ok but gpio won't load
> value from w reg....i know i am doing something wrong...but can't
> find sample progs for 12f675...anyway heres my prog
>
> cmcon equ 19h
> gpio equ 05h
> status equ 03h
> trisio equ 85h
>
> bcf status,5 ;goto bank 0
> clrf gpio ;clear gen purp in/out port
> movlw 07h ;load w reg
> movwf cmcon ;set pin 0,1,2 to digital i/o
> bsf status,5 ;goto bank 1
> movlw 8h ;make pins 0,1,2,4,5 outputs
> movwf trisio ;pin 3 can only be input
> bcf status,5 ;back to bank 0
> movlw 3fh ;load w reg
> movwf gpio ;switch on pins
> end ;end program
>
> regards
>
> shaun




(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Re: help!!!!! with pic 12f675 - Author Unknown - Aug 1 15:32:00 2003

cheers john,
yes your right about the ansel having to be cleared, have it working now (on simulation anyway), i was clearing gpio because this was given as example in data sheet, don't forget i'm a newbie. one thing i haven't sussed yet...does the internal oscillator configured to come when powered up....and how do you know when you've blown a chip??

regards

shaun


Attachment (not stored)
Sixties Sunflowers .jpg
Type: image/jpeg




(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: help!!!!! with pic 12f675 - jrem123 - Aug 3 9:56:00 2003

I'm not sure I understand you question, if you configure the internal
oscillator to run then it runs when the chip powers up. b) I know
I've cooked a chip usually after I've done something stupid like put
15vdc on it instead of 5. Else you can fry a port or an I/O, but
they seem pretty hearty.

Regards, John.

--- In , electromechy1@a... wrote:
> cheers john,
> yes your right about the ansel having to be cleared, have it
working now (on
> simulation anyway), i was clearing gpio because this was given as
example in
> data sheet, don't forget i'm a newbie. one thing i haven't sussed
yet...does
> the internal oscillator configured to come when powered up....and
how do you
> know when you've blown a chip??
>
> regards
>
> shaun




(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: help!!!!! with pic 12f675 - burt0072003 - Oct 2 8:00:00 2003

You have to include config word
__CONFIG _CP_OFF & _INTRC_OSC_NOCLKOUT & _PWRTE_ON &
_WDT_OFF & _MCLRE_OFF

Just cut and paste other wise it won't work.

Burt
--- In , "Paul James E." <jamesp@i...> wrote:
>
> electromechy1,
>
> Make sure you change the ADCON register to make the AD inputs
Digital
> I/O's instead of the analog inputs.
>
> Regards,
>
> Jim >
> > hi guys,
> > just wtitten 1st prog as per data sheet,builds ok, problem is
when i
> > run it in simulator (mplab), trisio loading ok but gpio won't
load
> > value from w reg....i know i am doing something wrong...but
can't find
> > sample progs for 12f675...anyway heres my prog
> >
> > cmcon equ 19h
> > gpio equ 05h
> >status equ 03h
> > trisio equ 85h
> >
> > bcf status,5 ;goto bank 0
> > clrf gpio ;clear gen purp in/out port
> > movlw 07h ;load w reg
> > movwf cmcon ;set pin 0,1,2 to digital i/o
> > bsf status,5 ;goto bank 1
> > movlw 8h ;make pins 0,1,2,4,5 outputs
> > movwf trisio ;pin 3 can only be input
> > bcf status,5 ;back to bank 0
> > movlw 3fh ;load w reg
> > movwf gpio ;switch on pins
> > end ;end program
> >
> > regards
> >
> >shaun
> >
> >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> > ---------------------~--> Free shipping on all inkjet cartridge &
> > refill kit orders to US & Canada. Low prices up to 80% off. We
have
> > your brand: HP, Epson, Lexmark & more.
> > http://www.c1tracking.com/l.asp?cid=5510
> > http://us.click.yahoo.com/GHXcIA/n.WGAA/ySSFAA/dN_tlB/TM
> > ------------------------------------------------------------------
---~->
> >
> > to unsubscribe, go to http://www.yahoogroups.com and follow the
> > instructions
> >
>




(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )