Code: Select all
debian@beaglebone:~$ X=/sys/devices/platform/libpruio/state ; echo "ff06" > $X ; cat $X
tbclk=0/7 (orig/curr)
Code: Select all
debian@beaglebone:~$ X=/sys/devices/platform/libpruio/state ; echo "ff06" > $X ; cat $X
tbclk=0/7 (orig/curr)
Your libpruio-lkm package is not version 0.6.4c. Update it and the Pwm->Sync() function will work.Dinosaur wrote:Code: Select all
debian@beaglebone:~$ X=/sys/devices/platform/libpruio/state ; echo "ff06" > $X ; cat $X tbclk=0/7 (orig/curr)
In libpruio such a module is build in, and you're the user.Dinosaur wrote:My software has an extensive "ErrControl" module that I usually apply to the finished product for the users benifit.
RegardsDebian@beaglebone:~$ dpkg -l libpruio*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=========================-=================-=================-=======================================================
ii libpruio 0.6.4c armhf PRUSS driver for BB A/D-IO
ii libpruio-bas 0.6.4c armhf PRUSS driver for BB A/D-IO
ii libpruio-dev 0.6.4c armhf PRUSS driver for BB A/D-IO
ii libpruio-doc 0.6.4c all HTML-documentation for libpruio-dev packages
ii libpruio-lkm 0.6.4c armhf DKMS source for libpruio driver
ii libpruio-modules-4.14.94- 1stretch armhf libpruio modules
debian@beaglebone:~$
so that I will know when I have the right response.debian@beaglebone:~$ X=/sys/devices/platform/libpruio/state ; echo "ff06" > $X ; cat $X
tbclk=0/7 (orig/curr)
sudo apt install linux-headersDinosaur wrote:After purging and re-installing I got Linux Header files missing.
tbclk=0/6 (orig/curr)Dinosaur wrote:... so that I will know when I have the right response.
Code: Select all
#INCLUDE ONCE "BBB/pruio.bi"
#INCLUDE ONCE "BBB/pruio_pins.bi"
'==================================================================
'This test sets O/P P8-07 for single shot of Dur1
'First set P8_07 to Gpio Output to secure normal state.(Hi or Lo)
'If setting is Lo, set Mode = 2 ,Dur1 (Lo period) won't be visible.
'If setting is Hi, set Mode = 3 ,Dur1 (Hi period) won't be visible.
'NOTE: First time it is run after state change 2 pulses can occur.
'Dur1 = Space Time in mSec ie: 1.0
'Dur2 = Pulse Time in mSec ie: 3.0 is 3 mSec.
...
Code: Select all
#INCLUDE ONCE "BBB/pruio.bi"
#INCLUDE ONCE "BBB/pruio_pins.bi"
#DEFINE EEND(_T_) ?"failed " & _T_ & " (" & *.Errr & ")" : GOTO Err_End
Dim Shared As Single Dur1 , Dur2
Dim Shared as SHORT Mode
VAR io = NEW PruIo()
WITH *io
IF .Errr THEN Goto Err_End
IF .Tim->SetValue(P8_07, -1., -1., 0) THEN EEND("setting P8.07")
IF .config() THEN EEND("config")
Dur1 = 1
Dur2 = 1
Mode = 2
If .Tim->SetValue(P8_07, Dur1, Dur2, Mode) Then EEND("changing P8.07")
Print "Dur1= ";Dur1, "Dur2= ";Dur2
END WITH
Sleep
Delete io
End
Err_End:
Print "Error End"
Delete io
End
Good news, congrats!Dinosaur wrote:After the next reinstall the Sync(&b000) and Sync(&b110) worked perfectly.
I'll care about that later. First I'll need further testing with the current binary:Dinosaur wrote:it returns to Hi, which setting by Gpio does not do.
If that is part of your code, then staying at the set level is desirable, but not that important.
OK, this happens when starting in regular mode (first low, then high). What happens in 'invers' mode (first high, then low). Do you also see a (low) pulse at the beginning of Dur1?Dinosaur wrote:Running your code as is still starts a short fast pulse at the beginning of the space time
I meant to tell you that before. I have tested that and the same thing happens.What happens in 'invers' mode (first high, then low).
All your former information is about code including pinmuxing [Pwm to Tim]. I need information about the output without pinmuxing, while changing from stopped to running TIMER [Tim->setValue(P8_07, -1., -1, Mode) to Tim->setValue(P8_07, Dur1, Dur2, Mode)].Dinosaur wrote:I meant to tell you that before.What happens in 'invers' mode (first high, then low).
This looks like a high impedance pin (no way to avoid that). What happens when you ground the pin by a 10-100 kOhm resistor for regular mode, or pull-up the pin in invers mode? (You could use the internal resistors for that.)Dinosaur wrote:I have tested that and the same thing happens.
It is worth noting that it happens about 30% of the time, and by watching the voltage of that early pulse
you can see that it changes. Sometimes it makes it to the full 3.3 v, other times it only reaches 1/2 that.
On rare occasions it only gets to about 0.3 v.
So it looks like a "time race" thing.
Code: Select all
#INCLUDE ONCE "BBB/pruio.bi"
#INCLUDE ONCE "BBB/pruio_pins.bi"
'==================================================================
'This test sets O/P P8-07 for single shot of Dur2
'First set P8_07 to secure normal state.(Hi or Lo)
'If setting is Lo, set Mode = 2 ,Dur1 (Lo period) won't be visible.
'If setting is Hi, set Mode = 3 ,Dur1 (Hi period) won't be visible.
'Dur1 = Space Time in mSec ie: 1.0
'Dur2 = Pulse Time in mSec ie: 3.0 is 3 mSec.
'
'CONCLUSION: Total of (Dur1 + Dur2) must be 0.005001 mSec or more.
' If both are 0.005 the SetValue will Err.
' Maximum Freq is then 100 Khz.
'==================================================================
Dim Shared As Double Dur1 , Dur2
Dim Shared as SHORT Mode
VAR io = NEW PruIo()
WITH *io
IF .Errr THEN Goto Err_End
IF .Tim->SetValue(P8_07, -1., -1., 1) THEN Goto Err_END
IF .config() THEN Goto Err_End
Dur1 = 1
Dur2 = 1
Mode = 3
If .Tim->SetValue(P8_07, Dur1, Dur2, Mode) Then
Print "Errer 2"
Goto Err_End
EndIf
Print "Dur1= ";Dur1, "Dur2= ";Dur2
Do
VAR k = Asc(INKEY())
Select Case AS CONST k
Case Asc("1") 'do it again'
.Tim->SetValue(P8_07, Dur1, Dur2, Mode)
Case Asc("q") 'quit'
Exit Do
End Select
Loop
END WITH
Delete io
End
Err_End:
Print "Error End"
Delete io
End
That's not what I mean. The following code starts the timer in different configurations. You can add the internal pull-up (key 'u') or pull-down (key 'd') resistor to the output. Please measure one-shots: normal and invers mode, both with either pull-down or pull up resistor.Dinosaur wrote:EDIT: Putting a 1k resistor from P8_07 to an led then to the +5v rail does not change the extra pulse.
Code: Select all
#INCLUDE ONCE "BBB/pruio.bi" ' include header
#INCLUDE ONCE "BBB/pruio_pins.bi" ' include header
#DEFINE EMSG(_T_) ?_T_ & " failed (" & *.Errr & ")" : EXIT DO
#DEFINE P_OUT0 P8_07
#DEFINE P_OUT1 P9_42
VAR io = NEW PruIo() '*< create new driver UDT
WITH *io
DO
IF .Errr THEN EMSG("CTOR")
VAR d1 = -1. _
, d2 = -1. _
, o1 = 0. _
, o2 = 0. _
, mo = &b00 _
, mu = CUBYTE(PRUIO_NO_PULL) _
, k = "" _
, po = P_OUT1 _
, pn = P_OUT0
IF .Tim->setValue(pn, d1, d2, mo) THEN EMSG("pinmux P_TIM")
IF io->config() THEN EMSG("config")
DO
?" Dur1 = " & d1 & ", Dur2 = " & d2 & ", Mo = " & BIN(mo, 2) _
& ", Pin = " & *IIF(pn = P8_07, @"P8_07", @"P9_42") _
& ", Pull = " & *IIF(mu = PRUIO_PULL_UP, @"UP", _
IIF(mu = PRUIO_PULL_DOWN, @"DOWN", @"NONE"))
DO : k = INKEY() : IF LEN(k) THEN EXIT DO
SLEEP 1
LOOP
SELECT CASE k
CASE "i" : ?"i:"; : mo XOR= &b001 ' toggle invers
CASE "o" : ?"o:"; : mo XOR= &b010 ' toggle one shot
CASE "s" : ?"s:"; : SWAP d1, o1 : SWAP d2, o2
CASE "y" : ?"y:"; : SWAP po, pn ' swap output pin PWM/TIM
CASE "d" : ?"d:"; : mu = PRUIO_PULL_DOWN ' pull-down
.setPin(io, pn, (.BallConf[pn] AND &b11100111) OR mu)
CASE "n" : ?"n:"; : mu = PRUIO_NO_PULL ' no resistor
.setPin(io, pn, (.BallConf[pn] AND &b11100111) OR mu)
CASE "u" : ?"u:"; : mu = PRUIO_PULL_UP ' pull-up
.setPin(io, pn, (.BallConf[pn] AND &b11100111) OR mu)
CASE "=" : ?"=:"; : d1 = 0 : d2 = 10
CASE "0" : ?"0:"; : d1 = 10 : d2 = 0
CASE "1" : ?"1:"; : d1 = 9 : d2 = 1
CASE "2" : ?"2:"; : d1 = 8 : d2 = 2
CASE "3" : ?"3:"; : d1 = 7 : d2 = 3
CASE "4" : ?"4:"; : d1 = 6 : d2 = 4
CASE "5" : ?"5:"; : d1 = 5 : d2 = 5
CASE "6" : ?"6:"; : d1 = 4 : d2 = 6
CASE "7" : ?"7:"; : d1 = 3 : d2 = 7
CASE "8" : ?"8:"; : d1 = 2 : d2 = 8
CASE "9" : ?"9:"; : d1 = 1 : d2 = 9
CASE ELSE : EXIT DO
END SELECT
IF .Tim->setValue(pn, d1, d2, mo) THEN EMSG("changing P_TIM")
LOOP UNTIL LEN(INKEY()) : ?
LOOP UNTIL 1
END WITH
DELETE io ' destroy driver UDT
No. I didn't receive any PM. Did you email to the address published in the docs license?Dinosaur wrote:Are you receiving the pdf's I have sent ?