Embedded Controllers by Micromint
Dozens of Embedded Controllers to Fit Any Industry
Home | Sales | Support | Pricing | Contact
Search Our Site


 
PicStic 2K Addendum

 

Version 1.2 Addendum
PicStic 2k Version

The PicStic is now available with double the program space, double the data EEPROM space, and over three times the RAM space. The 2k version is available for the PicStic 1, 2, 3, and 4. Micromint's part numbers are PicStic 1-2k, PicStic 2-2k, PicStic 3-2k, PicStic 4P-2k, PicStic 4Q-2k and PicStic 4X-2k.


  1. PIC16F628 Processor
  2. The PicStic 2k versions use the PIC16F628 processor instead of the PIC16F84 processor. The PIC16F628 is a high-performance, low-cost, CMOS, fully-static 8-bit microcontroller with 2kB x 14 FLASH program memory, 128 bytes of EEPROM data memory, and 224 RAM bytes for data. It executes an instruction in a single cycle (1µS at 4-MHz clock), except for program branches which take two cycles.

    The 2K PicStic still has an 8-level hardware stack but now has 10 interrupt sources. The peripherals include an 8-bit timer/counter with an 8-bit prescaler, an 8-bit timer with a prescaler and a postscaler, a 16-bit timer/counter consisting of 2 8-bit registers, a 10-bit capture and compare PWM and a hardware USART. The 13 bi-directional digital I/O pins can sink and source 25mA. All of the electrical specifications are the same as the Pic16F84's.


  3. Compiling Programs with earlier versions of PicBasic and PicBasic Pro

Because the PIC16F628 is a relatively new processor, special include files were added to the PicBasic and PicBasic Pro Compilers. Without these files the PicBasic family of compilers cannot be used to program the PicStic 2K. Versions of the PicBasic Compiler earlier than version 1.42 cannot be used to program the 2K versions of the PicStic. Also, versions of the PicBasic Pro Compiler earlier than 2.21 cannot be used to program the 2K version of the PicStic.

When compiling with version 1.42 of the PicBasic compiler or versions 2.21 through 2.32 of the PicBasic Pro compiler the following line needs to be added at the beginning of the users program:

Compiling with the PicBasic Compiler

Symbol CMCON = $1F

Poke CMCON,7

Compiling with the PicBasic Pro Compiler

CMCON = 7

 By adding this line to the users code, the analog comparators on PortA are set as Digital I/O. If this line is not added to the code than the processor will not be able to access any of the peripherals (I.E. the co-processor on the PicStic 4, the clock on the PicStic 2, or the A/D on the PicStic 3).

When compiling programs, the appropriate processor needs to be selected. At the command prompt the users command line should follow this format:

Compiling for the PicBasic Compiler

C:\PBC\PBC –p16f628 Filename.bas

Compiling for the PicBasic Pro Compiler

C:\PBP\PBP –p16f628 Filename.bas

 


3.0 Compiling for PicBasic Versions 1.43 and PicBasic Pro Version 2.33

 

PicBasic programs need to have -pps2k placed in the command line in order to compile a program for the PicStic 2k versions. A sample command line is PBC -pps2k filename. This one option will compile programs for the PicStic 1-2k, PicStic 2-2k, PicStic 3-2k, and PicStic 4-2k.

For existing PicBasic Pro programs there is a command line option for each PicStic 2k version. For the PicStic 1-2k, it is -pps1_2k. For the PicStic 2-2k, it is -pps2_2k. For the PicStic 3-2k, it is -pps3_2k. For the PicStic 4-2k, it is -pps4_2k. The following are examples of command lines for compiling programs for PicBasic Pro.

Sample PicBasic Programs

C:\PBC\PBC -pps2k picstic1.bas

C:\PBC\PBC -pps2k picstic2.bas

C:\PBC\PBC -pps2k picstic3.bas

C:\PBC\PBC -pps2k picstic4.bas

Sample PicBasic Pro Programs

C:\PBP\PBP -pps1_2k picstic1.bas

C:\PBP\PBP -pps2_2k picstic2.bas

C:\PBP\PBP -pps3_2k picstic3.bas

C:\PBP\PBP -pps4_2k picstic4.bas

 Existing PicBasic and PicBasic Pro programs for the original PicStic will be able to be compiled for the PicStic 2k versions without altering the program. This is done by recompiling the existing PicBasic and PicBasic Pro programs with the above mentioned command line options.

 


4.0 Programming PicStic 2k Versions

PicStic 2k versions can not be programmed using EPIC DOS. When using EPIC Windows version 2.30 or earlier, be sure to set the device for 16F628. For EPIC Windows version 2.31 or greater be sure, to select the appropriate PicStic 2k device. When programming the PicStic 2k versions with the PicStic programmer, JP1 must be connected to force power to the PicStic. If JP1 is not connected, a programming code error will occur. The original PicStic can be programmed with JP1 connected without damaging it. Warning: When inserting and removing a PicStic with JP1 installed the power to the PicStic programmer should be removed. Note: Make sure your configuration is set properly. If you want to be able to reset the PicStic 2k then Master Clear Reset needs to be checked. To keep from having to check or change your configuration make sure that "Update Configuration" is checked under the Options menu.

Because the PIC16F628 has a low voltage-programming mode, an error can occur when trying to program a 2K version of the PicStic. The error comes from the PORTB.4 pin in a floating state during programming. If a noise spike great enough to generate a high on this pin occurs during programming Epic will generate a error (Programming Error at code 0000) and the device will not be programmed. This can be avoided by programming the PicStic 2Ks in a low noise environment. Also, if PORTB.4 is being used as an output and the Master Clear Reset (in the configuration) is not selected, then the device must be erased before it can be programmed. If this is not done then epic will generate an error and the device will not be programmed. If the Master Clear Reset is selected then the device will program normally.

 



Sales
: 800-635-3355 | Support: 407-262-0066 | Fax: 407-262-0069
Office Hours: Monday - Friday 8:30am - 5:00pm EST
Sales@micromint.com | Support@micromint.com

Home | Corporate Overview | Modules | Communications | Micromint Chips | RTC | BCC | SBC | Development Systems
Application Notes | Manuals | Sales | Support | Pricing | Contact | OEM Partners | Downloads

Copyright © 2002 Micromint, Inc. All Rights Reserved.
webmaster@micromint.com