TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (405 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (133 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 (141825 times)
  2. FAT32 Library (74956 times)
  3. Network Ethernet Library (59317 times)
  4. USB Device Library (49308 times)
  5. Network WiFi Library (45107 times)
  6. FT800 Library (44675 times)
  7. GSM click (31287 times)
  8. mikroSDK (30214 times)
  9. microSD click (27664 times)
  10. PID Library (27563 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: 799 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

LCD BarGraph library

6

Contains an all-in-one function which allows to create parameterized LCD bargraph(s). 8 variants, 'unlimited' width. For any pic12/16, pic12/16_enhanced and pic18.

[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]

Full LCD library set

11

Same way usable (uniformized) LCD libraries. 4- and 8-bit (and both with Busy-flag checking), 1-, 2- and 3-wire interface. Every library allows you to manage 4 LCD. For all 8-bit PIC (p16, p16e and p18).

[Learn More]