Welcome to GhostyDigits. Want to learn more about embedded systems and Microcontrollers ? Then subscribe!!
Tutorial style videos teaching you how to program PIC Microcontrollers through a non-traditional, funny and detailed way. As well as, how to use sensors, drivers and different user interface methods with PIC18 Microcontroller. And of course giving you the tips and tricks of "Embedded C" and how to write the most efficient C code for your embedded projects.
Sound like something you have been searching for? Hit the subscribe button and get started in the field of embedded systems.
I fixed the code. the way you did it dont work for xc8 #include <xc.h> #define _XTAL_FREQ 16000000 void __interrupt() myISR(void){ PORTBbits.RB0^=1; TMR0L=236; INTCONbits.TMR0IF=0; } void main(void){ TRISB=0; PORTB=0; T0CON=0b01001010; TMR0L=236; INTCONbits.TMR0IE=1; INTCONbits.GIE=1; T0CONbits.TMR0ON=1; while(1){ } return; }
I have been looking at a Geiger counter circuit that uses PIC18F2550 and it has a button switch to ground on Pin 22 with a 10K resistor from the pin to +5v. I believe the button is used to change the modes on the device to measure in 15/30/120 second intervals. I'm curious how this works. Where can I read more about this?
My project is a DIY PSU. I am a novice. I will be using two rotary encoders to control digital potentiometers to set the voltage and the current. The push button knob switch will be used to change between course and fine adjustment. I take it that using pins that have interrupt capability are the best pins to use for the rotary encoders. Do I have this correctly? And, as each encoder has an "A" and "B" pin and a switch, I will need a total of six pins that have interrupt capability. Also correct? Further, it would be best for each of these six pins to have internal) pull up resistors and b) Schmitt Triggers, for debouncing. Correct, again? I will be checking the Data Sheet, but do you know (by memory,) if the PIC18F4550 has at least six pins that have all of these needed functions? If so, do you also know their pin numbers? Please and thank you. Much appreciated. EDIT: I started to watch your next video and see that you will be answering some of my questions. However, I would appreciate any of your comments, or suggestions. EDIT2: In the second video, you clarify that there are only four interrupt pins. Accordingly, I guess that I could use the switch on the encoders to initiate the interrupt and an additional button press to change between Course and Fine. That way, I would only need two pins that have the interrupt function. The four A/B encoder pins could be on other digital pins that have pull up resistors and Schmitt Triggers. So, I am off to investigate those pins.EDIT3: Further limitations are encountered... INT0=SDI and INT1=SCK. I believe these two pins will be needed to communicate with the MCP41HV51 digital pots that I plan to use. That leaves INT2. Therefore, I will use a separate tactile switch on INT2 to initiate the interrupt and enable the voltage and current encoders. Does that all sound about right? What other options might you suggest?
Thank you very much young man, your teaching is excellent and to the point... but am I missing something or did you fail to but a 'return;' at the end if the Interrupt Service Routine? Without it, the program seems to execute once and then comes to an abrupt stop.
7:23 minutes in the video you just placed some coding in the bottom of the program containing something wit 500 ms.... Where did you get this small program from???
I'm trying to figure out how to do this with the 4 bit option enabled and I can't find anything meaningful...everyone says to use xlcd.h but it doesn't exist with xc8 and is not in the legacy xc8 file from microchip. Very annoying.
I have had those issues before when dealing with precise timing and I assigned the registers a little less values and I was able to get an accurate measurement on the Oscilloscope. Data sheets are great references but theory and practices are seldom the same. Hardware by nature causes delays and we will never be able to illuminate those latencies. I wouldn't call the compiler stupid, it is something that is almost impossible to avoid.
Very nice video, well done. I did similar circuit with 2 LEDs similar to the train crossing signal. I also used PIC18F4550 but I programmed it with Assembly code. What do you think about that?