Display System Counter
Humanoido
Posts: 5,770
How to get the Time variable into the A register and output the result in binary to LEDs 0 - 31? The following code is not working.
' Read system counter and display the binary result ' LEDs on pins 0 through 31 CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 VAR long Time PUB ReadCNT Time := cnt 'Read System Counter 32 bit number PUB LED DIRA := %11111111111111111111111111111111 ' make pins 0-31 outputs OUTA := Time
Comments
And you are allowed to assign cnt directly to outa
On the BS2 I could only light four LEDs before they browned out on me. I had to come up with a driver scheme to whip the current-budget problem. Harprit Sandhu used invertors and inverted logic in spin to overcome this in his new book.
Keep in mind that stressing the chip to near its limits may not result in immediate damage to the chip, but it may shorten the time to failure from other processes like metal migration that are current and heat sensitive.