Specific Pic Programming

Here's a copy of RenServo. I thought that Chris took your basic code and modified it for servo use -- the serial data input looks the same to me and the general outline of the software seems to follow the normal Renard structure.
 

Attachments

  • RenServo_addr_R1_1351259454.asm
    14.6 KB · Views: 5
Here's a copy of RenServo. I thought that Chris took your basic code and modified it for servo use -- the serial data input looks the same to me and the general outline of the software seems to follow the normal Renard structure.

Looking at that code, it appears to me that there is no 'slush' time at all in the ISR. In the original Renard the ISR is entered once every 30 uS or so, while in the servo code it's entered once every 4uS or so when it's active (it's not active all of the time in the RenServo code). With a 18.432 MHz oscillator the ISR is entered once every 18 instructions, or so, and the ISR takes about that same number of instructions (all of this is approximate off the top of my head). It's not surprising that adding instructions to the ISR would break things. It would have been better to place the instructions for limiting the servo range down in the 'phase0', 'phase1', 'phase2' and 'phase3' code near the end of the assembly file.
 
Looking at that code, it appears to me that there is no 'slush' time at all in the ISR. In the original Renard the ISR is entered once every 30 uS or so, while in the servo code it's entered once every 4uS or so when it's active (it's not active all of the time in the RenServo code). With a 18.432 MHz oscillator the ISR is entered once every 18 instructions, or so, and the ISR takes about that same number of instructions (all of this is approximate off the top of my head). It's not surprising that adding instructions to the ISR would break things. It would have been better to place the instructions for limiting the servo range down in the 'phase0', 'phase1', 'phase2' and 'phase3' code near the end of the assembly file.

Yes, I believe I remember that's how I did it. And please don't laugh at my code...it's actually my first "large" project.
I thought I created a minimum and maximum but I may have just done that in the 3d object suite. If I remember correctly, the only place to really add any kind of minumum and maximum per channel would be in the phase setup sections.
 
I've scaled way back on this 'project' in order to reduce the amount of time for debug and testing. For now, the only knobs are lower channel and upper channel specifications and chase speed control. Right now I have code that I think works, but I want to play with it a bit further before publishing anything.
 
Here, give this a shot. It creates a 4-channel chase, using channels 1-4 @ full brightness, with each stage of the chase lasting 1 second.
 

Attachments

  • renard-chase.zip
    5.6 KB · Views: 6
I don't like distributing .hex files, but here's one for this 'project'. I hope that it works, since it was generated on a Linux system, and I found it several directories deep below the project directory with the .asm file.
 

Attachments

  • renard-chase.X.production.hex.zip
    613 bytes · Views: 3
Back
Top