Email
 Microcontroller and PC projects Forum Index : Microcontroller and PC projects         Section -- Select Forum -- Off grid living and renewables   - Windmills   - Solar   - EV's Electronics and Microcontrollers   - Electronics   - Microcontroller and PC projects   - PCB Manufacturing Miscellaneous   - Other Stuff   - Site News   - Off topic archive. Classifieds   - Price Watch   - Wanted   - For Sale Guest Book   - Guest Book
 Topic: UNI/O EEPROM Driver
 << Prev Page 1 2 3 4 5 of 5 Next >>
Author
 Message << Prev Topic | Next Topic >>
Geoffg
Guru

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2336
 Posted: 04 August 2017 at 3:48pm | IP Logged
Grogster wrote:
 I would be inclined to make the resistor 10k rather then 100k, just to give the I/O pin a reasonably firm pull-up rather then a weak one

The UNI/O chip seems to have trouble pulling the pin low if the pullup is too strong.

This is what TassyJim found:
TassyJim wrote:
 I put the cro on and did some experimenting with different values of pull-up resistor. With no resistor, one direction goes from ~zero to a high of ~2.5V. With a 10k pull-up it goes from ~0.5V to 3.3V. That seems to agree with the data sheet. I tried a 100k resistor and got close to full voltage swing so will stay with that.

Geoff

Nathan
Regular Member

Joined: 10 January 2016
Location: Germany
Online Status: Offline
Posts: 49
 Posted: 04 August 2017 at 8:59pm | IP Logged
Hi,

some small estimations
(not an exact calculation, only to get a feeling)

lets use Ilowmax something between 200 and 300uA, lets take 240um
Rmin = (VDD - Vlowmax) / Ilowmax
Rmin = ( 3.3V - 0.4V) / 240uA = 12KOhm

IhighMax = leakageIo + leakageUnio = lets say a max around 4-8uA
Rmax = (VDD - 0.7*VDD) / Ihighmax = 0.3 *VDD / Ihighmax = 0.3 *3.3 / 8uA = 123KOhm
Rmax = (VDD - 0.7*VDD) / Ihighmax = 0.3 *VDD / Ihighmax = 0.3 *3.3 / 4uA = 246KOhm

So a 10k Resistor is below or at the border (no low margin anymore)
Rmax strongly depends on the estimated/expected leakage, which limits the high
level during floating bus stage.

If the leakage is to high the signal will no reach a secure high stage in time.
So what to use?

In case the device does not work on some pins I would give a ~56k Ohm resistor a chance. The 100k should be fine in low leakage situations. A non 5V tolerant pin
is a good choice, too.

Max bus cap should not excceed 100pF (pin cap of all devices on the bus and wire cap)
A 100nF cap near the supply pins is required, too. No long wires.

I would use the same supply than than the CPU to keep the h/l switch levels in an acceptable range, that's the reason, why I used 3.3V for estimation.

for real values a pcb-board simulation would be required,
including the pin caps.

Nathan

Geoffg
Guru

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2336
 Posted: 04 August 2017 at 9:46pm | IP Logged
I should also mention that the UNI/O driver enables a weak pullup on the I/O pin.

Geoff

TassyJim
Guru

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2539
 Posted: 04 August 2017 at 9:53pm | IP Logged
I didn't try any pullup values other than 10k and 100k.
The only capacitor I used was a 0.01uF across the power supply pins. Nothing on the data line.
Once I saw close to full supply rail swings on the data line, I stopped playing.

In my setup I have the UNI/O on a flying lead about 75mm long.

Jim

__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm

Nathan
Regular Member

Joined: 10 January 2016
Location: Germany
Online Status: Offline
Posts: 49
 Posted: 04 August 2017 at 11:06pm | IP Logged
Hi Geoff,

there is a very nice application Note.

Quote:
 AN1194"Recommended Usage of Microchip UNI/O® "Bus-Compatible Serial EEPROMs"Page 1,7-8

Hi Jim,
> I didn't try any pullup values other than 10k and 100k.
> The only capacitor I used was a 0.01uF across the power supply pins.
0.1uF is recommended

> Nothing on the data line.
That's fine. There should be no cap at the line.

>Once I saw close to full supply rail swings on the data line, I stopped playing.
>In my setup I have the UNI/O on a flying lead about 75mm long.
75mm WOW!

Geoff must have done a rocket solid software implementation

As long as you are not at the timing borders it will still work.

Nathan

Grogster
Guru

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 5879
 Posted: 05 August 2017 at 1:04am | IP Logged
Okey dokey on the 100k vs 10k stuff - I stand corrected.
So therefore, 100k/100n arrangement would seem to be the engineer's choice then, yes?

I don't have any of these yet, but they ARE on my next order from MC Direct when I send it off.

__________________
Smoke makes things work. When the smoke gets out, it stops!

Geoffg
Guru

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2336
 Posted: 05 August 2017 at 4:03am | IP Logged
Nathan wrote:
 Geoff must have done a rocket solid software implementation

The secret is that the driver monitors any sort of error and if it occurs it will retry ten times before giving up. In my test setup I have seen two or three errors in a row so ten retries should cover intermittent errors.

BTW, this is digital - it should either work or not. But that is not how UNI/O seems to work.

Geoff

Nathan
Regular Member

Joined: 10 January 2016
Location: Germany
Online Status: Offline
Posts: 49
 Posted: 05 August 2017 at 7:55am | IP Logged

Quote:
 BTW, this is digital - it should either work or not. But that is not how UNI/O seems to work.

It's all a question of Manchester Code clock recovery and the jitter.
I agree, at the end it is digital.

There is a very good explanation, for all who want to dig into more details.
(It also includes code examples.)
Quote:
 Atmel Manchester Coding Basics [APPLICATION NOTE] 9164B–AUTO–07/15

Nathan

Nathan
Regular Member

Joined: 10 January 2016
Location: Germany
Online Status: Offline
Posts: 49
 Posted: 05 August 2017 at 8:20am | IP Logged
Grogster wrote:
 Okey dokey on the 100k vs 10k stuff - I stand corrected. So therefore, 100k/100n arrangement would seem to be the engineer's choice then, yes?

Hi 100k is a good value, for experimenting you can just put two in parallel to
get 50k.

Nathan

drkl
Senior Member

Joined: 18 October 2015
Location: Hungary
Online Status: Offline
Posts: 102
 Posted: 20 August 2017 at 3:27pm | IP Logged
Hello,

I don't know where is my mistake.
Here is the code:
I want to write three continous blocks to unio chip:

 OPTION EXPLICIT OPTION DEFAULT NONE DIM C\$,NAME\$,NAME1\$ AS STRING DIM STATUS AS INTEGER,LAB as INTEGER   LAB=19 'I/0 PIN'UNIO ROUTINE IN LIBRARY MAIN:  GEN_STR(50,NAME\$)PRINT NAME\$WR_UNIO(0,50,NAME\$)GEN_STR(50,NAME\$)PRINT NAME\$WR_UNIO(52,50,NAME\$)PAUSE 10GEN_STR(50,NAME\$)PRINT NAME\$WR_UNIO(101,50,NAME\$)PAUSE 10PRINT "READ"RD_UNIO(0,150,NAME1\$)PRINT NAME1\$DOLOOP   '---GENERATING A STRING SUB GEN_STR (LENH AS INTEGER,NAMES\$ AS STRING)     LOCAL INTEGER I    NAMES\$=""         FOR I=1 TO LENH    NAMES\$=NAMES\$+CHR\$(I+32)     NEXT IEND SUB''LAB: THE PIN, GLOBAL VARIABLE, STATUS GLOBAL'---READING A STRING FROM UNIO: BADDR-BEGINADDR, LENH-GIVEN LENGHT, NAMES\$-THE STRINGSUB RD_UNIO(BADDR AS INTEGER,LENH AS INTEGER, NAMES\$ AS STRING)      STATUS = UNIO(LAB,01,BADDR,LENH+1,NAMES\$)END SUB''---WRITING A STRING TO UNIO: BADDR-BEGIN ADDR, LENH-GIVEN LENGHT, NAMES\$-THE STRINGSUB WR_UNIO(BADDR AS INTEGER,LENH AS INTEGER, NAMES\$ AS STRING)    STATUS = UNIO(LAB,02,BADDR,LENH+1,NAMES\$)END SUBEND

The result:

Where is the second and third blocks?

drkl

TassyJim
Guru

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2539
 Posted: 20 August 2017 at 11:20pm | IP Logged
When you read a string, the length is the first character and it is used to limit the length of the returned string. This means that you cannot read more than one string at a time, unless you manipulate the length byte.

I would also test the value of STATUS and use it to retry if needed. The CFUNCTION does retry automatically and seems to be very reliable but, especially with long strings, it is safer to check.

Quote:
 OPTION EXPLICIT OPTION DEFAULT NONE DIM C\$,NAME\$,NAME1\$ AS STRING DIM STATUS AS INTEGER,LAB AS INTEGER LAB=19 'I/0 PIN 'UNIO ROUTINE IN LIBRARYMAIN: GEN_STR(50,NAME\$) PRINT NAME\$ WR_UNIO(1,50,NAME\$) GEN_STR(50,NAME\$) PRINT NAME\$ WR_UNIO(52,50,NAME\$) PAUSE 10 GEN_STR(50,NAME\$) PRINT NAME\$ WR_UNIO(103,50,NAME\$) PAUSE 10 PRINT "READ" RD_UNIO(1,50,NAME1\$) PRINT status,NAME1\$ RD_UNIO(52,50,NAME1\$) PRINT status,NAME1\$ RD_UNIO(103,50,NAME1\$) PRINT status,NAME1\$END DO LOOP '---GENERATING A STRINGSUB GEN_STR (LENH AS INTEGER,NAMES\$ AS STRING) LOCAL INTEGER I NAMES\$="" FOR I=1 TO LENH NAMES\$=NAMES\$+CHR\$(I+32) NEXT IEND SUB ''LAB: THE PIN, GLOBAL VARIABLE, STATUS GLOBAL '---READING A STRING FROM UNIO: BADDR-BEGINADDR, LENH-GIVEN LENGHT, NAMES\$-THE STRINGSUB RD_UNIO(BADDR AS INTEGER,LENH AS INTEGER, NAMES\$ AS STRING) LOCAL n AS INTEGER FOR n = 1 TO 10 STATUS = UNIO(LAB,01,BADDR,LENH+1,NAMES\$) IF status =1 THEN EXIT FOR NEXT nEND SUB ' '---WRITING A STRING TO UNIO: BADDR-BEGIN ADDR, LENH-GIVEN LENGHT, NAMES\$-THE STRINGSUB WR_UNIO(BADDR AS INTEGER,LENH AS INTEGER, NAMES\$ AS STRING) LOCAL n AS INTEGER FOR n = 1 TO 10 STATUS = UNIO(LAB,02,BADDR,LENH+1,NAMES\$) IF status =1 THEN EXIT FOR NEXT nEND SUBEND

I also changed the starting addresses a bit.

Jim

__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm

drkl
Senior Member

Joined: 18 October 2015
Location: Hungary
Online Status: Offline
Posts: 102
 Posted: 21 August 2017 at 10:00am | IP Logged
Hello,
With the help of TassyJim (thank you), I succesfully tested the UNIO driver with 11AA160 chip. The code: