Forum Replies Created
-
AuthorPosts
-
Ligo GeorgeKeymaster
It is very easy to do. Simply follow our first two MPLAB XC8 Tutorials, if you want to do it without using any interrupts. The only thing that you need to take care is the LAT register. PIC 18F microcontrollers have LAT register to solve Read Modify Write problems. So for writing data (controlling LED) you need to use LAT register instead of PORT. But for reading data you can use PORT as before.
Here is the logic.
- If switch 1 is pressed toggle the LED 1
- If switch 2 is pressed toggle the LED2
- If switch 3 is pressed toggle the LED3
- If switch 4 is pressed toggle the LED4
Ligo GeorgeKeymasterSorry, I don’t understand your question. You can create menu in this display.
Ligo GeorgeKeymasterIt is very easy. You may use RS232 or normal 5V UART. You can choose it depending on the USB to UART converter you are planning to use. If it is having RS232 output, just use MAX232 IC to convert 5V UART to RS232.
You can use softwares like Putty, Hyperterminal, UART Terminal etc. to view the data in a PC.
Ligo GeorgeKeymasterFollowing are my suggestions.
- You can transmit data using similar technology that our IR remotes do.
- You can use an IR LED working under high frequency and you can use a TSOP sensor to decode it. For eg. 38KHz and TSOP1738
- For two way transmission you may set one device as master and another one as slave. Slave will transmit data only if it get a command from master. This will ensure that only one device will transmit at a time.
- You may also use two different frequencies. For eg. 30KHz, TSOP4830 and 56KHz, TSOP4856. In this case two devices can transmit data at the same time.
March 5, 2017 at 11:12 am in reply to: Error while writing program to PIC 16F877A using PICkit2 #13513Ligo GeorgeKeymasterHi,
Kindly attach your project files to investigate further. Check the following also.
- Make sure that you selected PIC 16F877A in the project settings. PIC 16F877 and 16F877A are different microcontrollers.
- You don’t need to check MCLR in the PICkit2 software
- You can uncheck Programmer >> Manual Device Select, PICkit2 will automatically detect the microcontroller. So you don’t need to select it manually.
- Make sure that the microcontroller you are using is PIC 16F877A not 16F877.
- If everything is correct, try using a new microcontroller ic.
February 20, 2017 at 10:21 am in reply to: MikroC PIC 16F877A Interrupt – Not Enough RAM for Call Stack #13488Ligo GeorgeKeymasterIt seems like you are trying to do RAM consuming operations (strings etc) in the interrupt routine. Just post your complete MikroC code here.
Ligo GeorgeKeymasterYou can do that. Just need to read one by one. See below.
- Send trigger to first HC-SR04
- Start timer
- Listen for echo.
- Stop timer once you got the echo
- Convert timer value to distance (first distance)
- Send trigger to second HC-SR04
- Start timer
- Listen for echo
- Stop timer once you got the echo
- Convert timer value to distance (second distance)
So it is easy. A microcontroller can do above steps very fastly, so it will appear to you that both sensors are reading simultaneously.
February 3, 2017 at 12:54 pm in reply to: Using Capture and Compare mode together – PIC 12F1840 #13464Ligo GeorgeKeymasterAs I told above, a single CCP will work only in one mode at a time. I think you should do like this.
- You can use a normal input interrupt or on-change interrupt to detect rise and fall.
- Start a timer when rise is detected and stop it when fall happens.
- So you will get the time period from the timer count.
- Use that CCP module only in PWM mode.
- Just change the duty cycle based on the timer value.
February 2, 2017 at 6:15 pm in reply to: Using Capture and Compare mode together – PIC 12F1840 #13460Ligo GeorgeKeymasterCan you please explain in details ?
You can use a CCP module in Capture OR Compare OR PWM mode. It will work only in one mode at a time. You may use PIC microcontrollers with multiple CCP modules to use Capture and Compare mode together.
Ligo GeorgeKeymasterYou can use MikroC program, hopefully it will work without any changes. But this MPLAB XC8 requires some changes.
Ligo GeorgeKeymasterHi,
Firstly MPLAB X IDE is a development environment while MPLAB XC8 is a compiler. So you can use MPLAB XC8 compiler with your MPLAB X IDE v3.20.
Seems like you have some connection problems. LCD backlight will work even if the microcontroller program is wrong.
Secondly in that project we are using PIC 16F877A, so that hex file won’t work for PIC 18F4550. So you need make necessary changes in the program and rebuild it for 18F4550.
Ligo GeorgeKeymasterHi,
Kindly post your circuit diagram and all the codes here.
Ligo GeorgeKeymasterYou may use a small microcontroller for that, a very simple program will work for this.
December 28, 2016 at 7:20 am in reply to: PWM width controlling on PIC12F1840 according to ADC input #13389Ligo GeorgeKeymasterWhich part is not working ? Can you please elaborate ? You can refer the following tutorials also.
We are also providing premium support, you can write to [email protected] for that.
Ligo GeorgeKeymasterDear Ahmad,
You should try to do coding yourself and you can ask here if you need any technical support for that. Nobody will have time to develop coding for you.
-
AuthorPosts