Sonsivri

Electronics => Projects => Topic started by: ahmed on October 17, 2021, 09:23:54 09:23



Title: 16f1937 mikroC problem
Post by: ahmed on October 17, 2021, 09:23:54 09:23
Hello , I want to interface a keypad and LCD with pic16f1937.

Everything is working fine over 16f877a but with controller it is not working at all.

Project folder and Proteus simulation file is attached , any help would be appreciated.


Title: Re: 16f1937 mikroC problem
Post by: zuisti on October 17, 2021, 12:10:09 12:10
Hi Ahmed;

First, set ANSELA to zero so that you can use the PORTA bits as digital I/O.
Second, to avoid RMW problems use LATAx bits to define the LCD module connections (instead of the RAx bits).

Study the datasheet!
Greets: zuisti


Title: Re: 16f1937 mikroC problem
Post by: ahmed on October 17, 2021, 12:57:15 12:57
Hi Ahmed;

First, set ANSELA to zero so that you can use the PORTA bits as digital I/O.
Second, to avoid RMW problems use LATAx bits to define the LCD module connections (instead of the RAx bits).

Study the datasheet!
Greets: zuisti

I am bit confused with these datasheet variables , studying about mikroc (newbie)

Can you give me any good example please?

or modify the code , if possible.

Edit:
By the ANSELA=0; solved the problem :)


Title: Re: 16f1937 mikroC problem
Post by: jack12345 on October 19, 2021, 04:07:25 16:07
I took the time to take a look!!
pic16f1937 portA output I/O
Execution can be displayed!!


Title: Re: 16f1937 mikroC problem
Post by: jack12345 on October 22, 2021, 12:52:28 00:52
This website has some examples of mikroC Projects pic18F!!
But there is no pic16f1937 chip!!

https://simple-circuit.com/mikroc-projects/ (https://simple-circuit.com/mikroc-projects/)