Replies: 2 comments
-
On Sat, Aug 3, 2024 at 10:09 AM mcctuxic ***@***.***> wrote:
For the nixie-clock I am trying to build I need a RTC - I have a DS3231
(i2c) breakout board with pullup resistors available.
I already created this piece of code (for testing purposes only for the
first):
\ DS321 precision RTC (I2C)
defined? ds3231-marker [if] ds3231-marker [then]
marker ds3231-marker
begin-module ds3231
gpio import
pin import
i2c import
104 constant ds3231-addr \ $68 => 104
1 constant i2c-dev
6 constant i2c-sdl
7 constant i2c-sda
16 buffer: i2c-buffer
i2c-dev enable-i2c
400000 i2c-dev i2c-clock!
i2c-dev i2c-sdl i2c-pin
i2c-dev i2c-sda i2c-pin
i2c-dev master-i2c
i2c-dev 7-bit-i2c-addr
**ds3231-addr i2c-slave-addr!**
: i2c-show
i2c-buffer 16 i2c>
i2c-buffer dup 16 + dump
;
When compiling this to RAM I got this error:
*ds3231-addr i2c-slave-addr!invalid I2C*
For me it is unclear, what is invalid here:
Is the i2c-addr wrong (I took it from the datasheet of the DS3231-breakout
board (Adafruit).
Is the device wrong?
What you need to specify is:
ds3231-addr i2c-dev i2c-slave-addr!
as there are two I2C peripherals on the RP2040.
Travis
… Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
On 08/03 02:01, tabemann wrote:
On Sat, Aug 3, 2024 at 10:09 AM mcctuxic ***@***.***> wrote:
> For the nixie-clock I am trying to build I need a RTC - I have a DS3231
> (i2c) breakout board with pullup resistors available.
>
> I already created this piece of code (for testing purposes only for the
> first):
>
> \ DS321 precision RTC (I2C)
>
> defined? ds3231-marker [if] ds3231-marker [then]
> marker ds3231-marker
>
> begin-module ds3231
>
> gpio import
> pin import
> i2c import
>
> 104 constant ds3231-addr \ $68 => 104
> 1 constant i2c-dev
> 6 constant i2c-sdl
> 7 constant i2c-sda
>
> 16 buffer: i2c-buffer
>
> i2c-dev enable-i2c
> 400000 i2c-dev i2c-clock!
> i2c-dev i2c-sdl i2c-pin
> i2c-dev i2c-sda i2c-pin
> i2c-dev master-i2c
> i2c-dev 7-bit-i2c-addr
> **ds3231-addr i2c-slave-addr!**
>
> : i2c-show
> i2c-buffer 16 i2c>
> i2c-buffer dup 16 + dump
> ;
>
>
> When compiling this to RAM I got this error:
>
> *ds3231-addr i2c-slave-addr!invalid I2C*
>
> For me it is unclear, what is invalid here:
> Is the i2c-addr wrong (I took it from the datasheet of the DS3231-breakout
> board (Adafruit).
> Is the device wrong?
>
What you need to specify is:
ds3231-addr i2c-dev i2c-slave-addr!
as there are two I2C peripherals on the RP2040.
Travis
> Message ID: ***@***.***>
>
...damn, I overlooked the "i2c" in "( i2c-addr i2c – )" in the
documentation. Sorry, Travis...
Thank you for your help!
…
--
Reply to this email directly or view it on GitHub:
#127 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For the nixie-clock I am trying to build I need a RTC - I have a DS3231 (i2c) breakout board with pullup resistors available.
I already created this piece of code (for testing purposes only for the first):
When compiling this to RAM I got this error:
ds3231-addr i2c-slave-addr!invalid I2C
For me it is unclear, what is invalid here:
Is the i2c-addr wrong (I took it from the datasheet of the DS3231-breakout board (Adafruit).
Is the device wrong?
Beta Was this translation helpful? Give feedback.
All reactions