Search found 102 matches

by dslocum
30 Apr 2023 16:15
Forum: mikroC PRO for PIC General
Topic: 16F18345 ADC channel mapping?
Replies: 9
Views: 1041

Re: 16F18345 ADC channel mapping?

You are correct about the /16 clock, as my selection of /8 is(was) likely very marginal. I've now set it to the internal RC clock and as you suggest, it's working just fine.

Thanks so much for your kind help! Cheers!
by dslocum
30 Apr 2023 15:09
Forum: mikroC PRO for PIC General
Topic: 16F18345 ADC channel mapping?
Replies: 9
Views: 1041

Re: 16F18345 ADC channel mapping?

Well, it's amazing what a good night of sleep can bring. Solved! Because this CPU isn't properly supported in the ADC library and this is the first time I've needed to code the ADC stuff manually, I neglected to set the ADCON1's conversion clock source (ADCS), so it defaults to Fosc/2. With my CPU c...
by dslocum
30 Apr 2023 00:47
Forum: mikroC PRO for PIC General
Topic: 16F18345 ADC channel mapping?
Replies: 9
Views: 1041

Re: 16F18345 ADC channel mapping?

Thank you once again. On a related subject, do you have any examples of how to set up the ADC -not- using the MikroC library? I'm struggling getting reliable conversions. The conversion does not output consistent values. I'm using a potentiometer into ANC2 to control the speed of an output pulse to ...
by dslocum
30 Apr 2023 00:22
Forum: mikroC PRO for dsPIC30/33 and PIC24 General
Topic: Editor Bug - Double Click
Replies: 8
Views: 2623

Re: Editor Bug - Double Click

Disappointed today... Even after several years, it seems this problem has still not been resolved. It just bit me AGAIN. :twisted: :( :evil:
by dslocum
15 Apr 2023 19:59
Forum: mikroC PRO for PIC General
Topic: 16F18345 ADC channel mapping?
Replies: 9
Views: 1041

Re: 16F18345 ADC channel mapping?

Thank you. Thank you! Got it going.

Even though I think you answered my other question thread about interrupts here, I figured it out.

It's difficult to find the information for this chip that uses the correct registers / names.

Now, do you know about the ADC channel question? :D
by dslocum
14 Apr 2023 15:22
Forum: mikroC PRO for PIC General
Topic: Timer0 Example for 16F18345 ??
Replies: 1
Views: 382

Timer0 Example for 16F18345 ??

I need an Timer0 interrupt example for the PIC16F18345. I want a periodic 1ms interrupt; 16 MHz XTAL. I've been at this for a couple days now trying anything I can think of, but any examples that I can find show registers that are either not in this chip, or so differently named that I can't figure ...
by dslocum
12 Apr 2023 17:29
Forum: mikroC PRO for PIC General
Topic: 16F18345 ADC channel mapping?
Replies: 9
Views: 1041

16F18345 ADC channel mapping?

For CPUs like the 16F18345 that have ADC channels mapped into different pins on different ports, it is not at all clear (EG. NOT documented, that I can find!) how to use MikroC's ADC library. I'm sure I'm not the only person needing to do this.

I could use some help and examples please.
by dslocum
12 Apr 2023 17:24
Forum: mikroC PRO for PIC General
Topic: USART PPS Mapping help for 16F18345
Replies: 2
Views: 536

Re: USART PPS Mapping help for 16F18345

Thanks Filip, I got things sorted. Like many things in life, it's easy - once you understand! I would also state that it is NOT straight-forward. Many bits must be set to get this to work, particularly when using an interrupt. If it helps anyone else, here's what I had to do: void interrupt(void) { ...
by dslocum
30 Mar 2023 19:19
Forum: mikroC PRO for PIC General
Topic: USART PPS Mapping help for 16F18345
Replies: 2
Views: 536

USART PPS Mapping help for 16F18345

I've been at this for hours, trying everything I can think of. I need to get an interrupt from the USART and read the RX input. Should be simple enough and I "have" done some interrupt stuff successfully in the past. I think I don't understand the PPS stuff, as the docs are pretty confusing. I'm rea...
by dslocum
27 Sep 2021 15:26
Forum: mikroC PRO for PIC General
Topic: PWMx_Remappable_Set_Duty on PIC16F1574
Replies: 2
Views: 593

Re: PWMx_Remappable_Set_Duty on PIC16F1574

Anyone? I could really use a solution please.
by dslocum
15 Sep 2021 23:56
Forum: mikroC PRO for PIC General
Topic: PWMx_Remappable_Set_Duty on PIC16F1574
Replies: 2
Views: 593

PWMx_Remappable_Set_Duty on PIC16F1574

Hi, I think there is an error in your documentation - either that or I'm very confused. I'm using a PIC16F1574 with the PWM Remappable Library. I have it working using the PWM3_Remappable_Set_Duty(duty) in a loop, but based on the documentation "duty" should be in a range of 0 to 255. However, it on...
by dslocum
12 Aug 2021 15:36
Forum: mikroC PRO for PIC General
Topic: PIC16F1574 - PPS & PWM - Need help
Replies: 3
Views: 806

Re: PIC16F1574 - PPS & PWM - Need help

Thanks for your reply. If I understand you correctly, here's the modified code that still results in the CPU pin 7 staying at ground. It is hard to know if the problem is with PPS or PWM. Your help is appreciated! Thanks. ANSC3_bit = 0; PPS_Mapping(_RC3, _OUTPUT, _PWM3_out); PWM3_Remappable_Init(500...
by dslocum
10 Aug 2021 01:59
Forum: mikroC PRO for PIC General
Topic: PIC16F1574 - PPS & PWM - Need help
Replies: 3
Views: 806

PIC16F1574 - PPS & PWM - Need help

Hi Guys, I've got a PIC16F1574. I want to output a PWM signal on pin 7 (RC3). I'm using PWM3, but any would work for me. I can prove the CPU is running with some simple LED tests, but the output of pin 7 stays low no matter what I do. I'll admit to being VERY confused by all the available documentat...
by dslocum
02 Nov 2020 01:32
Forum: mikroC PRO for PIC General
Topic: PIC16F690 w/ External Clock
Replies: 3
Views: 839

PIC16F690 w/ External Clock

Hi folks, This is the first time I'm trying to use an external clock oscillator. My goal is to have the PIC16F690 run as fast as possible and use the UART for MIDI receive (31250 baud). I'm afraid that the internal RC oscillator will not be accurate or stable enough, so I'm using an external 20MHz p...

Go to advanced search