Hello :D
You should read datasheet again with more attention :D
I read only 12 pages and find this. Im sure there is more nuances to find...
[quote:be542d0f8b]For any instruction to be accepted, and executed,
Chip Select (S) must be driven High after the rising
edge of Serial Clock (C) for the last bit of the in-
struction, and before the next rising edge of Serial
Clock (C).[/quote:be542d0f8b]
..and instruction for write is:
↧
BASCOM-AVR : Help me to understand what is wrong : REPLY
↧
BASCOM-AVR Old versions : DS1307 : REPLY
When I turn off my TK500 and then turn on my TK500, it goes back to the beginning, why?
DS1307 already includes eproom?
The batteries are fine by now.
Do I have to configure these?
[code:1:d77d30a921]Settime:
_sec = Makebcd(_sec) : _min = Makebcd(_min) : _hour = Makebcd(_hour)
I2cstart ' Generate start code
I2cwbyte Ds1307w ' send address
I2cwbyte 0 ' starting address in 1307
I2cwbyte _sec ' Send Data to SECONDS
I2cwbyte _min ' MINUTES
I2cwbyte _hour ' Hours
I2cstop
Return
Getdatetime:
I2cstart ' Generate start code
I2cwbyte Ds1307w ' send address
I2cwbyte 0 ' start address in 1307
I2cstart ' Generate start code
I2cwbyte Ds1307r ' send address
I2crbyte _sec , Ack
I2crbyte _min , Ack ' MINUTES
I2crbyte _hour , Ack ' Hours
I2crbyte Weekday , Ack ' Day of Week
I2crbyte _day , Ack ' Day of Month
I2crbyte _month , Ack ' Month of Year
I2crbyte _year , Nack ' Year
I2cstop
_sec = Makedec(_sec) : _min = Makedec(_min) : _hour = Makedec(_hour)
_day = Makedec(_day) : _month = Makedec(_month) : _year = Makedec(_year)
Return
Setdate:
_day = Makebcd(_day) : _month = Makebcd(_month) : _year = Makebcd(_year)
I2cstart ' Generate start code
I2cwbyte Ds1307w ' send address
I2cwbyte 4 ' starting address in 1307
I2cwbyte _day ' Send Data to SECONDS
I2cwbyte _month ' MINUTES
I2cwbyte _year ' Hours
I2cstop
Return
[/code:1:d77d30a921]
:lol: :lol: :lol:
↧
↧
BASCOM-AVR : Can not Compile my Programm :/ : REPLY
@MWS
That is to difficult for me^^
I chose the FOR NEXT function. Now im on about 98Kb and 3800 lines^^
this Kinda works too :|
↧
BASCOM-AVR : Help me to understand what is wrong : REPLY
Thanks EDC for the tip !
I read the datasheet, and I think everything is ok, but I still can not record the data, I read but I do not record, what is wrong?
↧
BASCOM-AVR : Can not Compile my Programm :/ : REPLY
Wrote this code-chunk because the obvious system of seven and sure in the hope you're willing to learn, to improve and write better, more clever code.
I made the experience before, that such doesn't work always, which is ok for me.
But as you've also repeatedly posted source-code as bitmap, a bloody nonsense, I conclude you're kindof a slow learner.
This is fine for me too, do your own pace, but don't expect others to go that slow.
↧
↧
PCB's : Advantages of PCB design over bread board : NEWTOPIC
A PCB is used to connect electronic components electrically. This is done by making conductive path ways for circuit connections by etching tracks from copper sheet laminated onto a non-conductive substrate.
A PCB consists of a conducting layer that is made up of thin copper foil. The insulating layer di-electric is laminated together with epoxy resin prepreg. The most commonly used PCB type is the FR-4. Boards may be single sided or double sided. Double sided PCB can be used to connect [url=http://www.kynix.com/Category/]electronic components Category[/url] on both sides through through-hole plating. This is done by copper plating the walls of each hole so as to connect the conductive layers of the PCB.
[b:df9b8a2894]Advantages of PCB over Bread-board[/b:df9b8a2894]
[list:df9b8a2894]You can get a much higher density board with PCB.
You will find the PCB design to be more reliable than the one made on a bread board. The circuit will look neat without any wires popped up and will not fall apart.
You can have very precise control over the circuit component you are using, and you can comfortably fit in odd shaped components that are difficult to fix on a bread board.
For production of large volume of circuit boards, the costs become less and the soldering can be done by fully automated machines.[/list:u:df9b8a2894]
↧
BASCOM-ARDUINO : Arduino as I2C slave : NEWTOPIC
Dear forum, (Nederlands, onderaan)
At HCC-Robotica, I learned (in C) how to make an Arduino a slave.
This slave has 6 registers.
This must also be possible in Bascom, but how do I get it?
To begin with, I want to make a slave without a register.
If that succeeds, I try the slave with 6 registry addresses as on the I2C course.
[size=18:19216aaaaf][b:19216aaaaf]Do you have any idea how to start?[/b:19216aaaaf][/size:19216aaaaf]
best regards, Dré
-=-=-=-
Geacht forum,
Bij HCC-Robotica heb ik (in C geleerd) hoe je van een Arduino een slave maakt.
Deze slave heeft 6 registers.
Dit moet ook in Bascom mogelijk zijn, maar HOE pak ik dat aan?
Om te beginnen wil ik een slave zonder register maken.
Als dat is gelukt, probeer ik de slave met 6 register adressen zoals op de I2C cursus.
[size=18:19216aaaaf][b:19216aaaaf]Heeft u enig idee hoe te beginnen?[/b:19216aaaaf][/size:19216aaaaf]
groeten, Dré
↧
BASCOM-ARDUINO : Arduino as I2C slave : REPLY
We have the I2C slave add on for that.
It works for TWI, USI and XMEGA.
Since this is a commercial add on, we do not allow the use of this forum to produce similar code.
↧
BASCOM-AVR Old versions : DS1307 : REPLY
https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=10729&highlight=i2cscan
Here you can find the i2c scanner. Perhaps you have to change things like regfile, crystal, config sda en slk. Perhaps you can run this to check if you see your ds1307 is seen on the i2c bus before.
Could you please check it. And let us know?
Have fun
Ben Zijlstra
↧
↧
BASCOM-AVR : Atmel-ICE Porgrammer : REPLY
I had a look. I bought it a year ago. It is not available anymore. When i do a new search i see 1 genuine programmer. The others are compliant/fake.
↧
BASCOM-AVR : Simple Sample Programmer : REPLY
No problem, i am used to it :D
Nice to hear your explanation. You are not the first and i always figured that when you know a Marc or Marco, you easily remember that. Same for Eric and Erik.
↧
BASCOM-AVR Old versions : DS1307 : REPLY
It back everytime to the same date and time because of this code:
[code:1:32abddb833]'setup date
_day = 20
_month = 5
_year = 17
Gosub Setdate
'Setup time
_sec = 00
_min = 12
_hour = 16
Gosub Settime [/code:1:32abddb833]
Set time once and then remove or remark this code. Then compile and program microcontroller again.
So microcontroller without this part of code will not set date and time back.
Solution for comfortable setting date and time is made some Menu but this can be dificult to You if you ask about this simple "issue" :D
Try at first to read (with understanding) some example codes from Bascom sample folder. Try also forum searchengine.
Some book or even Google know the answears for these basic questions :D
↧
BASCOM-AVR Old versions : DS1307 : REPLY
[quote:1e4914bc0b="bzijlstra"]https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=10729&highlight=i2cscan
Here you can find the i2c scanner. Perhaps you have to change things like regfile, crystal, config sda en slk. Perhaps you can run this to check if you see your ds1307 is seen on the i2c bus before.
Could you please check it. And let us know?
Have fun
Ben Zijlstra[/quote:1e4914bc0b]
Hi Ben!!
Now compile the i2c scanner. But I get all zero in variable B?
[code:1:1e4914bc0b]$Regfile="m16adef.dat"
$Crystal=4000000
$hwstack=40
$swstack=16
$framesize=32
$sim
$baud = 19200 ' baud rate
Dim B As Byte
Config Scl = Portc.0 ' we need to provide the SCL pin name
Config Sda = Portc.1 ' we need to provide the SDA pin name
'we use the TWI pins of the Mega88
$lib "i2c_twi.lbx" ' we do not use software emulated I2C but the TWI
Print "Scan start"
For B = 0 To 254 Step 2 'for all odd addresses
I2cstart 'send start
I2cwbyte B 'send address
If Err = 0 Then 'we got an ack
Print "Slave at : " ; B ; " hex : " ; Hex(b) ; " bin : " ; Bin(b)
End If
I2cstop 'free bus
Next
Print "End Scan"
End[/code:1:1e4914bc0b]
Are you correct the code?
[code:1:1e4914bc0b] Print "Slave at : " ; B ; " hex : " ; Hex(b) ; " bin : " ; Bin(b)[/code:1:1e4914bc0b]
It came out like this.
[img][/img]
↧
↧
BASCOM-AVR Old versions : DS1307 : REPLY
[quote:47f7bf4b9f="EDC"]It back everytime to the same date and time because of this code:
[code:1:47f7bf4b9f]'setup date
_day = 20
_month = 5
_year = 17
Gosub Setdate
'Setup time
_sec = 00
_min = 12
_hour = 16
Gosub Settime [/code:1:47f7bf4b9f]
Set time once and then remove or remark this code. Then compile and program microcontroller again.
So microcontroller without this part of code will not set date and time back.
Solution for comfortable setting date and time is made some Menu but this can be dificult to You if you ask about this simple "issue" :D
Try at first to read (with understanding) some example codes from Bascom sample folder. Try also forum searchengine.
Some book or even Google know the answears for these basic questions :D[/quote:47f7bf4b9f]
I'm reading help on Bascom i2c and I confirm EDC !! :shock:
↧
BASCOM-AVR Old versions : DS1307 : REPLY
Google for the connection of the DS1307. There should be a pull up's on sda and sclk.
Could you confirm that?
Ben Zijlstra
↧
BASCOM-AVR Old versions : DS1307 : REPLY
Before I had them connected VCC and GND with atmega8 and I replaced with atmega16.
I have them well connected as you are the scheme.
[img][/img]
I'm researching these with bascom and forum help.
[code:1:fa84730de0]I2cwbyte 0 ' start address in 1307[/code:1:fa84730de0]
↧
BASCOM-AVR Old versions : DS1307 : REPLY
I can't see anything wrong in the hardware around the ds1307. But as long as the i2c scanner doesn't see the ds1307 it can not work with it. So you got to get that working first.
I see a lot of discussion from you in this forum about the ds1307 in the year 2014. Is this some of your unfinished project?
Perhaps somebody else got an idea.
Ben Zijlstra
↧
↧
Share your working BASCOM-AVR code here : Attiny13 and Max7219 : NEWTOPIC
A small project to display left or right moving arrows on a max7219 LedModule
It just fits in an Attiny13 (98% filled)
↧
BASCOM-AVR Old versions : DS1307 : REPLY
[quote:ce66e880eb="bzijlstra"]I can't see anything wrong in the hardware around the ds1307. But as long as the i2c scanner doesn't see the ds1307 it can not work with it. So you got to get that working first.
I see a lot of discussion from you in this forum about the ds1307 in the year 2014. Is this some of your unfinished projects?
Perhaps somebody else got an idea.
Ben Zijlstra[/quote:ce66e880eb]
It is an exercise nothing more but I have many to learn and for DS1307 I will do a programmable timer project. :wink:
↧
Share your working BASCOM-AVR code here : Attiny13 and Max7219 : REPLY
Im really like the way this code is described :D
↧