Unfortunately the LOW and OUTPUT commands didn't work with that code.
Some updates:Now only using HPWM code.
I purchased basic R/C controller (transmitter/receiver) and successfully controlled the ESC (Electronic Speed Control). It was necessary to show zero throttle before the ESC would arm. I can't seem to mimic that with a HPWM signal.
What Period code should I use considering AtomPro28 is 16 MHz (16000 cycles/1 millisecond?) and ESC is (12 kHz)?
The following is Terminal result from the following code after connecting the R/C receiver to P0.
Code:
temp var word
main
adin16 p0,temp
temp = temp>>4 ;temp will hold a 12bit decimated A/D conversion
serout s_out,i9600,["Conversion = ",dec temp,13]
goto main
Conversion = 926
Conversion = 6
Conversion = 6
Conversion = 6
Conversion = 7
Conversion = 6
Conversion = 7
Conversion = 6
Conversion = 6
Conversion = 6
Conversion = 6
Conversion = 7
Conversion = 7
Conversion = 7
Conversion = 6
Conversion = 10
Conversion = 7
Conversion = 6
Conversion = 6
Conversion = 6
Conversion = 7
Conversion = 6
Conversion = 6
Conversion = 7
Conversion = 6
Conversion = 6
Conversion = 8
Conversion = 7
Conversion = 6
Conversion = 6
Conversion = 7
Conversion = 6
Conversion = 7
Conversion = 7
Conversion = 6
Conversion = 1045
Conversion = 7
Conversion = 6
Conversion = 7
Conversion = 6
Conversion = 7
Conversion = 7
Conversion = 7
Conversion = 7
Conversion = 6
Conversion = 6
Conversion = 6
Conversion = 7
Conversion = 6
Conversion = 7
Conversion = 7
Conversion = 7
Conversion = 6
Conversion = 6
Conversion = 6
Conversion = 6
Conversion = 7
Conversion = 6
Conversion = 6
Conversion = 7
Conversion = 6
Conversion = 6
Conversion = 6
Conversion = 6
Conversion = 6
Conversion = 7
Conversion = 7
Conversion = 6
Conversion = 6
Conversion = 7
Conversion = 1125
Sorry for the length, but I didn't include any pauses. The next output is form HPWM (P10) straight to P0 using ADIN16 command.
NOW....Here is the output when I send the HPWM signal (P10) to the ADIN16 input (P0)
temp var word
Code:
main
hpwm p10,167,0
adin16 p0,temp
temp = temp>>4 ;temp will hold a 12bit decimated A/D conversion
serout s_out,i9600,["Conversion = ",dec temp,13]
goto main
Conversion = 0
Conversion = 0
Conversion = 0
Conversion = 0
Conversion = 0
Conversion = 0
Conversion = 0
Conversion = 0
Conversion = 0
Conversion = 0
The result is no response from the ESC and consequently the brushless motor.
Not sure what it is, but the R/C controller works fine after zero throttle, while I struggle with the code to replicate the R/C controller.
I may post this to Lynxmotion forum if anyone suggests it is more appropriate. I don't know if it is MC or BotBoardII or other.
Essentially, I am trying to mimic R/C transmitter/receiver with AtomPro 28 on BBII.