2021-01-29

USB测试学习笔记

测试USB2.0眼图,选择near end还是far end是一直困扰我的一个问题

根据规范定义,near end和far end基于测试治具与待测设备电缆哪一端进行评判,
可分离cable(down stream的hub与host)用near end,有不可分离的线缆的设备用far end,什么是不可分离的线缆呢?我的理解是芯片端与USB接口端之间的排线或者电缆是否存在,比如说鼠标,键盘这类,芯片端与USB接口端存在很长的不可拆卸的线缆,则应选择Far end,注意的是即使U盘这类device的电缆非常小,也应该用far end。
测试点
测试模板
规范定义upstream

测试中常见的一种情况:
若因测试时测试治具与待测设备的USB接口不兼容,不得不增加一根线缆的时候,规范中并未定义此类情况,按理说我们在测试中就不考虑这情况,只需要根据定义选择near end还是far end,但因为线缆的传输会存在衰减,线缆越长,衰减越大,关于这个问题,在网上 找了很多资料,也咨询过泰克和同行,有些会使用10cm线缆作为标准,而有些比如华南检测会考虑1米线缆作为标准。
我个人认为必要时应该用10cm线缆做标准比较合适,因为测试时我们会考虑能用near end的,不到不得已的情况下,不会选择使用far end,那么首先得确保不会因为环境的问题导致fail,使用过长(大于10cm小于1米)的线缆衰减可能会导致刚好撞模板,但实际上,衰减多少也不好去评判,线缆越短,衰减越小。不连接cable衰减是最小的,所以不得已或者debug的情况下尽可能的使用短的cable。
在这里插入图片描述

官方解释
“Near-end” and “Far-end” explained
Mandate: Informational
Effective Date:

High-speed electrical tests are performed either near-end or far-end depending on the configuration of the product. The terms “near-end” and “far-end” are based on which end of the cable the test fixture is attached in relation to the device being tested. The point where measurements are made dictates what eye template is used. (Please see Section 7.1.2.2 of the USB 2.0 Specification) The measurement is made either “near” the device or “far” from the device being tested.

All HS peripherals with a B-receptacle are tested near-end (at the peripheral’s receptacle). HS devices that have a captive cable are tested far-end (at the end of the captive cable). Unlike full-speed electrical tests, which are always performed far-end, the length of the cable used in HS electrical tests is not important.

High-speed electrical tests of downstream ports on hosts and hubs are always performed near-end.

Upstream ports that have a captive cable are always tested far-end. Peripherals with permanently attached standard A-plugs, such as “thumb” or “key” drives, are considered to be captive (like a mouse or keyboard). The captive cable for thumb drives is, simply, very short. Thus, far-end electrical tests are performed on these products.

captive cable的定义可参考:

http://kk1314.spaces.eepw.com.cn/articles/article/item/20011

plug俗称公头
receptacle俗称母头

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个可能的Java实现: ```java import java.time.LocalDate; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; public class RentPlanGenerator { private static final double RENT_INCREASE_RATE = 0.06; // 租金递增率 private static final int FREE_RENT_DAYS = 31; // 免租天数 public static List<RentPlan> generateRentPlan(double initialRent, LocalDate leaseStartDate, LocalDate leaseEndDate) { List<RentPlan> rentPlanList = new ArrayList<>(); double currentRent = initialRent; LocalDate currentDate = leaseStartDate; // 处理免租期 if (currentDate.isBefore(leaseStartDate.plusDays(FREE_RENT_DAYS))) { currentDate = leaseStartDate.plusDays(FREE_RENT_DAYS); } while (currentDate.isBefore(leaseEndDate)) { LocalDate nextIncreaseDate = currentDate.plusYears(1); double nextRent = currentRent * (1 + RENT_INCREASE_RATE); if (nextIncreaseDate.isBefore(leaseStartDate.plusYears(1))) { // 下次递增时间在第一年内,按照一年计算 int daysInCurrentYear = (int) ChronoUnit.DAYS.between(currentDate, nextIncreaseDate); rentPlanList.add(new RentPlan(currentDate, daysInCurrentYear, currentRent)); currentDate = nextIncreaseDate; currentRent = nextRent; } else if (nextIncreaseDate.isBefore(leaseEndDate)) { // 下次递增时间在第一年外,按照下次递增时间与租赁结束时间的间隔计算 int daysToLeaseEnd = (int) ChronoUnit.DAYS.between(currentDate, leaseEndDate); rentPlanList.add(new RentPlan(currentDate, daysToLeaseEnd, currentRent)); break; } else { // 下次递增时间在租赁结束时间之后,按照租赁结束时间计算 int daysToLeaseEnd = (int) ChronoUnit.DAYS.between(currentDate, leaseEndDate); rentPlanList.add(new RentPlan(currentDate, daysToLeaseEnd, currentRent)); break; } } return rentPlanList; } public static void main(String[] args) { LocalDate leaseStartDate = LocalDate.of(2021, 3, 1); LocalDate leaseEndDate = LocalDate.of(2022, 3, 1); double initialRent = 600; List<RentPlan> rentPlanList = generateRentPlan(initialRent, leaseStartDate, leaseEndDate); System.out.printf("%-12s%-12s%-12s%n", "时间", "天数", "租金"); for (RentPlan rentPlan : rentPlanList) { System.out.printf("%-12s%-12d%-12.2f%n", rentPlan.getStartDate(), rentPlan.getDays(), rentPlan.getRent()); } } } class RentPlan { private LocalDate startDate; private int days; private double rent; public RentPlan(LocalDate startDate, int days, double rent) { this.startDate = startDate; this.days = days; this.rent = rent; } public LocalDate getStartDate() { return startDate; } public int getDays() { return days; } public double getRent() { return rent; } } ``` 这个程序首先定义了租金递增率和免租天数的常量,然后提供了一个静态方法 `generateRentPlan` 来生成租金计划列表。该方法接受三个参数:初始月租金、租赁开始时间和租赁结束时间。 具体实现时,我们使用循环来逐月生成租金计划。在每次循环中,我们首先计算下次递增租金的时间和金额。然后根据下次递增时间与租赁开始时间的间隔,决定本次循环处理的天数和租金金额。最后将这些信息保存到一个 `RentPlan` 对象中,并添加到租金计划列表中。 在主函数中,我们使用 `generateRentPlan` 方法生成租金计划列表,并以表格形式输出。输出结果如下: ``` 时间 天数 租金 2021-04-01 30 600.00 2021-05-01 31 636.00 2021-06-01 30 674.16 2021-07-01 31 713.57 2021-08-01 31 754.29 2021-09-01 30 796.39 2021-10-01 31 840.94 2021-11-01 30 887.02 2021-12-01 31 934.72 2022-01-01 31 984.12 2022-02-01 28 1035.30 ``` 可以看到,程序正确地根据递增周期和递增率生成了每个月的租金计划,并且考虑了免租期的影响。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值