CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

12f508 not working PIN_B2 ? // problem T0CKI ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
1980best



Joined: 25 May 2007
Posts: 26

View user's profile Send private message

12f508 not working PIN_B2 ? // problem T0CKI ?
PostPosted: Sat Oct 11, 2014 7:03 pm     Reply with quote

Code:

#include "12f508.h"
#Fuses NOWDT
#use delay(internal=4MHz)

#use STANDARD_IO( B )
#use FIXED_IO( B_outputs=PIN_B2 )

#define LED0 PIN_B0
#define LED1 PIN_B1
#define LED2 PIN_B2

#define DELAY 500

void main()
{
 
   while(true)
   {
      output_low(LED0);
      output_low(LED1);
      output_low(LED2);
     
      delay_ms(DELAY);
     
      output_high(LED0);
      output_high(LED1);
      output_high(LED2);
     
      delay_ms(DELAY);
   }

}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Oct 11, 2014 8:19 pm     Reply with quote

See the set_options() macro in this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=33336
That thread is about the 12F509 but the same solution will work
for the 12F508.
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Sun Oct 12, 2014 2:22 am     Reply with quote

You don't actually need this macro.

Simply add:

setup_timer_0(T0_INTERNAL);

to your code. This turns the T0CS and T0SE bits off.

They default to waking set as '1', which connects GP2 to the timer. T0CS, "overrides TRIS on the T0CKI pin" (quote from data sheet).
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Sun Oct 12, 2014 7:01 pm     Reply with quote

Isn't this part OTP?
Not very useful when prototyping.... i have 5 bricked by my ignorance.
_________________
CCS PCM 5.078 & CCS PCH 5.093
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Mon Oct 13, 2014 12:42 am     Reply with quote

It's a very old part.
OTP. There was an EEPROM version available for development, but this was expensive, and used UV EEPROM, so very slow to erase.

For any modern use, far better to get one of the more modern replacements. Faster clocks, FLASH etc..

Ten years ago, it was a useful small part, because it was very cheap. It was one of the first PIC's to go under $0.50. Now it is replaced by versions, that are just as cheap, and have better abilities. There are devices available for less money, that have 8* the clock rate, FLASH memory, and one or more extra peripherals. If you look at the 12F1571, it is cheaper, has 5* as much RAM, and over twice as much ROM, has comparators, ADC's, extra timers, DAC, bandgap Vref, PWM. Given that it costs less 'no contest'. The only reason to use the 508, would be if you have a drawer full.....
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Mon Oct 13, 2014 5:07 am     Reply with quote

Hi,

What are you guys smoking Very Happy ? The 12f508 is a flash based part (note the 'f'), and can be reprogrammed multiple times with ICSP. You guys must be thinking of the 12c508, which *is* OTP!

John
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Mon Oct 13, 2014 6:18 am     Reply with quote

I just checked my parts bin, indeed the bricks i own are the "C" version...

Ezflyr is right.
_________________
CCS PCM 5.078 & CCS PCH 5.093
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Mon Oct 13, 2014 7:35 am     Reply with quote

I still would not use it, on the cost/performance basis though.....
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Oct 13, 2014 8:57 am     Reply with quote

Wow.. I just looked in my drawer and found 2 of the JW aka Windowed units !!!

Jay
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Oct 13, 2014 11:14 am     Reply with quote

at mouser the

12F1572 is 1 penny more than
the 12F508 @ Q=100

its like comparing a rocket launcher to a pea shooter.

http://ww1.microchip.com/downloads/en/DeviceDoc/40001723C.pdf
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 13, 2014 11:33 am     Reply with quote

Right, but 12F1572 requires a programmer upgrade (if you don't have it)
to PICkit 3 or ICD3 or the equivalent.

Furthermore, it requires an upgrade to MPLAB X (it's not supported by
MPLAB 8.92), with a multi-day learning curve and frustrations.

The expense and the time may not be worth it, if you're a hobbyist or
doing a one-off project.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group