PIC related website

General discussion on mikroPascal PRO for PIC.
Author
Message
Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC related website

#661 Post by Dany » 01 Mar 2013 12:32

Hi, an I2c LCD library has been published: "LCD_I2c", see http://www.libstock.com/projects/view/97/lcd.
It is meant for LCD's using the PCF2116 lcd driver.
Last edited by Dany on 12 Mar 2013 19:01, edited 1 time in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC related website

#662 Post by Dany » 12 Mar 2013 18:59

Hi,

* A new package has been entered in Libstock: "Expanders" , see http://www.libstock.com/projects/view/603/expanders. For now only one library is present in it: "PCF8574" (I2c to/from 8 bits parallel). Can e.g. be used to drive an LCD via I2c (see below).

* An extra I2c LCD library has been published: "LCD_I2c_PCF8574" , see http://www.libstock.com/projects/view/97/lcd. This library drives a standard LCD via I2c with the help of an PCF8574 I/O expander. It uses the "PCF8574" library (see above).
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC related website

#663 Post by Dany » 18 Mar 2013 14:47

Hi,

A new package has been added in Libstock: Keypad_I2c (see http://www.libstock.com/projects/view/610/keypad-i2c).

It permits to connect an 4x4 keypad to a PIC via I2c (using a PCF8574(A) I2c expander). This saves a lot of pins, this making a keypad also possible to connect to PIC's with low pin count.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC related website

#664 Post by Dany » 28 Mar 2013 20:10

Hi,

A new library has been added to the LCD package (http://www.libstock.com/projects/view/97/lcd): LCD_SPI_74Hc595.
This library drives a standard LCD via an SPI output expander (the 74HC595 or 74HCT595).

Have fun! :D
Last edited by Dany on 25 Apr 2013 20:41, edited 1 time in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC related website

#665 Post by Dany » 22 Apr 2013 14:39

Hi, a new tool has been added to the website and LiBstock: a mikroPascal to mikroBasic source convertor, see
http://www.libstock.com/projects/view/6 ... -convertor or http://www.rosseeld.be/DRO/PIC/tools.ht ... _convertor.

This tool is a simple mikroPascal to mikroBasic source code convertor. The tool can convert complete mP units to mB modules and complete mP programs to mB programs.
Additionally the possibility exists to convert loose definitions and/or loose code (not embedded in a program or unit environment).

Documentation of the mP to mB convertor: http://www.rosseeld.be/DRO/PIC/Pascal_t ... vertor.pdf

Have fun!

Acknowledgement: Thanks to Janni for his testing effort, problem reports and improvement suggestions! :D :D

Screenshot:
Image
Last edited by Dany on 07 Feb 2014 12:41, edited 1 time in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

zoleexl
Posts: 4
Joined: 21 Jan 2013 17:28

Re: PIC related website

#666 Post by zoleexl » 15 May 2013 14:31

Hi, this message is for Dany, i want to use your TimeBase unit from the 'Schedulers' package. In my code, i use Janni/yo2lio's conversion and string libraries. This TimeBase library uses Danys' StringUtils, so i added the StringUtils library, but it has a conflict with the string library.

At compilation it gives error messages like this:
'Redefinition of 'memCpyC [StrngUtils.mpas] '. 'memCpyC' already defined in '__Lib_String.mpas'

Could you tell me what to do so i can use the TimeBase unit?

Thanks.

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: PIC related website

#667 Post by janni » 15 May 2013 18:17

Before Dany responds, simply try removing the uses clause in TimeBase unit. There's good chance that all needed routines are in the replacement libs and StringUtils is not necessary.

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC related website

#668 Post by Dany » 15 May 2013 19:59

janni wrote:Before Dany responds, simply try removing the uses clause in TimeBase unit. There's good chance that all needed routines are in the replacement libs and StringUtils is not necessary.
Yes, try that please. Thanks Janni. :D

Some elucidation: I have still the "unpleasant" habit of putting "uses" clauses in my code (inherited from my Delphi background). It links unconditionally a unit to the usage of another one, while mP has a Library Manager and a Project Manager to indicate what other units/libraries to use.

--> In fact, the unit "Timebase" does not need StrngUtils at all, probably the uses clause was some left over of test code in the unit that was removed... Sloppy of me. :oops:
I will publish a new version of TimeBase...
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC related website

#669 Post by Dany » 16 May 2013 10:52

Dany wrote:--> In fact, the unit "Timebase" does not need StrngUtils at all, probably the uses clause was some left over of test code in the unit that was removed... Sloppy of me. :oops:
I will publish a new version of TimeBase...
Above seems not to be true, "Timebase" uses the "MaxWord" constant out of "StrngUtils" (or the replacement of "String").
Sorry for the inconvenience.
Anyway the uses declaration in "Timebase" can be left out.
Last edited by Dany on 16 May 2013 11:20, edited 1 time in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC related website

#670 Post by Dany » 16 May 2013 11:16

Dany wrote:Anyway the uses declaration in "Timebase" can be left out.
Wrong again. :oops: I get an error message "Maxword not defined" if I leave out the uses clause.

This error can be eliminated by adding

Code: Select all

const Maxword: word; external;
just before "implementation" in the Timebase unit.
I do not know why the error occurs... Any idea Janni?
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: PIC related website

#671 Post by janni » 16 May 2013 12:22

I've included maxWord declaration in Math library replacement which seemed best place for it. If this replacement is not used then one may simply add the declaration (const maxWord: word = $FFFF;). Or you could use local declaration (in implementation section) in Timebase as I tend to do with libraries - not depending on users replacing complete set of libs.
This error can be eliminated by adding

Code: Select all

const Maxword: word; external;
This would mean either that maxWord is declared in some higher unit or that mP is miraculously extracting declaration from implementation section of String or Conversions lib replacements.

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC related website

#672 Post by Dany » 18 May 2013 17:50

Hi, the unit "TimeBase" (package "Schedulers") has been updated, both on Libstock and on the Website. It does not longer use "StrngUtils". I adopted the solution of Janni: define "Maxint" in the unit itself (see above post).
Sorry for the inconvenience! :oops:
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC related website

#673 Post by Dany » 21 Jul 2013 11:44

Hi, there is a new "project" added to the website and to Libstock: a "WattMeter" (powermeter) for 230Vac, max 2.5Aac, 50Hz: http://www.rosseeld.be/DRO/PIC/pic_proj ... #wattmeter or http://www.libstock.com/projects/view/7 ... ower-meter.

Documentation: http://www.rosseeld.be/DRO/PIC/WattMeter.pdf.

This Wattmeter is built with as less as components possible. It is therefor of course a little limited in range, accuracy and stability.

The meter is made for 230Vac (rms), max 2.5Aac (rms) and 50Hz, but is rather easily adaptable to other voltages, currents and frequencies. It can handle both sinusoidal and non sinusoidal voltages and currents, both with and without DC
component.

It measures:
- the Rms voltage (unit: Volt)
- the Rms current (unit: Ampère)
- the apparent power consumption (unit: VoltAmpère: VA, the product of both the rms Voltage and the Rms current). This value is also called “Complex power”.
- the real power consumption (unit: Watt) (= the one that you are going to pay for)
- the power factor (no unit, ratio of real power to the apparent power)

All values are shown on an LCD, except for the Apparent (Complex) power.
Additionally there is one push button to set the “zero” point for the AD convertors. The values of these zero
points are stored in Eeprom and recalled after startup of the PIC.

Important Warning! Safety issue: All electrical parts of the meter are connected to the
live mains supply. Do NOT touch any of those parts when the power meter is
connected to the mains outlet. Danger for Electrocution!


Also do NOT connect the circuit to e.g. a PC (via Rs232 or USB or...) because it will lead
to a short circuit, unless the mains used to feed the load is completely isolated from the actual mains power, e.g. via an isolating safety transformer.

Additions submitted by Larry Reisinger: Users should be warned not to try this with a cheap transformerless power supply. The really cheap 5v 'wall wart' power supplies aren't isolated. You need to be sure that the PS is a transformer type. They're getting hard to find.
One other possible way to power a meter like this is with a series capacitor type DC power supply. You run that directly off of the mains power, and don't worry about external power. They're limited in current, but for 50 ma, they can be reasonable.
Last edited by Dany on 07 Feb 2014 12:42, edited 4 times in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

chimimic
Posts: 178
Joined: 29 Sep 2007 14:35
Location: France
Contact:

Re: PIC related website

#674 Post by chimimic » 23 Jul 2013 22:41

Hi Dany,
excellent, thanks !

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC related website

#675 Post by Dany » 07 Aug 2013 21:00

About the Wattmeter (see back a few posts):
2013-08-07: Added documentation about modifications needed for higher currents than 2.5A~rms:
- The method with a dedicated current sensor IC (ACS...)
- The method with a series resistor and an extra amplifier

http://www.rosseeld.be/DRO/PIC/WattMeter.pdf
Last edited by Dany on 08 Aug 2013 18:00, edited 2 times in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “mikroPascal PRO for PIC General”