----- Original Message ----- From: "PicDude" Subject: Re: [PIC] 16f648A sample code? > You should be able to take any 16F628 code off the net or elsewhere and > make > just a few changes. The only gotcha is that the 648A has enough memory you need to worry about paging. But that does point to somethig worth mentioning to Carlos ... all the various 16F's are incredibly similar. And while you specifically mention initialization, the initialization code is as much dependent on your application as it is on the particular part. Basically, you initialize every peripheral you intend to use, and if a pin can be used for analog, you need to initialize it. That last rule is the one that gets a lot of newbies to the 628/628A/648A. The comparator input pins can't be used as digital until you configure the CMCON register. On other parts, the register might be CMCON0 CMCON1 or for parts with analog inputs, ANSEL. Once you get to doing anything at all, you need some initialization, but it depends on your app. With the exception of the weird analog rule, it is pretty simple business to read the datasheet to figure out what you need. The analog thing is sort of a gotcha since it refers to a peripheral you don't intend to use. I suppose if everyone memorized the datasheets it wouldn't be an issue, but we're not all Wouter. --McD -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist