Search found 68 matches

by Gordon_Hardman
Fri Nov 14, 2014 11:36 pm
Forum: General Discussion and Questions
Topic: What are the I2C error codes?
Replies: 13
Views: 16859

Re: What are the I2C error codes?

Well, I have to conclude there is either something wrong with the initialization, or the way I am doing it. It just started working on I2C1. One thing that is definitely true, it seems that the ctrl-C ctrl-D way of rebooting is different from cycling power! I cycled power numerous times, with no joy...
by Gordon_Hardman
Fri Nov 14, 2014 11:16 pm
Forum: General Discussion and Questions
Topic: What are the I2C error codes?
Replies: 13
Views: 16859

Re: What are the I2C error codes?

BTW- yes, I moved the I2C lines across, and the grounding is excellent.
by Gordon_Hardman
Fri Nov 14, 2014 11:14 pm
Forum: General Discussion and Questions
Topic: What are the I2C error codes?
Replies: 13
Views: 16859

Re: What are the I2C error codes?

This is what I get: i2c = pyb.I2C(1, pyb.I2C.MASTER) >>> i2c.scan() [] >>> pyb.Accel() <Accel> >>> i2c.scan() [] >>> It just froze up on the second I2C port as well, but when I cycled the USB power, it came back- this did not work for I2C1.
by Gordon_Hardman
Fri Nov 14, 2014 9:57 pm
Forum: General Discussion and Questions
Topic: What are the I2C error codes?
Replies: 13
Views: 16859

Re: What are the I2C error codes?

It works perfectly on the other I2C port:

i2c = I2C(2, I2C.MASTER) # create and init as a master

No idea why, but I am not using that for anything, so I have a solution, so long as I only need the one I2C.
by Gordon_Hardman
Fri Nov 14, 2014 9:24 pm
Forum: General Discussion and Questions
Topic: What are the I2C error codes?
Replies: 13
Views: 16859

Re: What are the I2C error codes?

Okay- I changed the code to: import pyb from pyb import I2C i2c = I2C(1, I2C.MASTER) # create and init as a master i2c.init(I2C.MASTER, baudrate=20000) # init as a master addr = 52 while True: addr_list=[] addr_list = i2c.scan() print(addr_list) pyb.delay(2000) And it prints an empty list []. No act...
by Gordon_Hardman
Fri Nov 14, 2014 7:04 pm
Forum: General Discussion and Questions
Topic: What are the I2C error codes?
Replies: 13
Views: 16859

What are the I2C error codes?

My first foray into I2C in the Pyboard... must be doing something dumb! I am trying to talk to a DS2764 on I2C1. I am getting the following: "Exception: HAL_I2C_xxx_Transmit failed with code 2" Code is pretty simple, it is meaningless to the 2764, but I would have expected to see some activity. Moni...
by Gordon_Hardman
Mon Nov 03, 2014 3:43 pm
Forum: General Discussion and Questions
Topic: Timer callback and infinite loop not playing
Replies: 5
Views: 6435

Re: Timer callback and infinite loop not playing

Thanks to both of you! I should have realized, as this is exactly how it works in Synapse Wireless' SNAP embedded Python too. Don't normally think about globals in Python for PCs, with multitasking or threads- just use FIFOs...
by Gordon_Hardman
Thu Oct 30, 2014 4:11 pm
Forum: General Discussion and Questions
Topic: Timer callback and infinite loop not playing
Replies: 5
Views: 6435

Timer callback and infinite loop not playing

A am new to Micropython, so forgive a noob question.. I am trying to have a system where most code executes in an infinite loop. A "background" timer runs at a 100msec rate, and the associated callback sets a flag, which is used in the infinite loop. I have seen on the forum that interrupts should n...