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

#676 Post by Dany » 08 Aug 2013 17:59

About the wattmeter (see back a few posts).
2013-08-08: added the "Mains Isolation" expansion in the documentation (http://www.rosseeld.be/DRO/PIC/WattMeter.pdf).
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)

VCC
Posts: 463
Joined: 08 Jun 2009 18:31
Location: Romania

Re: PIC related website

#677 Post by VCC » 18 Aug 2013 10:05

Hi Dany,
I have recently downloaded USB_OA_Package.zip from Libstock and the WinCom.pas file from the archive is rather old. The problem I had was opening COM ports greater than 9. After a bit of searching on internet, I have found that COM names greater than 9 need names like this: '\\.\COM14'.
Here is the working code:

Code: Select all

function OpenCom(ComNr: TComNr;
  baud: LongWord;
  parity: Byte;
  databits: Byte;
  stopbits: Byte;
  sendbuffer_size,
  recbuffer_size: longword): Boolean;
var
  success: LongBool;
  ComName: PChar;
  res: Integer;
  Timeouts: TCommTimeouts;
begin
  success := true;    
  if not ComIsOpen(ComNr) then
  begin
    new(ComData[ComNr]);

    if ComNr > 0 then
    begin
      if ComNr < 10 then
        ComName := PChar('COM' + IntToStr(ComNr))
      else
        ComName := PChar('\\.\COM' + IntToStr(ComNr))
    end
    else
      ComName := 'COM1';
Please confirm the issue and update the file if needed. Thank you :D

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

Re: PIC related website

#678 Post by Dany » 18 Aug 2013 15:56

VCC wrote:Hi Dany,
I have recently downloaded USB_OA_Package.zip from Libstock and the WinCom.pas file from the archive is rather old. The problem I had was opening COM ports greater than 9. After a bit of searching on internet, I have found that COM names greater than 9 need names like this: '\\.\COM14'.

Please confirm the issue and update the file if needed. Thank you :D
I will check this (and change the code) as soon as possible. Thanks for the problem report. :D
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)

MaGiK
Posts: 897
Joined: 19 Apr 2013 10:00

Re: PIC related website

#679 Post by MaGiK » 20 Aug 2013 11:19

Hi Dany :D
I think your website is awesome!

I found another website that is good for learning stuff about PIC's.
http://www.best-microcontroller-projects.com/

I just wanted to share this with you and your large fan base.
For some reason, I feel like all of you guys already know about it :oops:

Best Regards
My hobby is collecting MikroElektronika products.
Gotta catch them all!

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

Re: PIC related website

#680 Post by Dany » 20 Aug 2013 11:51

MaGiK wrote:Hi Dany :D
I think your website is awesome!

I found another website that is good for learning stuff about PIC's.
http://www.best-microcontroller-projects.com/

I just wanted to share this with you and your large fan base.
For some reason, I feel like all of you guys already know about it :oops:

Best Regards
Hi MaGik, thanks for the compliment and the link. I have added the link to my own website, section "links". It seems indeed to be very interesting. Thanks! :D
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

#681 Post by Dany » 20 Aug 2013 16:38

VCC wrote:I have recently downloaded USB_OA_Package.zip from Libstock and the WinCom.pas file from the archive is rather old. The problem I had was opening COM ports greater than 9. After a bit of searching on internet, I have found that COM names greater than 9 need names like this: '\\.\COM14'.
Please confirm the issue and update the file if needed. Thank you :D
Confirmed. :D
The application TestCDC.zip has been updated (http://www.rosseeld.be/DRO/PIC/TestCDC.zip). The latter contains the updated WinCom.pas file.
I was totally not aware that only COM1..COM9 were defined in the Win32 file namespace (see http://msdn.microsoft.com/en-us/library ... px#maxpath, section "Win32 Device Namespaces").

Thanks again!
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

#682 Post by Dany » 11 Sep 2013 18:58

Hi, the CRTOS library (Cooperative Real Time Operating System), see http://www.libstock.com/projects/view/7 ... -mp-and-mb is now also available for PIC18.

Have fun! :D
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

#683 Post by Dany » 28 Oct 2013 18:10

Hi, the "TempSensors" library (http://www.libstock.com/projects/view/104/tempsensors) has a new version : v3.0: The "parasite" power capability has been added.
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

#684 Post by Dany » 07 Nov 2013 13:32

Hi, the "TempSensors" library (http://www.libstock.com/projects/view/104/tempsensors) has a new version : v4.0: The "Configuration" routines and a high resolution (DS18B20) stringconversion routine have been added:

Code: Select all

function DS1820_ReadPowerSupply(var Port_: byte; Bit_: byte): byte;
  // Returns the power supply type of the DS1820's connected to "Port_, Bit_":
  // 0 = at least one Ds1820 uses parasite power
  // 1 = all ds1820's are externally powered
  
procedure DS1820_SetConfiguration(var Port_: byte; Bit_, TH, TL: short; Wait: boolean);
  // Writes the temperature limits TH and TL to the Ds18(S)20 scratchpad and to EEPROM
  // TH is the upper temperature limit, TL is the lower temperature limit.
  // After the command parasite power is switched on.
  // If "wait" is true then 10 ms waiting time is added to allow EEPROM writing.
  
procedure DS18B20_SetConfiguration(var Port_: byte; Bit_, TH, TL: short; Resolution: byte; Wait: boolean);
  // Writes the temperature limits TH and TL and the config byte to the Ds18B20 scratchpad and to EEPROM
  // TH is the upper temperature limit, TL is the lower temperature limit
  // Resolution is 9,10,11 or 12 <<- translation of the resolution to the config byte is done by the routine
  // After the command parasite power is switched on.
  // If "wait" is true then 10 ms waiting time is added to allow EEPROM writing.
  
procedure DS1820_SetConfigurationROM(var Port_: byte; Bit_, TH, TL: short; Wait: boolean; var RomCode: array[8] of byte);
  // writes the temperature limits TH and TL to the Ds18(S)20 scratchpad and to EEPROM
  // TH is the upper temperature limit, TL is the lower temperature limit.
  // After the command parasite power is switched on.
  // If "wait" is true then 10 ms waiting time is added to allow EEPROM writing.

procedure DS18B20_SetConfigurationROM(var Port_: byte; Bit_, TH, TL: short; Resolution: byte; Wait: boolean; var RomCode: array[8] of byte);
  // writes the temperature limits TH and TL and the config byte to the Ds18B20 scratchpad and to EEPROM
  // TH is the upper temperature limit, TL is the lower temperature limit
  // Resolution is 9,10,11 or 12 <<- translation of the resolution to the config byte is done by the routine
  // After the command parasite power is switched on.
  // If "wait" is true then 10 ms waiting time is added to allow EEPROM writing.

procedure DS1820_GetConfiguration(var Port_: byte; Bit_:byte; var TH, TL: short);
  // Copies the EEPROM content to the scratchpad and returns the temperature limits TH and TL from the DS18(S)20 scratchpad
  // TH is the upper temperature limit, TL is the lower temperature limit.

procedure DS1820_GetConfigurationROM(var Port_: byte; Bit_:byte; var TH, TL: short; var RomCode: array[8] of byte);
  // Copies the EEPROM content to the scratchpad and returns the temperature limits TH and TL from the Ds18(S)20 scratchpad
  // TH is the upper temperature limit, TL is the lower temperature limit.
  
procedure DS18B20_GetConfiguration(var Port_: byte; Bit_:byte; var TH, TL: short; var Resolution: byte);
  // Copies the EEPROM content to the scratchpad and returns the temperature limits TH and TL and Resolution from the Ds18(S)20 scratchpad
  // TH is the upper temperature limit, TL is the lower temperature limit
  // Resolution is 9,10,11 or 12 <<- translation of the config byte to the actual resolution is done by the routine
  
procedure DS18B20_GetConfigurationROM(var Port_: byte; Bit_:byte; var TH, TL: short; var Resolution: byte; var RomCode: array[8] of byte);
  // Copies the EEPROM content to the scratchpad and returns the temperature limits TH and TL and Resolution from the Ds18(S)20 scratchpad
  // TH is the upper temperature limit, TL is the lower temperature limit
  // Resolution is 9,10,11 or 12 <<- translation of the config byte to the actual resolution is done by the routine

procedure DS18B20_TempToString_HR(Temp: integer; var S: string[9]; Sep: Char; Resolution: byte);
  // Returns temperature "temp", read from an DS18B20, as string in S, with 4 digits after the decimal separation char.
  // "Sep" is the decimal separation character.
  // "Resolution" (values 9, 10, 11 and 12) makes sure the "undefined" temperature bits are set to zero.
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

#685 Post by Dany » 11 Nov 2013 16:48

Hi, a new library has been published: OW_Utilities (http://www.libstock.com/projects/view/823/ow-utilities).

It provides the basic one-wrire search ROM and search ALARM routines.

The code is translated from the C-code provided in document http://www.maximintegrated.com/app-note ... mvp/id/187.

Have fun!
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)

joseLB
Posts: 444
Joined: 02 Apr 2006 05:56
Location: Riode Janeiro, Brasil

state machine routines

#686 Post by joseLB » 06 Feb 2014 17:51

Hi Dany, how are you going?

About your state machine routines:
1- Do you know or used a win7 sofware to graphicaly create a state machine?
2- Better yet, that generates some kind of text that I could use (manually editing, of course) to create the state machine?
Thanks
Jose

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

Re: state machine routines

#687 Post by Dany » 06 Feb 2014 19:44

joseLB wrote:Hi Dany, how are you going?

About your state machine routines:
1- Do you know or used a win7 sofware to graphicaly create a state machine?
2- Better yet, that generates some kind of text that I could use (manually editing, of course) to create the state machine?
Thanks
Jose
Hi Jose,
Thanks, I am doing well. :D
However, I have to disappoint you: I did not use any tool to do that. :(
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)

joseLB
Posts: 444
Joined: 02 Apr 2006 05:56
Location: Riode Janeiro, Brasil

Re: state machine routines

#688 Post by joseLB » 06 Feb 2014 21:18

Thanks, I am doing well. :D
==> good to know!
However, I have to disappoint you: I did not use any tool to do that. :(
==well, not so good but I will try to find something..
Thanks
Jose

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

Re: PIC related website

#689 Post by Dany » 16 Mar 2014 22:17

Hi all,
the "StateMachine" libraries in package "Schedulers" (http://www.libstock.com/projects/view/103/schedulers) has been upgraded with the "AnyState" as "fromstate" possibilty in the transition table. Can be used e.g. in case of an alarm state which needs the same reaction in every possible state.
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)

joseLB
Posts: 444
Joined: 02 Apr 2006 05:56
Location: Riode Janeiro, Brasil

Re: PIC related website

#690 Post by joseLB » 21 Mar 2014 00:48

Hi Dany

By any chance do you know a good software do compare changes betwen 2 MP projects? I mean, one project is copy of the other, the copy received some changes and now I need to compare the original project with the changed one.
Thanks
Jose

Post Reply

Return to “mikroPascal PRO for PIC General”