View previous topic :: View next topic |
Author |
Message |
sasha_1973
Joined: 30 Jul 2013 Posts: 58
|
Posted: Fri Mar 20, 2015 3:42 pm Post subject: |
|
|
А если PORTB.2 мне нужен для другого, что тогда делать?
And if PORTB.2 is necessary to me for another what then to do? |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5905 Location: Holland
|
Posted: Fri Mar 20, 2015 3:47 pm Post subject: |
|
|
doesnt matter : as long as you use it in OUTPUT mode.
But hey it worked with the bootloader right? so that can not be a problem! _________________ Mark |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2259
|
Posted: Fri Mar 20, 2015 3:52 pm Post subject: |
|
|
albertsm wrote: | yes i know the data sheet. No need to explain that to me! |
My explanations are not always directed to exact the one person I address, instead I keep the faint hope, that others, for example the TO may draw some knowledge out of it.
Alas it does not work always:
sasha_1973 wrote: | And if PORTB.2 is necessary to me for another what then to do? |
@sasha_1973: If PB2 is output, you use it the same, as you do now.
If PB2 is input and hardware-SPI is required, there's always a soldering iron and some wire somewhere.
Alternatively: get soft-SPI to work. |
|
Back to top |
|
|
sasha_1973
Joined: 30 Jul 2013 Posts: 58
|
Posted: Fri Mar 20, 2015 4:19 pm Post subject: |
|
|
MWS wrote: | Alternatively: get soft-SPI to work. |
Я пробовал программный SPI, эффект тот же самый, не работает?
I tried program SPI, the same effect, doesn't work?
Config Spi = Soft , Din = Pinb.4 , Dout = Portb.3 , Clock = Portb.5 , Ss = Portb.0
Spiinit
Waitms 50 |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2259
|
Posted: Fri Mar 20, 2015 4:41 pm Post subject: |
|
|
sasha_1973 wrote: | I tried program SPI, the same effect, doesn't work? |
This is called discussion forum.
A discussion is defined by questions and replies, this applies to both sides.
I get tired of playing the fool by trying to answer every of your questions, without getting proper feedback.
These are not just problems in translation anymore, this is something about your discussion style and your responsiveness, which is both unacceptable.
Don't forget, I get my things to work, I do not need you to fix something, it may look different the other way.
So, before I answer any further of your questions, or even think about how to help you further, first answer my question:
Does it work with PB2 set to output and hardware SPI?
Last edited by MWS on Fri Mar 20, 2015 8:14 pm; edited 1 time in total |
|
Back to top |
|
|
sasha_1973
Joined: 30 Jul 2013 Posts: 58
|
Posted: Fri Mar 20, 2015 5:19 pm Post subject: |
|
|
Полностью заработал ( Bootloader; USBISP; USBISP MKII) такой вариант:
Completely I earned (Bootloader; USBISP; USBISP MKII) such option:
Code: | Const Const_realization_spi = 0 ' If "0" - implementation of hardware (hardware terminals), if "1" - implementation of software (any conclusions)
#if Const_realization_spi = 0
Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = High , Phase = 0 , Clockrate = 4 , Noss = 0
#endif
#if Const_realization_spi = 1
Config Spi = Soft , Din = Pinb.4 , Dout = Portb.3 , Clock = Portb.5 , Ss = None
#endif
Cs_max7219 Alias Portb.0 : Config Cs_max7219 = Output
Spsr.0 = 1 ' F_spi = F_osc / 2; Double Speed (CK/2) Master SPI Mode
Spiinit
Waitms 50 |
|
|
Back to top |
|
|
sasha_1973
Joined: 30 Jul 2013 Posts: 58
|
Posted: Fri Mar 20, 2015 5:28 pm Post subject: |
|
|
MWS и albertsm, ОГРОМНОЕ СПАСИБО за помощь!
Проблема была в Noss = 1, надо Noss = 0 . Хотя в справке написано - "1 or 0. Use 1 when you do not want the SS signal to be generated in master mode".
MWS и albertsm, MANY THANKS for the help!
The problem was in Noss = 1, Noss = 0 is necessary. Though in the reference it is written - "1 or 0. Use 1 when you do not want the SS signal to be generated in master mode". |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|