Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

13 Channel Led driver with fade in fade out

Status
Not open for further replies.

cuza

New Member
Hy all, i want to modify the code of the RGB led driver for obtain a 13 channel led driver with 16F628, but it was without success, can someone take a look to my code?

Kind regards!
 

Attachments

  • Cod_16F628_cu_cod_de_12_F629.rar
    56.7 KB · Views: 184
Your file archive seems to be missing the 'mcp' project file... Also, could you post the files as a 'zip' archive instead of as an 'rar' archive?

Cheerful regards, Mike
 
And here's the schematic.

13 chan LED driver.PNG

Allen
 
The mcp file is not supplied instead is a mcs file. The mcp file is so important? Here i tryed to modify the older 4 channel rgb led driver. I sow that there is no mcp file. Kind regards!
 
This appears to be a Proteus effort.
I had a crack at it, due to the swapping of the processor a lot of the defines are wrong causing about 71+ errors during compile. Also the proteus schematic shows a 1Mhz clk but the s'wre calls for a 4Mhz clk.
This requires legwork on the part of the OP to swat each of the identified compile errors. They are obvious.
 
I compiled the file in mplab, but erors results. The pic is configured to work without quartz crystal config 0x3d18
 
Without the MCP file I can't open it up as an MPLAB Project... What's the source for this project?

Why would you need to open it in mplab? The source files are all there.
 
Last edited:
Hy all, the program is there, is the same, and could be compiled with MPLAB (I compiled the file .asm with MPLAB V8,83), but return errors. I tried to made the electrical diagram in ISIS for see if the circuit do what i want to do. So i need help to compile the file.

The errors are the problem.

Kind regards!
 

Attachments

  • Cod_16F628_cu_cod_de_12_F629.zip
    60.8 KB · Views: 161
Just fix the compile errors dude...It tells u what the problems are.
Load up the text file with the extension .err for explicit line by line errors that you need to address.
I don't think we are going to do that for you, its just too basic and time consuming.
If you don't understand what an error msg means, just ask.
 
Mike said:
Without the MCP file I can't open it up as an MPLAB Project... What's the source for this project?
Why would you need to open it in mplab? The source files are all there.

I was asking about the origin of the project... Where did he find the original project?

Being able to open the project in MPLAB would allow me to simulate portions of the program. I realize I could create a project for the source files in MPLAB but having the original MCP file would be easier.

Regards, Mike
 
Last edited:
Hy guys, sorry for the long period in what i don t answer, the original proiect was:
Four channel pwm driver for blinking led with 12f629.
The source source code, it were made by Geko in september, i just tried to made an 13 led PWM driver with 13 channel, because 12F629 cannot do this i was oriented to use 16F628A. This implies some modifications to the code.
You could search there if you find the MCP file, but isn't , here is the link.

https://www.electro-tech-online.com...m-driver-for-blinking-led-with-12f629.136303/

Kind regards!
 
This is never going to work.
1. You've not modified the startup code to take account for the fact it is running on a different PIC with different registers to initialise.
2a. Adding all the variables for 13 channels won't fit in one bank of memory and since you've not defined them across two banks they end up in the SFR region of bank 1 .
2b. If you fix this you have to rewrite lots of code to switch banks between LED variables - that gives me a headache just thinking about it..
3. The PWM code section now needs so many cycles that it can't refresh faster then 69Hz with a 4Mhz clcok, in fact it will be worse than that because of the other code that has to run so when you've finished it will probably flicker.
4. Since you have run out of I/O pins on the PIC you can't add an external crystal to increase the clock frequency.
5. The code that is used to calculate fade rates for the channels you haven't modified for 13 channels, it still only calculates for the first four. You can't just ignore that and expect the rest of it to work.

Seriously, adding a forth channel to the original code wasn't a huge task, but 13 is going way beyond what it was designed to do. I wouldn't even consider it - you need to look at the whole project and start afresh. Maybe if someone was a very good assembler programmer and were trying to make a point of that they might get it working but I'm sure just writing a new application on a more powerful PIC would be the way to go.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top