Page 1 of 2

TF Services Interfaces and BBC Micro:bit

Posted: Sun Jan 13, 2019 10:28 am
by henry's cat
Last year I bought a BBC Micro:bit and have been experimenting with the on-board I2C bus and a T. F. Services I2c Parallel Interface. Using Microsoft MakeCode Blocks I have successfully managed to get the interface working after many years of it standing idle. So far I have just set the outputs and have not tried reading any inputs.

The interface seems to work fine at 3.3V rather than the usual 5V and is powered by the Micro:bit 3.3V.

What I have struggled with is trying to understand how each chip in the interface is addressed. The explanation of the address switches and example in the I2C Interface manual is as clear as mud. I've left all the switches off so that the two port addresses are 56 and 57. Can anyone explain clearly how the setting of the switches affects the address range?

Re: TF Services Interfaces and BBC Micro:bit

Posted: Sun Jan 13, 2019 12:44 pm
by Whopper
I2C addressing is based on the most significant 7 bits of the address byte, thus the addressing range is 0 to 127. So if a devices address is 56(Hex) then the binary byte would be 0101 0110. To READ from this address that is the binary code which is sent to all of the present interfaces. Only the correct interface will respond. To WRITE to the same address you need to set the least significant bit to '1', thus for address 56(Hex) you would send binary 0101 0111.

Google can be very helpful with stuff like this.


Whopper

Re: TF Services Interfaces and BBC Micro:bit

Posted: Sun Jan 13, 2019 10:20 pm
by NormanDunbar
This is a good introduction to i2c: https://www.best-microcontroller-projec ... orial.html.

This is larger: https://en.m.wikipedia.org/wiki/I2C.

HTH


Cheers,
Norm.

Re: TF Services Interfaces and BBC Micro:bit

Posted: Fri Jan 18, 2019 12:06 pm
by tonyfirshman
The question was asking about the address switches, not actually coding data for input/output. All the switches do is set the chip address. This is is seven bits for the chips I used, but three are set to '1' by the parallel interface circuit board. The range is set by the manufacturer to a limited range for each chip. As the manual says: "Address range of each of the PCF8574A chips in the interface is 56 to 63. ". The four switches on the interface are completing a 7-bit value in this range.

There are only two variables needed by any controlling software - chip address (7 bit) and data (8 bit).

Good to hear that it still works after all these years, and even at 3.5V. I am not sure the chip I used is designed for that voltage, so might not be 100% reliable.

Re: TF Services Interfaces and BBC Micro:bit

Posted: Fri Jan 18, 2019 1:38 pm
by pjw
Welcome aboard, Tony! I hope youre here to stay!

Re: TF Services Interfaces and BBC Micro:bit

Posted: Fri Jan 18, 2019 2:23 pm
by tonyfirshman
Maybe! I am connected to the QL now with a rubber band. I found this thread as Dilwyn's homepage (hosted on my server) had a charset error. However my QL knowledge was frozen 10 years ago (8-)#

It took me a little to work out who 'PJW' was. Do you still have your (long) hair? My beard is still there (whiter) but little on top.
How does one get these threads emailed, like all other forums do by default?

Re: TF Services Interfaces and BBC Micro:bit

Posted: Fri Jan 18, 2019 2:47 pm
by tonyfirshman
Just worked out how to upload my image. Bad that the 'ONLINE' banner obscures part of it! ... and there seems to be no way to configure to post replies to threads I am involved in. If so that is very bad. I suspect then I will not see any replies, as I will forget tomorrow to follow up (8-)#

Also wouldn't it be a good idea if a welcome message was sent pointing out how to amend one's profile. Maybe that is to come!

Re: TF Services Interfaces and BBC Micro:bit

Posted: Fri Jan 18, 2019 2:51 pm
by tonyfirshman
... and no 'edit' key. When I said 'post' replies, I meant 'email' replies, of course.

Re: TF Services Interfaces and BBC Micro:bit

Posted: Fri Jan 18, 2019 3:34 pm
by tofro
Tony,

you can configure notifications sent out via eMail when various conditions apply - see "User Profile (the guy on the top right)"->"User Control Panel", then "Board Preferences", then "Edit Notification Options". Check "Someone replies to a topic to which you are subscribed" and "Someone creates a topic in a forum to which you are subscribed" to get notified when a message in some topic you're interested pops up.

Tobias

Re: TF Services Interfaces and BBC Micro:bit

Posted: Fri Jan 18, 2019 7:55 pm
by Derek_Stewart
Hi,

The Q68 has a I2C interface on the board, which I have fitted a SIL header. All Tony's Interfaces can be used.

The only problem is the lack of external I2C connector when the Q68 board is fitted into a case. I did think of fitting a 4 pin mini Din socket to the side, but this drilling the case and walls have thick metal, which cause problems.

A question about the Microbit, which is programmed by the USB port, can an emulator access the microbit?

Pity there is no Serial to USB adapter available...