Re: Calculating loop delays with pic12f509
I am learning pic programming in assembly language. Baseline PIC's. I have a learning disability which causes me much difficulty grasping things. I am having trouble understanding how to calculate the timing and looping and cycles for lighting an Led on and off at 500 milliseconds delay. With a PIC12F509. Any help and assistance would be more than appreciated.
CommentsAdd a comment
To add to what Boss has said, the 16F84A is about twenty years old. The 16F628A came along about ten years later. It has the same pin ordering as the 16F84A, but has a number of improvements in addition to being lower priced. It has twice as much program space, twice as much EEPROM space, and about three times as much RAM space as the 16F84A. It only needs about 2/3 the power of the 16F84A.
The 16F628A also has a built-in oscillator that needs no external crystal or resistor/capacitor, freeing up one or two pins for additional I/O unless you choose to use an external crystal (which you can still do).
The 16F628A also has additional peripherals built in. These include two more timers, two comparators, a USART for serial communications, and a Capture/Compare/PWM module. The 16F648A is like the 16F628A, but has twice the program storage, for more complex programs.
If you aren't trying to use an existing circuit board layout, I'd consider an even newer PIC like the PIC16(L)F1459. It moves the power and ground pins to one end of the package, instead of the middle. It is also 2.5 times as fast, and has a built-in USB port, a 9 channel 10 bit A/D converter, more PWM, etc., still for less than the 16F84A. And is supported by the PICkit 4.
When Microchip develops a new tool like the PICkit 4, they usually implement support for the most recent chips first, since customers using the older chips usually already have the older tools which support from them.
The 16F84A was replaced by the 16F628 a long time ago. It is not identical (some registers changed) and from memory any multifunction pin defaults to analog in. it uses the 'new' MC programming method so should be compatible with the tools.
The big negative is you will have to convert the example files in the many online sites.