If the array is 0-based then it should be this:
OnTime(7) = PRI_HULL_LGHTS_ON_MS
OffTime(7) = PRI_HULL_LGHTS_OFF_MS
Oh, man - a real newbie mistake. Thanks Steve!
If the array is 0-based then it should be this:
OnTime(7) = PRI_HULL_LGHTS_ON_MS
OffTime(7) = PRI_HULL_LGHTS_OFF_MS
Oh, man - a real newbie mistake. Thanks Steve!
Been there, done that, missing hair to prove it!
That was it, all right. Code works as expected - no need to switch back to PORTB.1(x). Now all I have to do is add the interrupt and handler.
Thanks again, Steve - I poured over that code at 12:30 am last night but didn't spot that index error.
This may not be the right place to ask a technical question about the PIC 16F88 chip, but I thought I'd start here.
I've got the prototype working and have been focusing on the schematic/board layout to finish this project (finally). After getting back some test PCBs for the blinking LEDs, I noticed that the 5 steady on LEDs connected to PORTA.0 via a 2N2222A transistor are not as bright as the other 5 blinking LEDs connected to PORTB.1-6 (note that PORTB.0 is needed for a button and that PORTB.7-8 are used for other blinking lights). I've looked over the datasheet for the PIC 16F88 but I'm a bit confused by the current limitations on page 163 (18.0 Electrical Characteristics). I had hoped that by using a 10k resistor between the 16F88 pins and the base of the 2N2222A that I could sink more current and hence drive more LEDs (PORTA.0 will ultimately need to drive 10 LEDs (5 per side of the model - total of 200mA for PORTA) while each of PORTB.1-6 will drive 2 LEDs (total of 200mA for PORTB). I see that it says 'Maximum current sunk by PORTA/B: 100mA' but I thought that a transistor (maybe a MOSFET?) would work.
Am I dreaming here? Do I need to look for some other solution? I'd hate to move away from this single chip utilizing Darrel's most elegant code.
PBP Code: Formation_Running_Engine_Lights_16F88_4Mhz_Ext_FINAL.txt
Eagle Schematic: SE66_Main_Brd.pdf
I am not sure that I understood what you want to do. But looking on your schematic, I really do not think that is a good idea to have a pot drive the collector of the 2N2222 and then the transistor drive a load of 200mA. It is not good practice.
If you need to control the power to your load, then a PWM controlling the base of the transistor is sure more appropriate.
Ioannis
I got the design from another source. The idea was to provide a way to control the brightness of the LEDs without having to have the trim pot inside the model (the PCB will be in a base for easy access).
The trim pots work great for all the other instances, just not the 5 steady-on LEDs. Also, I cannot use PWM in this code at all - it completely throws off the blinking algorithm created by Darrel.
Bookmarks