Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

After bootloader works, but through the programmer does not
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
sasha_1973

Bascom Member



Joined: 30 Jul 2013
Posts: 58

ukraine.gif
PostPosted: Fri Mar 20, 2015 3:42 pm    Post subject: Reply with quote

А если PORTB.2 мне нужен для другого, что тогда делать?


And if PORTB.2 is necessary to me for another what then to do?
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6198
Location: Holland

blank.gif
PostPosted: Fri Mar 20, 2015 3:47 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2335

blank.gif
PostPosted: Fri Mar 20, 2015 3:52 pm    Post subject: Reply with quote

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
View user's profile
sasha_1973

Bascom Member



Joined: 30 Jul 2013
Posts: 58

ukraine.gif
PostPosted: Fri Mar 20, 2015 4:19 pm    Post subject: Reply with quote

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
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2335

blank.gif
PostPosted: Fri Mar 20, 2015 4:41 pm    Post subject: Reply with quote

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
View user's profile
sasha_1973

Bascom Member



Joined: 30 Jul 2013
Posts: 58

ukraine.gif
PostPosted: Fri Mar 20, 2015 5:19 pm    Post subject: Reply with quote

Полностью заработал ( 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
View user's profile
sasha_1973

Bascom Member



Joined: 30 Jul 2013
Posts: 58

ukraine.gif
PostPosted: Fri Mar 20, 2015 5:28 pm    Post subject: Reply with quote

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
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
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