Hi,
I have been trying to get nhet[1]0 runing as a PWM output and failing miserably.
I can drive the pin as GPI (Leds); but HalCogen genrated HET code does not seem to start the HET.
Does anyone have a simple hercules demo using the nets as PWM?
I also when I look to the HalcoGen generated PWM uCode I cannot relate the generated opcodes to the opcodes in the reference manual. EG.
Halcogen code snipit....
/* CNT: Timebase
* - Instruction = 0
* - Next instruction = 1
* - Conditional next instruction = na
* - Interrupt = na
* - Pin = na
* - Reg = T
*/
{
/* Program */
0x00002C80U,
/* Control */
0x01FFFFFFU,
/* Data */
0xFFFFFF80U,
/* Reserved */
0x00000000U
},
using debugger this is the code thats landed at hetRAM1.
but looking at SPNU503B–November 2012–Revised August 2013, NET Instruction definitions....
Opcode for CNT is 0x06; I can't relate to 0x00002C80 generated by the halcogen. So I don't feel confident to rely on that manual to set breakpoints in the uCode.
20.5.3.8 CNT (Count)
Syntax CNT {
[brk={OFF | ON}]
[next={label | 9-bit unsigned integer}]
[reqnum={3-bit unsigned integer}]
[request={NOREQ | GENREQ | QUIET}]
[angle_count={OFF | ON}]
[reg={A | B | T | NONE}]
[comp ={EQ | GE}]
[irq={OFF | ON}]
[control={OFF | ON}]
max={25-bit unsigned integer}
[data={25-bit unsigned integer]
}
Figure 20-93. CNT Program Field (P31:P0)
31 26 25 23 22 21 13 12 9 8 7 6 5 4 1 0
0 Request BRK Next program address 0110 Angle Register Comp. Res. Int. ena
Number count select
6 3 1 9 4 1 2 1 4 1
Figure 20-94. CNT Control Field (C31:C0)
I would be grateful for any pointers.
Kind Regards,
Owain