Last week you sent me two short programs. You also suggested that I go to Darrel Taylor's page and grab some code. I got his "blinky" to compile and work with the minor adjustments of changing the output to an LED register and the DT_INT-14.bas fix. I never got either of yours to compile and run.
Mine will only compile properly for a PIC18F device, for sure with a PIC18F2520. It will need some work to translate for PIC16F devices.
On page 125 of your 18F2520 spec I found T0CON containing TMR0ON, T08BIT, T0CS, T0SE, PSA, T0PS2 AND T0PS1. I could not relate any of this to the contents of pages near 77 of my 16F887 spec. I also could not find in any code you posted where you set these bits.
Sorry, it is page 75 in the datasheet, and page 77 on Acrobat. Look for the page that has:
REGISTER 5-1: OPTION_REG: OPTION REGISTER on it. Where I set these registers is here:
Code:
T0CON = %00000001
T1CON = %00000001
T2CON = %01011111
CCP1CON = %00000101
Scalerobotics thought I might be able to measure the PWM radio receiver outputs if I converted it to a serial stream. Good idea, but I don't know what to do with a serial signal.
You mean you don't have any computers laying around with a serial port? Yeah, I guess it is like that in my house too! Your PicKit2 comes with a great resource (in my opinion). It has a serial port built in, and you can use it to see what your program is doing. Or in this case, figure out what your Pulse Width Measurement is doing. With the Pickit2 software, go to tools, then choose the Uart tool. Make sure you are sending your serial data to the right pin. In this case, you will have to use the serout commands, as the pickit pins will not be connected the the hardware serial port. Follow the serout as defined in the PBP manual.
I would feel successful if I could see on a flashing LED that my radio receiver is working and that the PIC can read it. (I know it is working because the car wheels turn.) This is the intent of the first code (RC-Input - 12F675) Scalerobotics sent me. It originate with Malcolm from Hertfordshire, UK.
LED's can be a good trouble shooting tool. However, we do not even know if the timebase is going to be similar in your chip, or what crystal you are running, etc. The serial port will be able to tell you so much more about what is going on. I think you will feel even more satisfied seeing actual results.
I'd like to get that working.
Me too!
One thing I learned about was MicroCode Studio's ICD (in circuit debugger). It is a great tool to see what your code is doing. It lets you step through, or view it, while allowing you to view registers, etc. I used it a lot in the beginning, then I started a few projects that were very time dependent, so I could not use the ICD in them, so I have not used it in a long time.
And about that USB HID ... what about the back to basics part?
-Walter
Bookmarks