Hi everyone,
I'm going to have to first state that I am the noob of all noobs. I've never taken any courses on or worked with any sort of programming prior to the senior design project that I'm working on. So in short some of my questions might be really dumb or really simple to answer. I'm programming a 16F88 PIC to complete five basic task for my part of the senior design project. We chose the 16F88 simply because it was used in an earlier lab so we had one on hand and it was the only microcontroler that I had seen any programming done on. The five main task I wish for the PIC to accomplish are as follow:
1. To simply allow serial data in from a bluesmirf and then directly out to a LCD screen. I would like this to be acomplished using one input pin and one output pin.
2. When the first bit of serial information is recieved from the bluesmirf, use the first high bit recieved to activate the backlight of the LCD. After 10 seconds the PIC should send the serial data to turn the backlight of the LCD off again. Again I'd like to use one input pin and one output pin.
3. Again the same serial information should be used to send out a high voltage to be used by an audible alert circuit. The voltage should come out in a half second burst then a half second of low voltage and then repeat 3 times.
4. A high voltage will be sent to the PIC from a push button switch. This high voltage should cause the PIC to send out the serial data to activate the backlight of the LCD for 10 seconds then turn it off.
5. The final task for the PIC is to recieve a high voltage from the activation of a warning light LED and then send out a series of high low voltages just like in task three.
I've written out a code that I thought would work, but it doesn't complete any of the tasks that I want it to. Some basic questions would be, can I use a single input port and a single output port for each of the tasks that I'd like to complete? If so am I assigning the ports right by using TRISA.0 = 1 to set port A.0 to input and TRISB.0 = 0 to set port B.0 to an output? I'm using the SERIN and SEROUT commands to send serial data and I understand the first command after SEROUT is the pin you want to use and the next is the baude rate you're using, but what is the next instruction for and how do I know what to assign to it? Finally can you send hexadecimal commands out of the pic Serially to be understood by the LCD? Below is a copy of the code that I have so far. Any and all help is greatly appriciated.
Bookmarks