ArmMiteF4 BITBANG BITSTREAM Operation


Author Message
morgs67
Regular Member

Joined: 10/07/2019
Location: Australia
Posts: 77
Posted: 11:54am 21 Mar 2024      

Using the ArmmiteF4 with MM V5.07.02b2.
@phil99 coded  NECSend for the Picomite using MM.
Const IRpin = MM.Info(pinno gp1)  'output pin, change as needed
SetPin IRpin, dout : Pin(IRpin) = 0 ' IR code output

Do
'Your program here.
Input "Enter Device and Key codes "; dev, key
NECsend IRpin, dev, key
Loop

Sub NECsend IRpin As integer, dev As integer, key As integer
Local integer word, d(2200), m, n = 1

word = (dev<<16) + (key<<8) + ((255 Xor key )And 255) 'assemble 32 bits

Math set 13 , d() '13=1000/(38*2)uS duration of a half cycle @ 38kHz
d(672) = 4500  'pause after start pulse train

For m = 714 To 2100 Step 42  'load data after start sequence
  d(m) = (((word>>(32-n)) And 1)*2 + 1) * 562.5  'convert bits to duration (short = 0, long = 1)
  Inc n 'step to next data bit
Next

Device bitstream IRpin, 2199, d() 'send the data

Pause 100
Pin(IRpin) = 0
End Sub


This works for an Onkyo receiver. (Also with 'Device'command replaced with Bitbang)

The above code with the IRpin changed to (pinno PE0} on the ArmmiteF4 does not work.

After investigation it appears that "d(672) = 4500  'pause after start pulse train" is not interpreted by BITSTREAM.
It shows up in the d(0) to d(800) bitstream exactly the same as the picomite but does not result in the 4.5mS space after the leading pulse burst.

test values are devicecode  19832 keycode 192.

Picomite





ArmmiteF4





Tony