[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself

Search:


View post   

>> No.1411510 [View]
File: 38 KB, 831x547, file.png [View same] [iqdb] [saucenao] [google]
1411510

i've got a weird PIC16F54 problem. i'm trying to count a ~14kHz signal using the counter peripheral with a 32.768kHz system clock. the problem is that i don't get a count until about 135 delay ticks (see image).

i've stripped the asm down to the minimum, about 25 instructions. i've checked the circuit, the target signal is present on the T0CKI pin and is a pretty clean rail to rail 50% duty square wave. the code i've excluded that displays the value also works correctly as tested by giving it fixed values to display. does anyone have guesses as to what's causing this?

code: (https://pastebin.com/raw/2yL5whWb))
>clear TMR0
>loop for N cycles
>save TMR0
>display saved value on two 7segs

Navigation
View posts[+24][+48][+96]