bit banged Basic52 code for 4-wire serial interface

Hi, Can someone site location or post example code for a MAX6969 LED driver for

8052 project? I have the Max chip for driving LED's prototyping on a 8052 development board. It uses "industry standard" 4-wire serial interface (SPI?). I have BASIC code for a I2C interface.

Largo

Reply to
Largo
Loading thread data ...

Please clairify what you are asking for !

C-code, assembly code, basic code for which basic compiler.

formatting link

This gives you 152,000 hits, there has to be something in there for you.

Once you know what you want/need.

good luck

donald

Reply to
donald

If you can't even manage a bit-banged SPI on your own you shouldn't be programming micros. You might hurt yourself.

--
The Force is dark on one side, light on the other and holds the world
together.

Hmmm, just like Gaffer Tape then.
Reply to
Hot Jock

Donald' I have a 8052 development board. So I can use basic52 code for prototyping the MAX6969 circuitry first. Once this is perfected, the prototype will go over to a PIC micro add on/modification. The PIC code is in assembler. Otherwise, if I use assembly language for the 8051, how different is this from the PIC 16F873 op code?

Largo

Reply to
Largo

Donald, FYI; I'm looking for SPI not I^2C. Thank you for your response. Largo

Reply to
Largo

If I said to you, can I run PC software on a MAC, what would you say ??

( have you looked at the data sheets for these chips )

Do you have a PIC board available ??

Why are you trying to develop on basic52, then try to run on a PIC ???

What development tools for the PIC do you have available ??

A proof of concept is one thing, writting code for two such different processors is just nuts.

Oh, I2C and SPI are also two different animals.

There is tons of examples of software SPI code for PICs all over the net.

There is a hardware SPI port in the 16F873, are you not going to use that?

Again, Google is your friend.

formatting link

Is this your first PIC project ??

donald

Reply to
donald

Donald, I meant conceptually as in flow chart.

I built a PIC ZIF programmer using MPLAB compatable ICD. The one from Olimex.

Maybe better to use the PIC programmer then 8051 board.

There is? Okay, 16F873 datasheet says Pin 15 is SPI port. And it's already used in this existing circuit.

I did the PIC project from existing assembler code and used the ICD to program. Works okay. Although I wish I could use the existing PIC's SPI port to add the MAX chip added functionality. As noted above, that pins already in use. What do I do now?

Thanks for insight on this. Any more suggestions? Largo

Reply to
Largo

Now you say so. :-)

The type of questions you were asking and the BASIC52 part made it look like you were a noob.

Ok, using a soft SPI port is a good idea.

Check out the goolge links, I think you will find what your looking for.

Microchip has some app notes about soft SPI as well. Working assemble code too.

good luck.

donald

Reply to
donald

Thank you. This got me thinking. One more question.

My PIC16F873 circuit has unused pins 5, 6, 7, 18, 23 and 24 which, according to data sheet 18, 23 and 24 used for SPI. Looks like pin 18 for CLK, pin 23 for data in and pin 24 data out to the MAX6969. Forget the 8051 board. If I prototype using my PIC ICD to these pins and sample .asm code from Microchip--if it works, could I just add this new code/module to existing PIC project (code)?

I think I need a new thread...

Largo

Reply to
Largo

Hmmm, your sounding like a noob again. :-0

Yes, if you can find some code, you can use any port pins you want. Set the output lines to output and the input line to input.

I would get the spi code working first, before adding it to your code.

But, you knew that. ;-)

good luck

donald

Reply to
donald

. . .

Oh dear, oh dear. For your application you don't need to read back from the MAX6969 and therefore only need the SCK & SDO pins. Unfortunately, the PIC16F873/6 have these signals on pins 14 & 16 respectively. Now if you actually have PIC16F874/7, then you're getting closer as these signals are on pins 18 & 24 in the DIP version (20 & 26 in PLCC and 37 & 43 in QFP).

It's probably a good idea to read the data sheet before you start.

--
The Force is dark on one side, light on the other and holds the world
together.

Hmmm, just like Gaffer Tape then.
Reply to
Hot Jock

Okay Gaffer Tape. Thanks. In that case, I could move over to the PIC16F877. Other than the boot loader in the 877, what's the difference? Could I just load my original PIC code without any changes?

Largo

Reply to
Largo

Yes

Reply to
donald

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.