Hi Matt,

On 25.08.14 06:17, Matthew Schinkel wrote:

As for the pins issue, you would use SPI Software instead, or software
for the other lib using the pins (such as serial software).

Thanks for the suggestion! I could choose the right SPI library at compile time depending on a user defined constant or/and the presence of MSSP registers.


    BTW It took me quite some time to understand how to use the ISP
    libraries. Comments and explanations with the various procedures are
    very scarse, far from sufficient for comfortable start of a beginner
    like me.


Maybe it's too late now, but there is this:
http://www.justanotherlanguage.org/content/jallib/tutorials/tutorial_spi_introduction

I should have looked there earlier! Thanks for the link anyway.
BTW: Table 1 in SPI introduction contains errors (such as bytes->bits, which was already reported by someone almost 2 years ago), and number of RS232-devices is 1 AFAIK (although multidrop is possible). Who can edit the pages?

I could have this link added to the SPI lib. The "SPI Modes" section is
especially useful. Even if it's working for you, double check the mode
your using.

It's good to see another SPI lib :) There are likely other libs that use
your first method, but should use SPI instead.

I'm not working on any SPI library let alone creating a new one. But I'll try to reduce redundancy with the MAX7219 libraries by using an SPI library (when possible and appropriate).


Not sure if you need SPI software, but here's a code block for it. There
are little samples using it.

-- setup SPI software
alias spi_master_sw_sdi              is pin_sdi
alias spi_master_sw_sdi_direction    is pin_sdi_direction
alias spi_master_sw_sdo              is pin_sdo
alias spi_master_sw_sdo_direction    is pin_sdo_direction
alias spi_master_sw_sck              is pin_sck
alias spi_master_sw_sck_direction    is pin_sck_direction
-- define spi inputs/outputs
spi_master_sw_sdi_direction = input    -- spi input
spi_master_sw_sdo_direction = output   -- spi output
spi_master_sw_sck_direction = output   -- spi clock
--
include spi_master_sw
spi_master_sw_init(SPI_MODE_11,0) -- init spi, choose mode
alias spi_master is spi_master_sw
alias spi_master_set_speed is spi_master_sw_set_speed
alias spi_master_set_mode is spi_master_sw_set_mode

This is not exactly the code example I'm looking for since is declares aliases for pins_sdi/sdo/sck, which means it uses software-SPI on the same pins as hardware-SPI would use. Thus (1) this is only valid for PICs with MSSP and (2) why would you use software-SPI in this case?

Regards, Rob.



--
R. Hamerling, Netherlands --- http://www.robh.nl

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to