View previous topic :: View next topic |
Author |
Message |
1980best
Joined: 25 May 2007 Posts: 26
|
12f508 not working PIN_B2 ? // problem T0CKI ? |
Posted: Sat Oct 11, 2014 7:03 pm |
|
|
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);
}
} |
|
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19372
|
|
Posted: Sun Oct 12, 2014 2:22 am |
|
|
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). |
|
![](templates/subSilver/images/spacer.gif) |
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Sun Oct 12, 2014 7:01 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19372
|
|
Posted: Mon Oct 13, 2014 12:42 am |
|
|
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..... |
|
![](templates/subSilver/images/spacer.gif) |
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Mon Oct 13, 2014 5:07 am |
|
|
Hi,
What are you guys smoking ? 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 |
|
![](templates/subSilver/images/spacer.gif) |
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Mon Oct 13, 2014 6:18 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19372
|
|
Posted: Mon Oct 13, 2014 7:35 am |
|
|
I still would not use it, on the cost/performance basis though..... |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9174 Location: Greensville,Ontario
|
|
Posted: Mon Oct 13, 2014 8:57 am |
|
|
Wow.. I just looked in my drawer and found 2 of the JW aka Windowed units !!!
Jay |
|
![](templates/subSilver/images/spacer.gif) |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Oct 13, 2014 11:33 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
|