TOP Contributors

  1. MIKROE (2780 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139576 times)
  2. FAT32 Library (72043 times)
  3. Network Ethernet Library (57260 times)
  4. USB Device Library (47633 times)
  5. Network WiFi Library (43229 times)
  6. FT800 Library (42567 times)
  7. GSM click (29932 times)
  8. mikroSDK (28312 times)
  9. PID Library (26934 times)
  10. microSD click (26309 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Library

Common output functions

Rating:

6

Author: Istvan K

Last Updated: 2014-04-04

Package Version: 2.0.0.0

Category: Other Codes

Downloaded: 755 times

Followed by: 1 user

License: MIT license  

Second part of my new library collection: the common output functions, using func-pointers or a user written char-out routine. In addition, an other library with the mikroC UART1 and LCD char-outs. For all 8-bit PICs.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Common output functions" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Common output functions" changes.

Do you want to report abuse regarding "Common output functions".

  • Information
  • Comments (1)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Library Blog

This is the second part of my new library collection  (the first, already published part includes the "Bargraph" and the "PS2 Keyboard Simulator" libraries).
___________

Common output functions (PIC, mikroC).
There are 12 routines ("..." is the distinctive prefix, see below):

   String outputs:

...RstrOut  (char* rptr)                                      //write out a string stored in Ram
...RstrNout (char* rptr, char N)                          // the same but max N char(s)
...CstrOut  (const char* cptr)                            //write out a string stored in Code memory
...CstrNout (const char* cptr, char N)                // the same but max N char(s)

   Direct conversions (without any temporary buffer):

...BcdOut  (char)         //  "dd", char: max 0x99 (153), with leading zero(es)
...Dec2out (char)         //  "dd", char: max 99,                  -"-
...Hex2out (char)         //  "hh", char: max 255,                 -"-
...Hex4out (unsigned)  //  "hhhh", max 65535,                -"-

       Justified direct conversion  (controlled by an additional "just" parameter):
         just = -1: (just.B7 = 1) no alignment (with leading zeroes)
         just =  0: leading zeroes will be supressed (left  justified)
         just =  1: leading zeroes will be a space    (right justified)

...Dec2out_J (char onebyte, char just)   //    "dd" (or "d" or " d"), max 99 !!
...Dec3out_J (unsigned wrd, char just)   //   "ddd", max 999
...Dec4out_J (unsigned wrd, char just)   //  "dddd", max 9999
...Dec5out_J (unsigned wrd, char just)   // "ddddd", max 65535

See the "COMMONFUNCS_DOC.H"

These heavily optimized (using family-specific inline ASM) functions are included in my two new libraries:
   "p*_UART1-LCDouts.mcl"
       prefixes: "UART1_" and "LCD_" (see the "UART1-LCD-DOC.H")
   "p*_Out_Univ.mcl"
       prefixes: "Ptr_" and "Usr_"        (see the "OUT_UNIV_DOC.H")

For all 8-bit PICs, using different library prefixes: p* = p16, p16e or p18 

Proteus test poject included

Proteus test poject included

UART1 outputs

View full image

ALSO FROM THIS AUTHOR

PC keyboard in Proteus

1

* UPDATED * To try/debug (before the construction, in Proteus) such PIC programs that use the MikroC PS2 Library, here is a solution. It uses the Proteus Virtual Terminal as input device. * UPDATED * Now for any PIC *

[Learn More]

Memory manipulation library

5

Memory manipulation (eg sprint-like) function-collection plus some simplified arithmetic and bit-handling routine in one library. For all 8-bit PIC (pic12/16, pic12e/16e and pic18).

[Learn More]

Multi-SwUart library

6

Updated Multi-SwUart library (v3.0). Same way usable (uniformized), as my new LCD libs. It allows you to handle 4 (four) independent software (bit-banging) Uart. Now also for all 8-bit PIC (pic12/16, pic12e/16e and pic18).

[Learn More]