Re: bit banged Basic52 code for 4-wire serial interface



Largo wrote:
"donald" <Donald@xxxxxxxxxxxxxxxx> wrote in message news:PYGdncyMN7NTq-TanZ2dnUVZ_oCvnZ2d@xxxxxxxxxxxxxx

Largo wrote:


"donald" <Donald@xxxxxxxxxxxxxxxx> wrote in message news:ur2dnXW5u9Bmu-TanZ2dnUVZ_uSgnZ2d@xxxxxxxxxxxxxx


Largo wrote:


"donald" <Donald@xxxxxxxxxxxxxxxx> wrote in message news:p5Odnf4I5K9gyeXanZ2dnUVZ_sKqnZ2d@xxxxxxxxxxxxxx



Largo wrote:



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

Please clairify what you are asking for !

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

http://www.google.com/search?hl=en&q=8051+i2c

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


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?

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 )

Donald,
I meant conceptually as in flow chart.



Do you have a PIC board available ??

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


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

Maybe better to use the PIC programmer then 8051 board.


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?

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

Now you say so. :-)

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



Again, Google is your friend.

http://www.google.com/search?q=SPI+PIC+code

Is this your first PIC project ??

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


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


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




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
.



Relevant Pages

  • Re: bit banged Basic52 code for 4-wire serial interface
    ... I have the Max chip for driving LED's ... C-code, assembly code, basic code for which basic compiler. ... code for prototyping the MAX6969 circuitry first. ... There is tons of examples of software SPI code for PICs all over the net. ...
    (sci.electronics.design)
  • Re: bit banged Basic52 code for 4-wire serial interface
    ... I have the Max chip for driving LED's prototyping on ... C-code, assembly code, basic code for which basic compiler. ... There is tons of examples of software SPI code for PICs all over the net. ...
    (sci.electronics.design)
  • Re: 3.3V Microcontroller 5V Device
    ... I am using the Cortex M3 ARM Controller STM 32, ... I can make a 1Mhz signal in controller using PWM and it is having an SPI ... Hardware but both out put is 3.3V but the PINs of STM32 is 5V tollerable. ... so that it could drive a 5 V TTL input (TTL has a weaker HIGH drive than ...
    (comp.arch.embedded)
  • Problem mit AD-Wandler (AD7656)
    ... und über SPI von einem LPC2148 auslesen lassen. ... Die Pins sind alle so ... wie das Datenblatt es vorschreibt und auch das Timing ...
    (de.sci.electronics)
  • Re: SPI communication problem with Si3215 & AT91SAM7SE256
    ... SiLabs) interfaced to SPI master of this MCU in normal individual chip ... The frequency of SPI I am using is 4 MHz. ... their Absolute Maximum ratings that Max Input current on digital Input pins ... Are you sure your multiplexer generates the right chip select signals, ...
    (comp.arch.embedded)