Pages: 1 [2]   Go Down
Author Topic: Burning Code in a DIY Arduino  (Read 1796 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 2
Posts: 336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

True, but then you have to make sure you don't have anything connected to Tx/Rx for best results.

Quote
So, is that means it is better not to connect any input/output device at the MOSI, MISO and SCK pins ?

It depends on the device a bit. SPI devices are designed for this sort of thing, you just don't activate them through their slave select pin.
So do this means that I cant connect anything to this 2 pins ? Or it is not adisable to connect anything here?
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It depends what you are doing. On the Uno the Tx/Rx pins are connected to the USB chip and have pull-ups on them, making them not particularly useful as input pins.

Also if you put a load on them you may not be able to upload a new sketch until you disconnect it. This may or may not bother you.
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You mention it has pull ups. So meaning that I can put a button there as an input ?

Correct me if I am wrong smiley
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A button to ground should work. Are these just a lot of hypothetical questions or do we have a project here?
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yea, a button to GND and to TX/RX pins should just make it a pull up button right ? So, I think I no need this below code to activate the pull up ?
Code:
digitalWrite(0/1, HIGH)

I am just asking for my own notes so I will becareful when in my project smiley-grin
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Let's not get bogged down here. Possibly that line could be omitted, but if you make a stand-alone version (without the USB chip) then you would need it.
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks alot ! smiley-grin
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes this only makes sense when using USBtinyISP.
I need to learn more on SPI... Actually I have difficulty making a distinction from

UART - This is a Tx -> Rx & Rx -> Tx single device connection right?
I2C - As for as I know, this is a 2 wire protocol which can accept a maximum of 255 channels and any device connected to the same channel gets the message sent
SPI - As for SPI, I will try to see the link but so far I have no clue ! smiley

Cheers
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am too asking questions to learn. I do have a small project (a 16 relay board with 2 pots connected to ADC and 4 buttons) and am trying to design the board from scratch without the usb connection and without the usb-to-serial-ftd-chip.

Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I2C - As for as I know, this is a 2 wire protocol which can accept a maximum of 255 channels and any device connected to the same channel gets the message sent

No. Better read this:

http://www.gammon.com.au/i2c
http://www.gammon.com.au/spi

http://www.gammon.com.au/forum/?id=10918
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So, is that means it is better not to connect any input/output device at the MOSI, MISO and SCK pins ?

You can safely use them for push buttons and similar inputs that don't mind being driven by the programmer, and for non-critical outputs such as the Data and RS inputs of a text-mode LCD display (the LCD ignores what you put on Data and RS until you pulse EN).
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Pages: 1 [2]   Go Up
Jump to: