* * *

Author Topic: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library  (Read 32935 times)

bartdereu

  • New member
  • *
  • Posts: 17
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #15 on: August 10, 2013, 10:05:19 pm »
Thank you!

Now it compiles.

But another question:
If I make a new project (only one form) an add rpi_hal.pas in the uses clause, compile and run the project I get an exception (SIGSEGV) when I close the program.
Without rpi_hal in the uses the program works.

What am I doin wrong?

I have the same problem, but a runtime error 211 . The test program for the command line test (./testrpi ) works fine, so the hardware and other things should be installed fine.

But i really need to get this PiFace running under Lazarus, and so far i'm unable to do so. Anyone has had more luck then me ?
« Last Edit: August 10, 2013, 10:11:17 pm by bartdereu »

sfischer

  • New member
  • *
  • Posts: 35
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #16 on: August 11, 2013, 06:36:51 pm »
Hi Bart,

I never tried Lazarus. next week I'm very busy. Maybe we can do a remote session on Monday 19.Aug or Tuesday.
Stefan

bartdereu

  • New member
  • *
  • Posts: 17
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #17 on: August 12, 2013, 04:16:43 pm »
Ok, no problem .  i got a little futher as you can read in this post :

http://forum.lazarus.freepascal.org/index.php/topic,17404.msg127797.html#msg127797

only thing left is to be able to read the inputs wit the fpsystem function. i can't get it to work !  >:D

justtt

  • Newbie
  • Posts: 3
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #18 on: October 24, 2013, 09:02:43 am »
Hi all ... :)

my english is not the best, but i hope you will understand me ... ;-)

firstly thank you sFischer for your work ...
i got a running Raspi with Lazarus/Freepascal and your rpi_hal to read the Ports of the Piface in a thread to update (100ms) my Gui.
It works really fine, i needed a while to understand all the things about and around the Raspi (never worked with Linux before and never bind Units from other programmers in Lazarus) ... but it's allmost done ...

Now it's a point where i need more Inputs to my Pi ... i read about Pi Rack and the ability to add PiFaces up to 4 to ONE PI ...
My Problem is, how can i get to communication to an other PiFace, means to the SPI address 1 (default is 0; Jp1(0);Jp2(0))!?
any ideas for me? is it possible with your unit rpi_hal?

Thanks a lot for all help.

Greetz Tom / justtt
« Last Edit: October 24, 2013, 10:21:06 am by justtt »

sfischer

  • New member
  • *
  • Posts: 35
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #19 on: October 24, 2013, 11:57:22 am »
Hi,

pls. download updated version of rpi_hal (V1.9) from following link. I have added the device address (devadr) to all pfio_x functions. devadr is the MCP23S17SP address, determined by the A2-A0 pin settings (from 0-3).
So you can address multiple PiFace boards. But I don't have tested the code. Pls. test the code with different settings of A2-A0 and report your testresults.

Stefan

The SW can be found here:
http://shop.basis.biz/shop/Raspberry-PI/piggy-back-board/
under the point SW: SW e.g. rpi_hal:

justtt

  • Newbie
  • Posts: 3
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #20 on: October 24, 2013, 12:57:17 pm »
WoW brilliant sfischer ;-)

I've tested 0-3, all done fine ... So everybody who wants a Pi with 32 Inputs and 32 Outs can use it :-)

I'm very happy about it. Thank you very much.

I have no PiRack till now, but i will improvise for now to test simultan using of two PiFaces.
I will edit this here later.

Thank you
- Tom | justtt

sfischer

  • New member
  • *
  • Posts: 35
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #21 on: October 24, 2013, 07:04:01 pm »
Hi,

just uploaded a new Version of rpi_hal (V1.10).
I have added some BitBang-functionality.
So you can Switch-On/OFF PowerSwitches (e.g. ELRO, Intertechno).
Prerequisite is, that you have a connected 433.92MHz Transmitter on a GPIO-Pin to the RPI. Also the Morse-Alphabet is implemented. That enables you, to Morse with a e.g. LED which is connected to a GPIO-Pin. Any other Device, that is OOK (OnOffKeyed) can be used.

BB_SetPin(rpi_status_led_GPIO); // set the GPIO-Pin to Rpi Status LED
Morse_tx('This is a Morse Test'); 

Stefan

The SW can be found here:
http://shop.basis.biz/shop/Raspberry-PI/piggy-back-board/
under the point SW: SW e.g. rpi_hal:

justtt

  • Newbie
  • Posts: 3
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #22 on: October 28, 2013, 08:51:26 am »
So I've tested the abbility to usw more then one PiFace in my source code ...

It works really nice. The PiFaces dont need to be initialized with pfio_init.
[EDIT 15.11.2013 Only dont need to be initialized when using address 0 ... all other need to be initialized]

@bartdereu ... the best way is to "synchronize" the Gui by using a external Thread and bind it by synchronize ... dont forget a delaytime by using it ;-) ... It's like to "speak" with a serial port ...

@stefan ... thanks a lot ... really really thank you much :-)
« Last Edit: November 15, 2013, 12:40:22 pm by justtt »

sfischer

  • New member
  • *
  • Posts: 35

Tibo

  • Newbie
  • Posts: 1
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #24 on: December 02, 2014, 01:48:43 pm »
Hi, and thanks for your great work on RPI HAL!

I'm new to the RPI world.  I'm interested in i2c communication.

Your last posted URL leads to rpi hal version 1.1:
http://shop.basis.biz/shop/Raspberry-PI/piggy-back-board/index.html

Since I'm interested in i2c communication, I'm looking for version 1.3 (or higher if it exists ;-)
Could you please share a link to version 1.3

Thanks! 

sfischer

  • New member
  • *
  • Posts: 35
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #25 on: December 06, 2014, 05:51:32 pm »
Hi,

just uploaded new version 3.1 of rpi_hal.
You can find it here: http://shop.basis.biz/shop/Raspberry-PI/piggy-back-board/index.html
scroll down until you see rpi_sw.tgz and download the archive.

New function:
Added a bidirectional device like /dev/mydevice
you can read and write to it.
No kernel modifications necessary. Just pure user space.

Stefan

richard_rtech

  • New member
  • *
  • Posts: 35
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #26 on: February 12, 2015, 12:58:47 pm »
Have not had time to look into it but with Laz 1.2.4 on RPI2 even adding RPI_HAL in the uses clause of an app causes a SIGABRT. If I get ten mins I'll try with the older board and see if the same happens. There is no code using RPI_HAL at this point and I havd DCPCrypt, Sockets (my rebuilt ver) and SynaSer installed. :( Looks like I'm writing my own I2C code...

szlbz

  • Newbie
  • Posts: 2
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #27 on: March 12, 2015, 08:59:26 am »
Hi,

just uploaded new version 3.1 of rpi_hal.
You can find it here: http://shop.basis.biz/shop/Raspberry-PI/piggy-back-board/index.html
scroll down until you see rpi_sw.tgz and download the archive.

New function:
Added a bidirectional device like /dev/mydevice
you can read and write to it.
No kernel modifications necessary. Just pure user space.

Stefan

Hello, I can not download the Rpi HAL file, you can EMAIL to me? My EMAIL is szlbz@sina.com, thank you.


ghamm

  • New member
  • *
  • Posts: 16
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #28 on: March 17, 2015, 04:59:02 am »
Were you able to get this to work? Im anxious to get this to work on the PI 2.. Just getting started..

Have not had time to look into it but with Laz 1.2.4 on RPI2 even adding RPI_HAL in the uses clause of an app causes a SIGABRT. If I get ten mins I'll try with the older board and see if the same happens. There is no code using RPI_HAL at this point and I havd DCPCrypt, Sockets (my rebuilt ver) and SynaSer installed. :( Looks like I'm writing my own I2C code...

epielettronica

  • Newbie
  • Posts: 2
Re: Lazarus / RaspberyPi rpi_hal Hardware Abstraction Library
« Reply #29 on: April 03, 2015, 07:39:09 pm »
to run with pi2 you must:
change line
  BCM2708_PBASE_pag    = $20000; { Peripheral Base in pages }
in
  BCM2708_PBASE_pag    = $3F000; { Peripheral Base in pages }
and change in function  rpi_mmap_get_info (modus:longint)  : longword;
the lines:
     7   : if ((rpi_mmap_get_info(5)=1) and
               (Upper(rpi_hw)='BCM2708')) then valu:=1;                     (* runs on known rpi HW *)
in:
     7   : valu:=1;                                                         (* runs on known rpi HW *)
rebuild and good job!

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus